net: better IFF_XMIT_DST_RELEASE support
authorEric Dumazet <edumazet@google.com>
Mon, 6 Oct 2014 01:38:35 +0000 (18:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Oct 2014 17:22:11 +0000 (13:22 -0400)
commit0287587884b15041203b3a362d485e1ab1f24445
tree675ae57663c1ba3ee8768e65e7fb0e6d0259e04c
parentfe971b95c22578456ff7198537827841c726d3f7
net: better IFF_XMIT_DST_RELEASE support

Testing xmit_more support with netperf and connected UDP sockets,
I found strange dst refcount false sharing.

Current handling of IFF_XMIT_DST_RELEASE is not optimal.

Dropping dst in validate_xmit_skb() is certainly too late in case
packet was queued by cpu X but dequeued by cpu Y

The logical point to take care of drop/force is in __dev_queue_xmit()
before even taking qdisc lock.

As Julian Anastasov pointed out, need for skb_dst() might come from some
packet schedulers or classifiers.

This patch adds new helper to cleanly express needs of various drivers
or qdiscs/classifiers.

Drivers that need skb_dst() in their ndo_start_xmit() should call
following helper in their setup instead of the prior :

dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
->
netif_keep_dst(dev);

Instead of using a single bit, we use two bits, one being
eventually rebuilt in bonding/team drivers.

The other one, is permanent and blocks IFF_XMIT_DST_RELEASE being
rebuilt in bonding/team. Eventually, we could add something
smarter later.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
27 files changed:
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/net/appletalk/ipddp.c
drivers/net/bonding/bond_main.c
drivers/net/eql.c
drivers/net/ifb.c
drivers/net/loopback.c
drivers/net/macvlan.c
drivers/net/ppp/ppp_generic.c
drivers/net/team/team.c
drivers/net/vxlan.c
drivers/net/wan/hdlc_fr.c
drivers/s390/net/qeth_l3_main.c
include/linux/netdevice.h
net/8021q/vlan_dev.c
net/atm/clip.c
net/core/dev.c
net/ipv4/ip_gre.c
net/ipv4/ip_vti.c
net/ipv4/ipip.c
net/ipv6/ip6_gre.c
net/ipv6/ip6_tunnel.c
net/ipv6/ip6_vti.c
net/ipv6/sit.c
net/sched/cls_flow.c
net/sched/cls_route.c
net/sched/sch_generic.c
net/sched/sch_teql.c