From: David L Stevens <david.stevens@oracle.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org,
Sowmini Varadhan <sowmini.varadhan@oracle.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCHv2 net] sunvnet: set queue mapping when doing packet copies
Date: Thu, 29 Jan 2015 14:42:44 -0500 [thread overview]
Message-ID: <54CA8D33.6020006@oracle.com> (raw)
This patch fixes a bug where vnet_skb_shape() didn't set the already-selected
queue mapping when a packet copy was required. This results in using the
wrong queue index for stops/starts, hung tx queues and watchdog timeouts
under heavy load. It also transfers the destructor, truesize, and the owning
socket for flow control (code adapted from skb_segment).
Signed-off-by: David L Stevens <david.stevens@oracle.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
--
Changes since v1:
move truesize, destructor and socket per Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/net/ethernet/sun/sunvnet.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 2b719cc..0a1d3eb 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -1123,6 +1123,16 @@ static inline struct sk_buff *vnet_skb_shape(struct sk_buff *skb, int ncookies)
skb_shinfo(nskb)->gso_size = skb_shinfo(skb)->gso_size;
skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type;
}
+ nskb->queue_mapping = skb->queue_mapping;
+ /* Following permits correct back-pressure, for protocols
+ * using skb_set_owner_w().
+ * Idea is to transfer ownership from skb to nskb.
+ */
+ if (skb->destructor == sock_wfree) {
+ swap(nskb->truesize, skb->truesize);
+ swap(nskb->destructor, skb->destructor);
+ swap(nskb->sk, skb->sk);
+ }
dev_kfree_skb(skb);
skb = nskb;
}
--
1.7.1
next reply other threads:[~2015-01-29 19:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 19:42 David L Stevens [this message]
2015-01-29 20:39 ` [PATCHv2 net] sunvnet: set queue mapping when doing packet copies Eric Dumazet
2015-01-29 21:36 ` David L Stevens
2015-01-29 22:19 ` Eric Dumazet
2015-01-29 22:22 ` Eric Dumazet
2015-01-29 22:15 ` David Miller
2015-01-29 22:30 ` Eric Dumazet
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=54CA8D33.6020006@oracle.com \
--to=david.stevens@oracle.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sowmini.varadhan@oracle.com \
/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).