09 Dec, 2011

3 commits


22 Jul, 2011

1 commit


18 Jul, 2011

1 commit

  • 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: David Lamparter
    Cc: Patrick McHardy
    Cc: Amit Kumar Salecha
    Cc: Anirban Chakraborty
    Cc: linux-driver@qlogic.com
    Signed-off-by: David S. Miller

    David Lamparter
     

26 May, 2011

1 commit


13 Apr, 2011

1 commit

  • 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: Jiri Pirko

    v1->v2:
    remove "inline" from vlan_core.c functions
    Signed-off-by: David S. Miller

    Jiri Pirko
     

17 Nov, 2010

1 commit

  • vlan is a stacked device, like tunnels. We should use the lockless
    mechanism we are using in tunnels and loopback.

    This patch completely removes locking in TX path.

    tx stat counters are added into existing percpu stat structure, renamed
    from vlan_rx_stats to vlan_pcpu_stats.

    Note : this partially reverts commit 2e59af3dcbdf (vlan: multiqueue vlan
    device)

    Signed-off-by: Eric Dumazet
    Cc: Patrick McHardy
    Signed-off-by: David S. Miller

    Eric Dumazet
     

16 Nov, 2010

1 commit

  • Now that VLAN packets are tagged in dev_hard_start_xmit()
    at the bottom of the stack we no longer need to tag them
    in the 8021Q module (Except in the !VLAN_FLAG_REORDER_HDR
    case).

    This allows the accel path and non accel paths to be consolidated.
    Here the vlan_tci in the skb is always set and we allow the
    stack to add the actual tag in dev_hard_start_xmit().

    Signed-off-by: John Fastabend
    Acked-by: Jesse Gross
    Signed-off-by: David S. Miller

    John Fastabend
     

21 Oct, 2010

1 commit

  • A struct net_device always maps to zero or one vlan groups and we
    always know the device when we are looking up a group. We currently
    do a hash table lookup on the device to find the group but it is
    much simpler to just store a pointer.

    Signed-off-by: Jesse Gross
    Signed-off-by: David S. Miller

    Jesse Gross
     

06 Oct, 2010

1 commit

  • 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 8990f468a (net: rx_dropped
    accounting), thus reverting it.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

21 Sep, 2010

1 commit

  • Under load, netif_rx() can drop incoming packets but administrators dont
    have a chance to spot which device needs some tuning (RPS activation for
    example)

    This patch adds rx_dropped accounting in vlans and tunnels.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

29 Jun, 2010

1 commit


17 Feb, 2010

1 commit

  • 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: Tejun Heo
    Acked-by: David S. Miller
    Cc: Patrick McHardy
    Cc: Arnaldo Carvalho de Melo
    Cc: Vlad Yasevich
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Tejun Heo
     

18 Nov, 2009

1 commit

  • 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: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

28 Oct, 2009

1 commit


27 Oct, 2009

1 commit

  • 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: Gertjan Hofman
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

29 Oct, 2008

1 commit

  • This enables more ethtool information. The speed and settings of the
    underlying device are propagated up. This makes services like SNMP that
    use ethtool to get speed setting, work when managing a vlan, without adding
    silly heurtistics into SNMP daemon.

    For the driver info, just use existing driver strings.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

08 Jul, 2008

3 commits

  • The VLAN code contains multiple spots that use tag, id and tci as
    identifiers for arguments and variables incorrectly and they actually
    contain or are expected to contain something different. Additionally
    types are used inconsistently (unsigned short vs u16) and identifiers
    are sometimes capitalized.

    - consistently use u16 for storing TCI, ID or QoS values
    - consistently use vlan_id and vlan_tci for storing the respective values
    - remove capitalization
    - add kdoc comment to netif_hwaccel_{rx,receive_skb}

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Hide struct vlan_dev_info from drivers to prevent them from growing
    more creative ways to use it. Provide accessors for the two drivers
    that currently use it.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • The function is huge and included at least once in every VLAN acceleration
    capable driver. Uninline it; to avoid having drivers depend on the VLAN
    module, the function is always built in statically when VLAN is enabled.

    With all VLAN acceleration capable drivers that build on x86_64 enabled,
    this results in:

    text data bss dec hex filename
    6515227 854044 343968 7713239 75b1d7 vmlinux.inlined
    6505637 854044 343968 7703649 758c61 vmlinux.uninlined
    ----------------------------------------------------------
    -9590

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

06 Jul, 2008

2 commits

  • Add GVRP support for dynamically registering VLANs with switches.

    By default GVRP is disabled because we only support the applicant-only
    participant model, which means it should not be enabled on vlans that
    are members of a bridge. Since there is currently no way to cleanly
    determine that, the user is responsible for enabling it.

    The code is pretty small and low impact, its wrapped in a config
    option though because it depends on the GARP implementation and
    the STP core.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Change vlan_dev_set_vlan_flag() to handle multiple flags at once and
    rename to vlan_dev_change_flags(). This allows to to use it from the
    netlink interface, which in turn allows to handle necessary adjustments
    when changing flags centrally.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

16 Apr, 2008

3 commits


02 Apr, 2008

1 commit


29 Jan, 2008

4 commits

  • Checkpatch cleanups, consisting mainly of overly long lines and
    missing spaces.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Keep track of the number of VLAN devices in a vlan group. This allows
    to have the caller sense when the group is going to be destroyed and
    stop using it, which in turn allows to remove the wrapper around
    unregister_vlan_dev for the NETDEV_UNREGISTER notifier and avoid
    iterating over all possible VLAN ids whenever a device in unregistered.

    Also fix what looks like a use-after-free (but is actually safe since
    we're holding the RTNL), the real_dev reference should not be dropped
    while we still use it.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • - use pr_* functions and common prefix for non-device related messages

    - remove VLAN_ printk levels

    - kill lots of useless debugging statements

    - remove a few unnecessary printks like for double VID registration (already
    returns -EEXIST) and kill of a number of unnecessary checks in
    vlan_proc_{add,rem}_dev() that are already performed by the caller

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Move device setup to vlan_dev.c and make all the VLAN device methods
    static.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

11 Nov, 2007

1 commit


11 Oct, 2007

1 commit


15 Jul, 2007

1 commit


12 Jul, 2007

1 commit

  • 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: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

11 Jul, 2007

2 commits

  • Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • Move the device lookup and checks to the ioctl handler under the RTNL and
    change all name-based interfaces to take a struct net_device * instead.

    This allows to use them from a netlink interface, which identifies devices
    based on ifindex not name. It also avoids races between the ioctl interface
    and the (upcoming) netlink interface since now all changes happen under the
    RTNL.

    As a nice side effect this greatly simplifies error handling in the helper
    functions and fixes a number of incorrect error codes like -EINVAL for
    device not found.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

11 Feb, 2007

1 commit


30 Aug, 2005

1 commit

  • Bonding just wants the device before the skb_bond()
    decapsulation occurs, so simply pass that original
    device into packet_type->func() as an argument.

    It remains to be seen whether we can use this same
    exact thing to get rid of skb->input_dev as well.

    Signed-off-by: David S. Miller

    David S. Miller
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds