1. 20 4月, 2013 2 次提交
    • P
      net: vlan: add 802.1ad support · 8ad227ff
      Patrick McHardy 提交于
      Add support for 802.1ad VLAN devices. This mainly consists of checking for
      ETH_P_8021AD in addition to ETH_P_8021Q in a couple of places and check
      offloading capabilities based on the used protocol.
      
      Configuration is done using "ip link":
      
      # ip link add link eth0 eth0.1000 \
      	type vlan proto 802.1ad id 1000
      # ip link add link eth0.1000 eth0.1000.1000 \
      	type vlan proto 802.1q id 1000
      
      52:54:00:12:34:56 > 92:b1:54:28:e4:8c, ethertype 802.1Q (0x8100), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
          20.1.0.2 > 20.1.0.1: ICMP echo request, id 3003, seq 8, length 64
      92:b1:54:28:e4:8c > 52:54:00:12:34:56, ethertype 802.1Q-QinQ (0x88a8), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 47944, offset 0, flags [none], proto ICMP (1), length 84)
          20.1.0.1 > 20.1.0.2: ICMP echo reply, id 3003, seq 8, length 64
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8ad227ff
    • P
      net: vlan: prepare for 802.1ad support · 1fd9b1fc
      Patrick McHardy 提交于
      Make the encapsulation protocol value a property of VLAN devices and change
      the device lookup functions to take the protocol value into account.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1fd9b1fc
  2. 11 2月, 2013 1 次提交
  3. 09 12月, 2011 3 次提交
  4. 22 7月, 2011 1 次提交
  5. 18 7月, 2011 1 次提交
    • D
      net: vlan, qlcnic: make vlan_find_dev private · 69ecca86
      David Lamparter 提交于
      there is only one user of vlan_find_dev outside of the actual vlan code:
      qlcnic uses it to iterate over some VLANs it knows.
      
      let's just make vlan_find_dev private to the VLAN code and have the
      iteration in qlcnic be a bit more direct. (a few rcu dereferences less
      too)
      Signed-off-by: NDavid Lamparter <equinox@diac24.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Amit Kumar Salecha <amit.salecha@qlogic.com>
      Cc: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
      Cc: linux-driver@qlogic.com
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69ecca86
  6. 26 5月, 2011 1 次提交
  7. 13 4月, 2011 1 次提交
    • J
      net: vlan: make non-hw-accel rx path similar to hw-accel · bcc6d479
      Jiri Pirko 提交于
      Now there are 2 paths for rx vlan frames. When rx-vlan-hw-accel is
      enabled, skb is untagged by NIC, vlan_tci is set and the skb gets into
      vlan code in __netif_receive_skb - vlan_hwaccel_do_receive.
      
      For non-rx-vlan-hw-accel however, tagged skb goes thru whole
      __netif_receive_skb, it's untagged in ptype_base hander and reinjected
      
      This incosistency is fixed by this patch. Vlan untagging happens early in
      __netif_receive_skb so the rest of code (ptype_all handlers, rx_handlers)
      see the skb like it was untagged by hw.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
      v1->v2:
      	remove "inline" from vlan_core.c functions
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bcc6d479
  8. 17 11月, 2010 1 次提交
  9. 16 11月, 2010 1 次提交
  10. 21 10月, 2010 1 次提交
  11. 06 10月, 2010 1 次提交
    • E
      net: add a core netdev->rx_dropped counter · caf586e5
      Eric Dumazet 提交于
      In various situations, a device provides a packet to our stack and we
      drop it before it enters protocol stack :
      - softnet backlog full (accounted in /proc/net/softnet_stat)
      - bad vlan tag (not accounted)
      - unknown/unregistered protocol (not accounted)
      
      We can handle a per-device counter of such dropped frames at core level,
      and automatically adds it to the device provided stats (rx_dropped), so
      that standard tools can be used (ifconfig, ip link, cat /proc/net/dev)
      
      This is a generalization of commit 8990f468 (net: rx_dropped
      accounting), thus reverting it.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      caf586e5
  12. 21 9月, 2010 1 次提交
  13. 29 6月, 2010 1 次提交
  14. 17 2月, 2010 1 次提交
    • T
      percpu: add __percpu sparse annotations to net · 7d720c3e
      Tejun Heo 提交于
      Add __percpu sparse annotations to net.
      
      These annotations are to make sparse consider percpu variables to be
      in a different address space and warn if accessed without going
      through percpu accessors.  This patch doesn't affect normal builds.
      
      The macro and type tricks around snmp stats make things a bit
      interesting.  DEFINE/DECLARE_SNMP_STAT() macros mark the target field
      as __percpu and SNMP_UPD_PO_STATS() macro is updated accordingly.  All
      snmp_mib_*() users which used to cast the argument to (void **) are
      updated to cast it to (void __percpu **).
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d720c3e
  15. 18 11月, 2009 1 次提交
    • E
      vlan: Precise RX stats accounting · 9793241f
      Eric Dumazet 提交于
      With multi queue devices, its possible that several cpus call
      vlan RX routines simultaneously for the same vlan device.
      
      We update RX stats counter without any locking, so we can
      get slightly wrong counters.
      
      One possible fix is to use percpu counters, to get precise
      accounting and also get guarantee of no cache line ping pongs
      between cpus.
      
      Note: this adds 16 bytes (32 bytes on 64bit arches) of percpu
      data per vlan device.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9793241f
  16. 28 10月, 2009 1 次提交
  17. 27 10月, 2009 1 次提交
    • E
      vlan: allow null VLAN ID to be used · 05423b24
      Eric Dumazet 提交于
      We currently use a 16 bit field (vlan_tci) to store VLAN ID/PRIO on a skb.
      
      Null value is used as a special value, meaning vlan tagging not enabled.
      This forbids use of null vlan ID.
      
      As pointed by David, some drivers use the 3 high order bits (PRIO)
      
      As VLAN ID is 12 bits, we can use the remaining bit (CFI) as a flag, and
      allow null VLAN ID.
      
      In case future code really wants to use VLAN_CFI_MASK, we'll have to use
      a bit outside of vlan_tci.
      
      #define VLAN_PRIO_MASK         0xe000 /* Priority Code Point */
      #define VLAN_PRIO_SHIFT        13
      #define VLAN_CFI_MASK          0x1000 /* Canonical Format Indicator */
      #define VLAN_TAG_PRESENT       VLAN_CFI_MASK
      #define VLAN_VID_MASK          0x0fff /* VLAN Identifier */
      Reported-by: NGertjan Hofman <gertjan_hofman@yahoo.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05423b24
  18. 29 10月, 2008 1 次提交
  19. 08 7月, 2008 3 次提交
  20. 06 7月, 2008 2 次提交
  21. 23 5月, 2008 1 次提交
  22. 21 5月, 2008 1 次提交
  23. 16 4月, 2008 3 次提交
  24. 02 4月, 2008 1 次提交
  25. 29 1月, 2008 4 次提交
  26. 11 11月, 2007 1 次提交
  27. 11 10月, 2007 1 次提交
  28. 15 7月, 2007 1 次提交
  29. 12 7月, 2007 1 次提交
    • P
      [VLAN]: Fix MAC address handling · 8c979c26
      Patrick McHardy 提交于
      The VLAN MAC address handling is broken in multiple ways. When the address
      differs when setting it, the real device is put in promiscous mode twice,
      but never taken out again. Additionally it doesn't resync when the real
      device's address is changed and needlessly puts it in promiscous mode when
      the vlan device is still down.
      
      Fix by moving address handling to vlan_dev_open/vlan_dev_stop and properly
      deal with address changes in the device notifier. Also switch to
      dev_unicast_add (which needs the exact same handling).
      
      Since the set_mac_address handler is identical to the generic ethernet one
      with these changes, kill it and use ether_setup().
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c979c26