summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
Commit message (Collapse)AuthorAgeFilesLines
* IFQ_POLL_NOLOCK() cannot be used without locks.Luiz Souza2017-09-251-6/+0
| | | | | | | Ticket #7879 Ticket #7877 (cherry picked from commit 3e2118820ae6f7dbe953f0a6333e82fdba0b6053)
* Fix the counter values for VLAN interfaces. The packet bytes are already ↵Luiz Souza2017-08-171-6/+2
| | | | | | | | counted in IFQ_HANDOFF(). Ticket #7751 (cherry picked from commit 327d0a443586caf89a7d663c081f536cb4bba770)
* Import pfSense patch if_vlan_altq.diffLuiz Otavio O Souza2017-07-201-87/+92
| | | | | | Ticket #7219 (cherry picked from commit 5c1daa5ea1098b67d4c331d5e21b39178d616031)
* MFC r318689: Add parent interface reference counting to if_vlan.mav2017-05-301-14/+26
| | | | Using plain ifunit() looks like a request for troubles.
* MFC r317585: Propagate IFCAP_LRO from trunk to vlan interface.mav2017-05-161-0/+10
| | | | | False positive here cost nothing, while false negative may lead to some confusions.
* MFC r317547: Allow some control over enabled capabilities for if_vlan.mav2017-05-161-19/+45
| | | | | | | It improves interoperability with if_bridge, which may need to disable some capabilities not supported by other members. IMHO there is still open question about LRO capability, which may need to be disabled on physical interface.
* MFC r316716:ae2017-04-181-3/+6
| | | | | | | | | | | | Inherit IPv6 checksum offloading flags to vlan interfaces. if_vlan(4) interfaces inherit IPv4 checksum offloading flags from the parent when VLAN_HWCSUM and VLAN_HWTAGGING flags are present on the parent interface. Do the same for IPv6 checksum offloading flags. Reported by: Harry Schmalzbauer Reviewed by: np, gnn Differential Revision: https://reviews.freebsd.org/D10356
* Get closer to a VIMAGE network stack teardown from top to bottom ratherbz2016-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than removing the network interfaces first. This change is rather larger and convoluted as the ordering requirements cannot be separated. Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and related modules to their own SI_SUB_PROTO_FIREWALL. Move initialization of "physical" interfaces to SI_SUB_DRIVERS, move virtual (cloned) interfaces to SI_SUB_PSEUDO. Move Multicast to SI_SUB_PROTO_MC. Re-work parts of multicast initialisation and teardown, not taking the huge amount of memory into account if used as a module yet. For interface teardown we try to do as many of them as we can on SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling over a higher layer protocol such as IP. In that case the interface has to go along (or before) the higher layer protocol is shutdown. Kernel hhooks need to go last on teardown as they may be used at various higher layers and we cannot remove them before we cleaned up the higher layers. For interface teardown there are multiple paths: (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), (b) any interface is moved from a virtual network stack to a different network stack ("vmove"), or (c) a virtual network stack is being shut down. All code paths go through if_detach_internal() where we, depending on the vmove flag or the vnet state, make a decision on how much to shut down; in case we are destroying a VNET the individual protocol layers will cleanup their own parts thus we cannot do so again for each interface as we end up with, e.g., double-frees, destroying locks twice or acquiring already destroyed locks. When calling into protocol cleanups we equally have to tell them whether they need to detach upper layer protocols ("ulp") or not (e.g., in6_ifdetach()). Provide or enahnce helper functions to do proper cleanup at a protocol rather than at an interface level. Approved by: re (hrs) Obtained from: projects/vnet Reviewed by: gnn, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6747
* Add support to priority code point (PCP) that is an 3-bit fieldaraujo2016-06-061-9/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | which refers to IEEE 802.1p class of service and maps to the frame priority level. Values in order of priority are: 1 (Background (lowest)), 0 (Best effort (default)), 2 (Excellent effort), 3 (Critical applications), 4 (Video, < 100ms latency), 5 (Video, < 10ms latency), 6 (Internetwork control) and 7 (Network control (highest)). Example of usage: root# ifconfig em0.1 create root# ifconfig em0.1 vlanpcp 3 Note: The review D801 includes the pf(4) part, but as discussed with kristof, we won't commit the pf(4) bits for now. The credits of the original code is from rwatson. Differential Revision: https://reviews.freebsd.org/D801 Reviewed by: gnn, adrian, loos Discussed with: rwatson, glebius, kristof Tested by: many including Matthew Grooms <mgrooms__shrew.net> Obtained from: pfSense Relnotes: Yes
* sys/net*: minor spelling fixes.pfg2016-05-031-2/+2
| | | | No functional change.
* Move iflladdr_event eventhandler invocation to if_setlladdr.melifaro2015-11-141-5/+2
| | | | Suggested by: glebius
* Use lladdr_event to propagate gratiotus arp.melifaro2015-11-091-2/+5
| | | | Differential Revision: https://reviews.freebsd.org/D4019
* Don't propagate SIOCSIFCAPS from a vlan(4) to its parent. This leads toglebius2015-04-231-21/+0
| | | | | | | | | quite unexpected result of toggling capabilities on the neighbour vlan(4) interfaces. Reviewed by: melifaro, np Differential Revision: https://reviews.freebsd.org/D2310 Sponsored by: Nginx, Inc.
* Fix couple of fallouts from r280280. The first one is a simple typo,glebius2015-03-251-2/+1
| | | | | | | | | | | | where counter was incremented on parent, instead of vlan(4) interface. The second is more complicated. Historically, in our stack the incoming packets are accounted in drivers, while incoming bytes for Ethernet drivers are accounted in ether_input_internal(). Thus, it should be removed from vlan(4) driver. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Make vlan_config() the signle point of validity checks.glebius2015-03-201-33/+12
| | | | Sponsored by: Nginx, Inc.
* In vlan_clone_match_ethervid():glebius2015-03-201-33/+33
| | | | | | | | - Use ifunit() instead of going through the interface list ourselves. - Remove unused parameter. - Move the most important comment above the function. Sponsored by: Nginx, Inc.
* Tiny comment fix.glebius2015-03-201-1/+1
|
* Now, when r272244 introduced counter(9) based counters for all interfaces,glebius2015-03-201-57/+9
| | | | | | | revert the r271538, which did that for vlan(4) only. No objections: melifaro Sponsored by: Nginx, Inc.
* Handle SIOCSIFCAP by propogating the request to the parent interface. Thisdelphij2015-02-201-0/+21
| | | | | | | | | allows adding an vlan interface into a bridge. Thanks for William Katsak <wkatsak cs rutgers edu> for testing and fixing an issue in my previous patch draft. MFC after: 2 weeks
* Virtualize net.link.vlan.soft_pad.hrs2014-10-021-4/+5
|
* Improve transmit sending offload, TSO, algorithm in general.hselasky2014-09-221-2/+4
| | | | | | | | | | | | | | | | | The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. Reviewed by: adrian, rmacklem Sponsored by: Mellanox Technologies MFC after: 1 week
* Mechanically convert to if_inc_counter().glebius2014-09-191-2/+2
|
* While not too late rename 'ifnet_counter' to 'ift_counter'. One of theglebius2014-09-181-2/+2
| | | | | | | | imporant moments that we discussed with Marcel and Anuranjan was that a converted driver should return false for 'grep ifnet if_driver.c' :) Sponsored by: Netflix Sponsored by: Nginx, Inc.
* While not too late rename if_get_counter_compat() to if_get_counter_default().glebius2014-09-181-1/+1
| | | | | | | The compat counters will go away, but the function will remain in its place, and in all places where it is going to be called. Discussed with: melifaro
* Revert r271735. The comment is absolutely correct, we do not support 802.1p ↵araujo2014-09-181-1/+2
| | | | | | priority tagging. I got confused with the packet tagged and packet to be tagged. Spotted by: glebius
* Remove old comment, we already do 802.1q tagging.araujo2014-09-181-2/+1
| | | | | | | Phabric: D797 Reviewed by: kevlo Approved by: kevlo Sponsored by: QNAP Systems Inc.
* * Fix if_omcast handlingmelifaro2014-09-161-6/+11
| | | | | | | * Convert if_oerrors to pcpu. Suggested by: glebius MFC after: 2 weeks
* Revert r271504. A new patch to solve this issue will be made.hselasky2014-09-131-2/+2
| | | | Suggested by: adrian @
* Switch if_vlan(4) to rmlock.melifaro2014-09-131-10/+13
| | | | MFC after: 2 weeks
* Switch if_vlan(4) to use counter(9) using newmelifaro2014-09-131-5/+48
| | | | if_get_counter api.
* Improve transmit sending offload, TSO, algorithm in general.hselasky2014-09-131-2/+2
| | | | | | | | | | | | | | | | The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. MFC after: 1 week Sponsored by: Mellanox Technologies
* Clean up unused CSUM_FRAGMENT.glebius2014-09-031-1/+1
| | | | Sponsored by: Nginx, Inc.
* Improve locking of multicast addresses in VLAN and LAGG interfaces.mav2014-08-041-13/+18
| | | | | | | This fixes several scenarios of reproducible panics, cause by races between multicast address changes and interface destruction. MFC after: 2 weeks
* Vlan did not set the value of if_hw_tsomax, so when vlanrmacklem2014-04-151-0/+2
| | | | | | | | | | was stacked on top of a network interface that set if_hw_tsomax, tcp_output() would see the default value instead of the value set by the network interface. This patch modifies vlan so that it sets if_hw_tsomax to the value of the parent interface. Reviewed by: glebius MFC after: 2 weeks
* Include necessary headers that now are available due to pollutionglebius2013-10-281-0/+1
| | | | | | | via if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-261-0/+1
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Return ENETDOWN when the parent interface is down.hrs2013-06-161-1/+1
| | | | MFC after: 1 week
* Recover missing arp_ifinit() call.oleg2013-04-181-0/+6
| | | | MFC after: 2 weeks
* Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability.andre2012-11-271-1/+1
| | | | | | | | Checksumming the IP header of fragments is no different from doing normal IP headers. Discussed with: yongari MFC after: 1 week
* Make the "struct if_clone" opaque to users of the cloning API. Usersglebius2012-10-161-12/+13
| | | | | | | | | | | | now use function calls: if_clone_simple() if_clone_advanced() to initialize a cloner, instead of macros that initialize if_clone structure. Discussed with: brooks, bz, 1 year ago
* Revert previous commit...kevlo2012-10-101-1/+1
| | | | Pointyhat to: kevlo (myself)
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* Fix a silly grammar bogon.jhb2012-08-211-1/+1
| | | | Submitted by: Stephen McKay
* Refine the changes made in r208212 to avoid bogus failures fromjhb2012-08-201-13/+21
| | | | | | | | | | | | | if_delmulti() when clearing the configuration for a subinterface when the parent interface is being detached. The current code was still triggering an assertion in if_delmulti() due to the parent interface being partially detached. Fix this by not calling if_delmulti() at all if the parent interface is being detached. Warn if if_delmulti() fails when the parent is not being detached (but similar to 208212, still proceed with tearing down the vlan state). Tested by: ae@ MFC after: 1 month
* - Updated TOE support in the kernel.np2012-06-191-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs. These are available as t3_tom and t4_tom modules that augment cxgb(4) and cxgbe(4) respectively. The cxgb/cxgbe drivers continue to work as usual with or without these extra features. - iWARP driver for Terminator 3 ASIC (kernel verbs). T4 iWARP in the works and will follow soon. Build-tested with make universe. 30s overview ============ What interfaces support TCP offload? Look for TOE4 and/or TOE6 in the capabilities of an interface: # ifconfig -m | grep TOE Enable/disable TCP offload on an interface (just like any other ifnet capability): # ifconfig cxgbe0 toe # ifconfig cxgbe0 -toe Which connections are offloaded? Look for toe4 and/or toe6 in the output of netstat and sockstat: # netstat -np tcp | grep toe # sockstat -46c | grep toe Reviewed by: bz, gnn Sponsored by: Chelsio communications. MFC after: ~3 months (after 9.1, and after ensuring MFC is feasible)
* Clarify throughout the vlan(4) code the difference between a "tag" (therwatson2012-01-121-49/+56
| | | | | | | | | | | | | 802.1q-defined 16-bit VID, CFI, and PCP field in host by order) and a VLAN ID (VID). Tags go in packets. VIDs identify VLANs. No functional change is intended, so this should be safe to MFC. Further cleanup with functional changes will be committed separately (for example, renaming vlan_tag/vlan_tag_p, which modify the KPI and KBI). Reviewed by: bz Sponsored by: ADARA Networks, Inc. MFC after: 3 days
* Refine last comment.rwatson2012-01-051-1/+1
| | | | | | Submitted by: joeld Sponsored by: ADARA Networks, Inc. MFC after: 3 days
* Add comment to the VLAN code about its integration with VIMAGE: we see whatrwatson2012-01-051-0/+7
| | | | | | | | | | the code is doing, we recognise the legitimacy of its goal, but we're not quite sure it's going about it the right way. More pondering is clearly required. Sponsored by: ADARA Networks, Inc. Discussed with: bz MFC after: 3 days
* Update if_obytes and if_omcast after successful transmit.yongari2011-12-291-4/+8
| | | | | | | | | | While I'm here update if_oerrors if parent interface of vlan is not up and running. Previously it updated collision counter and it was confusing to interprete it. PR: kern/163478 Reviewed by: glebius, jhb Tested by: Joe Holden < lists <> rewt dot org dot uk >
* Change the if_vlan driver to use if_transmit for forwarding packets to thejhb2011-11-281-83/+79
| | | | | | | | | parent interface. This avoids the overhead of queueing a packet to an IFQ only to immediately dequeue it again. Suggested by: np Reviewed by: brooks MFC after: 1 month
OpenPOWER on IntegriCloud