30 Oct, 2009

3 commits

  • The temporary copy of the VLAN group is not neccessary since the lower device
    is already in the process of being unregistered, if it was neccessary the
    memset of the global group would introduce a race condition.

    With this removed, the changes to the original code are only a few lines, so
    remove the new function and move the code back into vlan_device_event().

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

    Patrick McHardy
     
  • This will allow drivers to adjust their receive path dynamically
    based on whether GRO is being applied successfully.

    Currently all in-tree callers ignore the return values of these
    functions and do not need to be changed.

    Signed-off-by: Ben Hutchings
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • This clarifies which return and parameter types are GRO result codes
    and not RX result codes.

    Signed-off-by: Ben Hutchings
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Ben Hutchings
     

29 Oct, 2009

1 commit


28 Oct, 2009

2 commits


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
     

27 Sep, 2009

1 commit


04 Sep, 2009

1 commit

  • Its hard to tell if vlans are dropping frames, since
    every frame given to vlan_???_start_xmit() functions
    is accounted as fully transmitted by lower device.

    We can test dev_queue_xmit() return values to
    properly account for dropped frames.

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

    Eric Dumazet
     

03 Sep, 2009

2 commits

  • vlan_dev_hard_start_xmit() & vlan_dev_hwaccel_hard_start_xmit()
    select txqueue number 0, instead of using index provided by
    skb_get_queue_mapping().

    This is not correct after commit 2e59af3dcbdf11635c03f
    [vlan: multiqueue vlan device] because
    txq->tx_packets & txq->tx_bytes changes are performed on
    a single location, and not the right locking.

    Fix is to take the appropriate struct netdev_queue pointer

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

    Eric Dumazet
     
  • vlan devices are currently not multi-queue capable.

    We can do that with a new rtnl_link_ops method,
    get_tx_queues(), called from rtnl_create_link()

    This new method gets num_tx_queues/real_num_tx_queues
    from real device.

    register_vlan_device() is also handled.

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

    Eric Dumazet
     

01 Sep, 2009

2 commits


15 Aug, 2009

1 commit

  • Adds fcoe offload related net_device_ops functions vlan_dev_fcoe_ddp_setup
    and vlan_dev_fcoe_ddp_done, their implementation simply calls real eth device
    net_device_ops for FCoE DDP setup and done operations.

    Updates VLAN netdev field value for fcoe_ddp_xid from real eth device netdev.

    Above changes are required for fcoe DDP offload working on a VLAN interface.

    Signed-off-by: Vasu Dev
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Vasu Dev
     

06 Aug, 2009

1 commit


31 Jul, 2009

1 commit

  • There is no reason for the arbitrary restriction that device must be
    up to create a vlan. This patch was added to Vyatta kernel to resolve startup
    ordering issues where vlan's are created but real device was disabled.

    Note: the vlan already correctly inherits the operstate from real device; so
    if vlan is created and real device is marked down, the vlan is marked
    down.

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

    Stephen Hemminger
     

20 Jul, 2009

1 commit


10 Jun, 2009

1 commit


30 May, 2009

1 commit

  • This patch converts unicast address list to standard list_head using
    previously introduced struct netdev_hw_addr. It also relaxes the
    locking. Original spinlock (still used for multicast addresses) is not
    needed and is no longer used for a protection of this list. All
    reading and writing takes place under rtnl (with no changes).

    I also removed a possibility to specify the length of the address
    while adding or deleting unicast address. It's always dev->addr_len.

    The convertion touched especially e1000 and ixgbe codes when the
    change is not so trivial.

    Signed-off-by: Jiri Pirko

    drivers/net/bnx2.c | 13 +--
    drivers/net/e1000/e1000_main.c | 24 +++--
    drivers/net/ixgbe/ixgbe_common.c | 14 ++--
    drivers/net/ixgbe/ixgbe_common.h | 4 +-
    drivers/net/ixgbe/ixgbe_main.c | 6 +-
    drivers/net/ixgbe/ixgbe_type.h | 4 +-
    drivers/net/macvlan.c | 11 +-
    drivers/net/mv643xx_eth.c | 11 +-
    drivers/net/niu.c | 7 +-
    drivers/net/virtio_net.c | 7 +-
    drivers/s390/net/qeth_l2_main.c | 6 +-
    drivers/scsi/fcoe/fcoe.c | 16 ++--
    include/linux/netdevice.h | 18 ++--
    net/8021q/vlan.c | 4 +-
    net/8021q/vlan_dev.c | 10 +-
    net/core/dev.c | 195 +++++++++++++++++++++++++++-----------
    net/dsa/slave.c | 10 +-
    net/packet/af_packet.c | 4 +-
    18 files changed, 227 insertions(+), 137 deletions(-)
    Signed-off-by: David S. Miller

    Jiri Pirko
     

25 May, 2009

1 commit


19 May, 2009

