17 Nov, 2011

1 commit

  • Only distinct use is checking if NETIF_F_NOCACHE_COPY should be
    enabled by default. The check heuristics is altered a bit here,
    so it hits other people than before. The default shouldn't be
    trusted for performance-critical cases anyway.

    For all other uses NETIF_F_NO_CSUM is equivalent to NETIF_F_HW_CSUM.

    Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław
     

28 Jul, 2011

1 commit

  • After the last patch, We are left in a state in which only drivers calling
    ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
    hardware call ether_setup for their net_devices and don't hold any state in
    their skbs. There are a handful of drivers that violate this assumption of
    course, and need to be fixed up. This patch identifies those drivers, and marks
    them as not being able to support the safe transmission of skbs by clearning the
    IFF_TX_SKB_SHARING flag in priv_flags

    Signed-off-by: Neil Horman
    CC: Karsten Keil
    CC: "David S. Miller"
    CC: Jay Vosburgh
    CC: Andy Gospodarek
    CC: Patrick McHardy
    CC: Krzysztof Halasa
    CC: "John W. Linville"
    CC: Greg Kroah-Hartman
    CC: Marcel Holtmann
    CC: Johannes Berg
    Signed-off-by: David S. Miller

    Neil Horman
     

22 Jun, 2011

1 commit


07 Jun, 2011

1 commit


06 May, 2011

1 commit

  • Force dev_alloc_name() to be called from register_netdevice() by
    dev_get_valid_name(). That allows to remove multiple explicit
    dev_alloc_name() calls.

    The possibility to call dev_alloc_name in advance remains.

    This also fixes veth creation regresion caused by
    84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

04 Jan, 2011

1 commit

  • Le lundi 03 janvier 2011 à 11:40 -0800, David Miller a écrit :
    > From: Jarek Poplawski
    > Date: Mon, 3 Jan 2011 20:37:03 +0100
    >
    > > On Sun, Jan 02, 2011 at 09:24:36PM +0100, Eric Dumazet wrote:
    > >> Le mercredi 29 décembre 2010 ?? 00:07 +0100, Jarek Poplawski a écrit :
    > >>
    > >> > Ingress is before vlans handler so these features and the
    > >> > NETIF_F_HW_VLAN_TX flag seem useful for ifb considering
    > >> > dev_hard_start_xmit() checks.
    > >>
    > >> OK, here is v2 of the patch then, thanks everybody.
    > >>
    > >>
    > >> [PATCH v2 net-next-2.6] ifb: add performance flags
    > >>
    > >> IFB can use the full set of features flags (NETIF_F_SG |
    > >> NETIF_F_FRAGLIST | NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_HIGHDMA) to
    > >> avoid unnecessary split of some packets (GRO for example)
    > >>
    > >> Changli suggested to also set vlan_features,
    > >
    > > He also suggested more GSO flags of which especially NETIF_F_TSO6
    > > seems interesting (wrt GRO)?
    >
    > I think at least TSO6 would very much be appropriate here.

    Yes, why not, I am only wondering why loopback / dummy (and others ?)
    only set NETIF_F_TSO :)

    Since I want to play with ECN, I might also add NETIF_F_TSO_ECN ;)

    For other flags, I really doubt it can matter on ifb ?

    [PATCH v3 net-next-2.6] ifb: add performance flags

    IFB can use the full set of features flags (NETIF_F_SG |
    NETIF_F_FRAGLIST | NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_HIGHDMA) to
    avoid unnecessary split of some packets (GRO for example)

    Changli suggested to also set vlan_features, NETIF_F_TSO6,
    NETIF_F_TSO_ECN.

    Jarek suggested to add NETIF_F_HW_VLAN_TX as well.

    Signed-off-by: Eric Dumazet
    Cc: Changli Gao
    Cc: Jarek Poplawski
    Cc: Pawel Staszewski
    Signed-off-by: David S. Miller

    Eric Dumazet
     

20 Dec, 2010

1 commit


17 Dec, 2010

