netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vxlan: distribute vxlan tunneled traffic across multiple TXQs
@ 2013-12-23 12:56 Sathya Perla
  2013-12-23 19:28 ` Stephen Hemminger
  2014-01-06 17:54 ` [PATCH net-next] vxlan: keep original skb ownership Eric Dumazet
  0 siblings, 2 replies; 10+ messages in thread
From: Sathya Perla @ 2013-12-23 12:56 UTC (permalink / raw)
  To: netdev; +Cc: edumazet, stephen

The vxlan driver sets itself as the socket owner for all the TX flows
it encapsulates (using vxlan_set_owner()) and assigns it's own skb
destructor. This causes all tunneled traffic to land up on only one TXQ
as all encapsulated skbs refer to the vxlan socket and not the original
socket.  Also, the vxlan skb destructor breaks some functionality for
tunneled traffic like wmem accounting and as Eric D. mentioned, TCP
small queues and FQ/pacing packet scheduler too.

This patch removes vxlan ownership on tunneled skbs. This causes
tunneled traffic to be hashed into multiple TXQs based on the original
socket hash.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/vxlan.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index aef44aa..eb55c08 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1381,20 +1381,6 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)
 	return false;
 }
 
-static void vxlan_sock_put(struct sk_buff *skb)
-{
-	sock_put(skb->sk);
-}
-
-/* On transmit, associate with the tunnel socket */
-static void vxlan_set_owner(struct sock *sk, struct sk_buff *skb)
-{
-	skb_orphan(skb);
-	sock_hold(sk);
-	skb->sk = sk;
-	skb->destructor = vxlan_sock_put;
-}
-
 /* Compute source port for outgoing packet
  *   first choice to use L4 flow hash since it will spread
  *     better and maybe available from hardware
@@ -1514,8 +1500,6 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,
 	ip6h->daddr	  = *daddr;
 	ip6h->saddr	  = *saddr;
 
-	vxlan_set_owner(vs->sock->sk, skb);
-
 	err = handle_offloads(skb);
 	if (err)
 		return err;
@@ -1572,8 +1556,6 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
 	uh->len = htons(skb->len);
 	uh->check = 0;
 
-	vxlan_set_owner(vs->sock->sk, skb);
-
 	err = handle_offloads(skb);
 	if (err)
 		return err;
@@ -1836,8 +1818,10 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
 		struct sk_buff *skb1;
 
 		skb1 = skb_clone(skb, GFP_ATOMIC);
-		if (skb1)
+		if (skb1) {
+			skb1->sk = skb->sk;
 			vxlan_xmit_one(skb1, dev, rdst, did_rsc);
+		}
 	}
 
 	dev_kfree_skb(skb);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-01-06 21:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23 12:56 [PATCH net-next] vxlan: distribute vxlan tunneled traffic across multiple TXQs Sathya Perla
2013-12-23 19:28 ` Stephen Hemminger
2013-12-24 12:27   ` Sathya Perla
2013-12-24 18:39   ` Eric Dumazet
2013-12-24 23:05     ` Stephen Hemminger
2013-12-31 18:56     ` David Miller
2014-01-02  5:56       ` Eric Dumazet
2014-01-02  6:36         ` David Miller
2014-01-06 17:54 ` [PATCH net-next] vxlan: keep original skb ownership Eric Dumazet
2014-01-06 21:41   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).