summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* In r191367 the need for if_free_type() was removed and a new memberbrooks2011-11-111-2/+2
| | | | | | | | if_alloctype was used to store the origional interface type. Take advantage of this change by removing all existing uses of if_free_type() in favor of if_free(). MFC after: 1 Month
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-2/+4
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* - Merge changes to the base system to support OFED. These includejeff2011-03-211-65/+198
| | | | | a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND, and other miscellaneous small features.
* Allow for vlan(4) ifnets to have overlapping unit numbers if they arezec2010-11-221-0/+42
| | | | | | | | | | | | | | | | created in separated vnets. As a side-effect of having a separated if_cloner instance for each vnet, all vlan ifnets created in a vnet will be automatically destroyed when vnet teardown is initiated. Disallow SIOCSETVLAN and SIOCGETVLAN ioctls on vlan ifnets which are associated with physical ifnets residing in parent vnets. This is an interim vlan-specific solution which will be superseded by a more generic if_cloner V_irtualization change from p4. For nooptions VIMAGE builds, this should be a no-op change. Discussed with: bz MFC after: 3 days
* Adjust the interface type in the link layer socket address for vlan(4)jhb2010-08-061-0/+5
| | | | | | | | | | | interfaces to be a vlan (IFT_L2VLAN) rather than an Ethernet interface (IFT_ETHER). The code already fixed if_type in the ifnet causing some places to report the interface as a vlan (e.g. arp -a output) and other places to report the interface as Ethernet (getifaddrs(3)). Now they should all report IFT_L2VLAN. Reviewed by: brooks MFC after: 1 month
* Ignore failures from removing multicast addresses from the parent (trunk)jhb2010-05-171-13/+14
| | | | | | | | | | | | | | | | | | interface when tearing down a vlan interface. If a trunk interface is detached, all of its multicast addresses are removed before the ifnet departure eventhandlers are invoked. This means that all of the multicast addresses are removed before the vlan interfaces are removed which causes the if_delmulti() calls in the vlan teardown to fail. In the VLAN_ARRAY case, this left vlan interfaces referencing a no longer valid parent interface. In the !VLAN_ARRAY case, the eventhandler gets stuck in an infinite loop retrying vlan_unconfig_locked() forever. In general the callers of vlan_unconfig_locked() do not expect nor handle failure, so I believe it is safer to ignore the errors and tear down as much of the vlan state as possible. Silence from: net@ MFC after: 4 days
* Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIAemaste2010-03-211-2/+2
| | | | | | ioctl call, as it may sleep. Reviewed by: rwatson
* Add __FBSDID.yongari2010-02-211-2/+3
| | | | Reviewed by: sam
* Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSOyongari2010-02-201-1/+16
| | | | | | | | from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to TSO over VLAN without VLAN hardware tagging. Driver changes and userland support will follow. Reviewed by: thompsa
* Do not hold the lock over if_setlladdr() as it calls into the interface driverthompsa2010-01-191-4/+9
| | | | init routine.
* Declare a new EVENTHANDLER called iflladdr_event which signals that the L2thompsa2010-01-181-0/+42
| | | | | | | | | | | | | address on an interface has changed. This lets stacked interfaces such as vlan(4) detect that their lower interface has changed and adjust things in order to keep working. Previously this situation broke at least vlan(4) and lagg(4) configurations. The EVENTHANDLER_INVOKE call was not placed within if_setlladdr() due to the risk of a loop. PR: kern/142927 Submitted by: Nikolay Denev
* Use stricter checking to match possible vlan clones by not allowing extrajhb2009-12-311-6/+8
| | | | | | | garbage characters around or within the tag. Reviewed by: brooks MFC after: 3 days
* The devices that supported EVFILT_NETDEV kqueue filters were removed inbrooks2009-12-311-3/+3
| | | | | | | | | | | | r195175. Remove all definitions, documentation, and usage. fifo_misc.c: Remove all kqueue tests as fifo_io.c performs all those that would have remained. Reviewed by: rwatson MFC after: 3 weeks X-MFC note: don't change vlan_link_state() function signature
OpenPOWER on IntegriCloud