1 commit

  • After recent ifb changes, we must use lockless __skb_dequeue() since
    lock is not anymore initialized.

    Signed-off-by: Eric Dumazet
    Cc: Jamal Hadi Salim
    Cc: Changli Gao
    Acked-by: Changli Gao
    Signed-off-by: David S. Miller

    Eric Dumazet
     

11 Dec, 2010

3 commits


09 Dec, 2010

1 commit

  • If we break the loop when there are still skbs in tq and no skb in
    rq, the skbs will be left in txq until new skbs are enqueued into rq.
    In rare cases, no new skb is queued, then these skbs will stay in rq
    forever.

    After this patch, if tq isn't empty when we break the loop, we goto
    resched directly.

    Signed-off-by: Changli Gao
    Signed-off-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Changli Gao
     

10 May, 2010

1 commit

  • Now that core network takes care of trans_start updates, dont do it
    in drivers themselves, if possible. Drivers can avoid one cache miss
    (on dev->trans_start) in their start_xmit() handler.

    Exceptions are NETIF_F_LLTX drivers

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

    Eric Dumazet
     

21 Nov, 2009

1 commit


02 Nov, 2009

1 commit


23 Oct, 2009

1 commit


01 Sep, 2009

1 commit


06 Jul, 2009

1 commit


19 May, 2009

1 commit

  • 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
     

21 Nov, 2008

1 commit

  • This patch moves neigh_setup and hard_start_xmit into the network device ops
    structure. For bisection, fix all the previously converted drivers as well.
    Bonding driver took the biggest hit on this.

    Added a prefetch of the hard_start_xmit in the fast path to try and reduce
    any impact this would have.

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

    Stephen Hemminger
     

20 Nov, 2008

1 commit


01 Aug, 2008

1 commit

  • When support for multiple TX queues were added, the
    netif_tx_lock() routines we converted to iterate over
    all TX queues and grab each queue's spinlock.

    This causes heartburn for lockdep and it's not a healthy
    thing to do with lots of TX queues anyways.

    So modify this to use a top-level lock and a "frozen"
    state for the individual TX queues.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Jul, 2008

2 commits

  • We can simply use the qdisc->q.lock for all of the
    qdisc tree synchronization.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • alloc_netdev_mq() now allocates an array of netdev_queue
    structures for TX, based upon the queue_count argument.

    Furthermore, all accesses to the TX queues are now vectored
    through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
    interfaces. This makes it easy to grep the tree for all
    things that want to get to a TX queue of a net device.

    Problem spots which are not really multiqueue aware yet, and
    only work with one queue, can easily be spotted by grepping
    for all netdev_get_tx_queue() calls that pass in a zero index.

    Signed-off-by: David S. Miller

    David S. Miller
     

09 Jul, 2008

2 commits


21 Mar, 2008

1 commit

  • [ 10.536424] =======================================================
    [ 10.536424] [ INFO: possible circular locking dependency detected ]
    [ 10.536424] 2.6.25-rc3-devel #3
    [ 10.536424] -------------------------------------------------------
    [ 10.536424] swapper/0 is trying to acquire lock:
    [ 10.536424] (&dev->queue_lock){-+..}, at: []
    dev_queue_xmit+0x175/0x2f3
    [ 10.536424]
    [ 10.536424] but task is already holding lock:
    [ 10.536424] (&p->tcfc_lock){-+..}, at: [] tcf_mirred+0x20/0x178
    [act_mirred]
    [ 10.536424]
    [ 10.536424] which lock already depends on the new lock.

    lockdep warns of locking order while using ifb with sch_ingress and
    act_mirred: ingress_lock, tcfc_lock, queue_lock (usually queue_lock
    is at the beginning). This patch is only to tell lockdep that ifb is
    a different device (e.g. from eth) and has its own pair of queue
    locks. (This warning is a false-positive in common scenario of using
    ifb; yet there are possible situations, when this order could be
    dangerous; lockdep should warn in such a case.) (With suggestions by
    David S. Miller)

    Reported-and-tested-by: Denys Fedoryshchenko
    Signed-off-by: Jarek Poplawski
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Jarek Poplawski
     

11 Oct, 2007

