linux/drivers/net/bonding
Eric Dumazet 93f154b594 net: release dst entry in dev_hard_start_xmit()
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 <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-18 22:19:19 -07:00
..
Makefile bonding: send IPv6 neighbor advertisement on failover 2008-11-06 00:49:37 -05:00
bond_3ad.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-05-18 21:08:20 -07:00
bond_3ad.h Remove duplicate slow protocol define in bond_3ad.h 2009-05-09 13:15:49 -07:00
bond_alb.c bonding: fix alb mode locking regression 2009-05-04 21:28:10 -07:00
bond_alb.h Convert bonding timers to workqueues 2007-10-23 20:32:00 -04:00
bond_ipv6.c bonding: use pr_debug instead of own macros 2008-12-09 23:09:22 -08:00
bond_main.c net: release dst entry in dev_hard_start_xmit() 2009-05-18 22:19:19 -07:00
bond_sysfs.c net: FIX bonding sysfs rtnl_lock deadlock 2009-05-18 22:16:00 -07:00
bonding.h drivers/net/bonding: fix sparse warnings: move decls to header file 2008-12-25 23:58:57 -08:00