From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Cc: <edumazet@google.com>, <stephen@networkplumber.org>
Subject: [PATCH net-next] vxlan: distribute vxlan tunneled traffic across multiple TXQs
Date: Mon, 23 Dec 2013 18:26:53 +0530 [thread overview]
Message-ID: <1387803413-22152-1-git-send-email-sathya.perla@emulex.com> (raw)
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
next reply other threads:[~2013-12-23 12:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 12:56 Sathya Perla [this message]
2013-12-23 19:28 ` [PATCH net-next] vxlan: distribute vxlan tunneled traffic across multiple TXQs 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387803413-22152-1-git-send-email-sathya.perla@emulex.com \
--to=sathya.perla@emulex.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).