3 commits

  • We now have struct net_device_stats embedded in struct net_device,
    and the default ->get_stats() hook does the obvious thing for us.

    Run through drivers/net/* and remove the driver-local storage of
    statistics, and driver-local ->get_stats() hook where applicable.

    This was just the low-hanging fruit in drivers/net; plenty more drivers
    remain to be updated.

    [ Resolved conflicts with napi_struct changes and fix sunqe build
    regression... -DaveM ]

    Signed-off-by: Jeff Garzik
    Signed-off-by: David S. Miller

    Jeff Garzik
     
  • It's been a useless no-op for long enough in 2.6 so I figured it's time to
    remove it. The number of people that could object because they're
    maintaining unified 2.4 and 2.6 drivers is probably rather small.

    [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]

    Signed-off-by: Ralf Baechle
    Signed-off-by: Jeff Garzik
    Signed-off-by: David S. Miller

    Ralf Baechle
     
  • This patch makes most of the generic device layer network
    namespace safe. This patch makes dev_base_head a
    network namespace variable, and then it picks up
    a few associated variables. The functions:
    dev_getbyhwaddr
    dev_getfirsthwbytype
    dev_get_by_flags
    dev_get_by_name
    __dev_get_by_name
    dev_get_by_index
    __dev_get_by_index
    dev_ioctl
    dev_ethtool
    dev_load
    wireless_process_ioctl

    were modified to take a network namespace argument, and
    deal with it.

    vlan_ioctl_set and brioctl_set were modified so their
    hooks will receive a network namespace argument.

    So basically anthing in the core of the network stack that was
    affected to by the change of dev_base was modified to handle
    multiple network namespaces. The rest of the network stack was
    simply modified to explicitly use &init_net the initial network
    namespace. This can be fixed when those components of the network
    stack are modified to handle multiple network namespaces.

    For now the ifindex generator is left global.

    Fundametally ifindex numbers are per namespace, or else
    we will have corner case problems with migration when
    we get that far.

    At the same time there are assumptions in the network stack
    that the ifindex of a network device won't change. Making
    the ifindex number global seems a good compromise until
    the network stack can cope with ifindex changes when
    you change namespaces, and the like.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

12 Jul, 2007

2 commits

  • Drivers need to validate the initial addresses in their netlink attribute
    validation function or manually reject them if they can't support this.

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

    Patrick McHardy
     
  • All drivers need to unregister their devices in the module unload function.
    While doing so they must hold the rtnl and atomically unregister the
    rtnl_link ops as well. This makes the rtnl_link_unregister function that
    takes the rtnl itself completely useless.

    Provide default newlink/dellink functions, make __rtnl_link_unregister and
    rtnl_link_unregister unregister all devices with matching rtnl_link_ops and
    change the existing users to take advantage of that.

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

    Patrick McHardy
     

11 Jul, 2007

2 commits


30 Mar, 2007

1 commit

  • The input_device pointer is not refcounted, which means the device may
    disappear while packets are queued, causing a crash when ifb passes packets
    with a stale skb->dev pointer to netif_rx().

    Fix by storing the interface index instead and do a lookup where neccessary.

    Signed-off-by: Patrick McHardy
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Patrick McHardy
     

31 Jan, 2007

1 commit

  • This reverts commit 0c0b3ae68ec93b1db5c637d294647d1cca0df763.

    Quoth David:

    "Jeff, please revert

    It's wrong. We had a lengthy analysis of this piece of code
    several months ago, and it is correct.

    Consider, if we run the loop and we get an error
    the following happens:

    1) attempt of ifb_init_one(i) fails, therefore we should
    not try to "ifb_free_one()" on "i" since it failed
    2) the loop iteration first increments "i", then it
    check for error

    Therefore we must decrement "i" twice before the first
    free during the cleanup. One to "undo" the for() loop
    increment, and one to "skip" the ifb_init_one() case which
    failed."

    Reported-by: David Miller
    Acked-by: Jeff Garzik
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

30 Jan, 2007

1 commit


04 Jan, 2007

1 commit


03 Oct, 2006

1 commit


14 Sep, 2006

1 commit