2 commits

  • One point of contention in high network loads is the dst_release() performed
    when a transmited skb is freed. This is because NIC tx completion calls
    dev_kree_skb() long after original call to dev_queue_xmit(skb).

    CPU cache is cold and the atomic op in dst_release() stalls. On SMP, this is
    quite visible if one CPU is 100% handling softirqs for a network device,
    since dst_clone() is done by other cpus, involving cache line ping pongs.

    It seems right place to release dst is in dev_hard_start_xmit(), for most
    devices but ones that are virtual, and some exceptions.

    David Miller suggested to define a new device flag, set in alloc_netdev_mq()
    (so that most devices set it at init time), and carefuly unset in devices
    which dont want a NULL skb->dst in their ndo_start_xmit().

    List of devices that must clear this flag is :

    - loopback device, because it calls netif_rx() and quoting Patrick :
    "ip_route_input() doesn't accept loopback addresses, so loopback packets
    already need to have a dst_entry attached."
    - appletalk/ipddp.c : needs skb->dst in its xmit function

    - And all devices that call again dev_queue_xmit() from their xmit function
    (as some classifiers need skb->dst) : bonding, vlan, macvlan, eql, ifb, hdlc_fr

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

    Eric Dumazet
     
  • We can update netdev_queue tx_bytes/tx_packets/tx_dropped counters instead
    of dev->stats ones, to reduce number of cache lines dirtied in xmit path.

    This fixes a performance problem on SMP when many different cpus take
    vlan tx path.

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

    Eric Dumazet
     

30 Apr, 2009

1 commit


26 Apr, 2009

1 commit

  • Currently, the VLAN event handler does not adjust the VLAN
    device's carrier state when the real device or the VLAN device is set
    administratively up or down.

    The following patch adds a transfer of operating state from the
    real device to the VLAN device when the real device is administratively
    set up or down, and sets the carrier state up or down during init, open
    and close of the VLAN device.

    This permits observers above the VLAN device that care about the
    carrier state (bonding's link monitor, for example) to receive updates
    for administrative changes by more closely mimicing the behavior of real
    devices.

    Signed-off-by: Jay Vosburgh
    Signed-off-by: Patrick McHardy

    Jay Vosburgh
     

21 Apr, 2009

2 commits


18 Apr, 2009

1 commit


17 Apr, 2009

1 commit


16 Apr, 2009

1 commit

  • It turns out that copying a 16-byte area at ~800k times a second
    can be really expensive :) This patch redesigns the frags GRO
    interface to avoid copying that area twice.

    The two disciples of the frags interface have been converted.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

14 Apr, 2009

1 commit

  • Hi:

    gro: Normalise skb before bypassing GRO on netpoll VLAN path

    When we detect netpoll RX on the GRO VLAN path we bail out and
    call the normal VLAN receive handler. However, the packet needs
    to be normalised by calling eth_type_trans since that's what the
    normal path expects (normally the GRO path does the fixup).

    This patch adds the necessary call to vlan_gro_frags.

    Signed-off-by: Herbert Xu

    Thanks,
    Signed-off-by: David S. Miller

    Herbert Xu
     

18 Mar, 2009

1 commit

  • Jarek Poplawski pointed out that my previous fix is broken for
    VLAN+netpoll as if netpoll is enabled we'd end up in the normal
    receive path instead of the VLAN receive path.

    This patch fixes it by calling the VLAN receive hook.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

17 Mar, 2009

1 commit

  • As my netpoll fix for net doesn't really work for net-next, we
    need this update to move the checks into the right place. As it
    stands we may pass freed skbs to netpoll_receive_skb.

    This patch also introduces a netpoll_rx_on function to avoid GRO
    completely if we're invoked through netpoll. This might seem
    paranoid but as netpoll may have an external receive hook it's
    better to be safe than sorry. I don't think we need this for
    2.6.29 though since there's nothing immediately broken by it.

    This patch also moves the GRO_* return values to netdevice.h since
    VLAN needs them too (I tried to avoid this originally but alas
    this seems to be the easiest way out). This fixes a bug in VLAN
    where it continued to use the old return value 2 instead of the
    correct GRO_DROP.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

10 Mar, 2009

1 commit


05 Mar, 2009

2 commits


02 Mar, 2009

1 commit


01 Mar, 2009

1 commit

  • The netpoll entry checks are required to ensure that we don't
    receive normal packets when invoked via netpoll. Unfortunately
    it only ever worked for the netif_receive_skb/netif_rx entry
    points. The VLAN (and subsequently GRO) entry point didn't
    have the check and therefore can trigger all sorts of weird
    problems.

    This patch adds the netpoll check to all entry points.

    I'm still uneasy with receiving at all under netpoll (which
    apparently is only used by the out-of-tree kdump code). The
    reason is it is perfectly legal to receive all data including
    headers into highmem if netpoll is off, but if you try to do
    that with netpoll on and someone gets a printk in an IRQ handler
    you're going to get a nice BUG_ON.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

09 Feb, 2009

1 commit

  • This patch optimises the Ethernet header comparison to use 2-byte
    and 4-byte xors instead of memcmp. In order to facilitate this,
    the actual comparison is now carried out by the callers of the
    shared dev_gro_receive function.

    This has a significant impact when receiving 1500B packets through
    10GbE.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

01 Feb, 2009

1 commit


30 Jan, 2009

1 commit

  • Unfortunately simplicity isn't always the best. The fraginfo
    interface turned out to be suboptimal. The problem was quite
    obvious. For every packet, we have to copy the headers from
    the frags structure into skb->head, even though for 99% of the
    packets this part is immediately thrown away after the merge.

    LRO didn't have this problem because it directly read the headers
    from the frags structure.

    This patch attempts to address this by creating an interface
    that allows GRO to access the headers in the first frag without
    having to copy it. Because all drivers that use frags place the
    headers in the first frag this optimisation should be enough.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu