All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Toshiaki Makita <toshiaki.makita1@gmail.com>,
	Lorenzo Bianconi <lorenzo@kernel.org>
Subject: [PATCH net-next 1/4] veth: use skb_orphan_partial instead of skb_orphan
Date: Fri,  9 Apr 2021 13:04:37 +0200	[thread overview]
Message-ID: <e72b0660f85d505c91544153b6c244a1a322651a.1617965243.git.pabeni@redhat.com> (raw)
In-Reply-To: <cover.1617965243.git.pabeni@redhat.com>

As described by commit 9c4c325252c5 ("skbuff: preserve sock
reference when scrubbing the skb."), orphaning a skb
in the TX path will cause OoO.

Let's use skb_orphan_partial() instead of skb_orphan(), so
that we keep the sk around for queue's selection sake and we
still avoid the problem fixed with commit 4bf9ffa0fb57 ("veth:
Orphan skb before GRO")

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/veth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 91b73db37555b..ad36e7ed16134 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -674,7 +674,7 @@ static struct sk_buff *veth_xdp_rcv_skb(struct veth_rq *rq,
 	int mac_len, delta, off;
 	struct xdp_buff xdp;
 
-	skb_orphan(skb);
+	skb_orphan_partial(skb);
 
 	rcu_read_lock();
 	xdp_prog = rcu_dereference(rq->xdp_prog);
-- 
2.26.2


  reply	other threads:[~2021-04-09 11:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 11:04 [PATCH net-next 0/4] veth: allow GRO even without XDP Paolo Abeni
2021-04-09 11:04 ` Paolo Abeni [this message]
2021-04-09 11:04 ` [PATCH net-next 2/4] veth: allow enabling NAPI " Paolo Abeni
2021-04-09 14:58   ` Toke Høiland-Jørgensen
2021-04-09 15:20     ` Paolo Abeni
2021-04-16 15:29       ` Toke Høiland-Jørgensen
2021-04-16 17:26         ` Paolo Abeni
2021-04-16 18:19           ` Toke Høiland-Jørgensen
2021-04-09 11:04 ` [PATCH net-next 3/4] veth: refine napi usage Paolo Abeni
2021-04-09 14:57   ` Toke Høiland-Jørgensen
2021-04-09 15:07     ` Paolo Abeni
2021-04-09 15:18       ` Toke Høiland-Jørgensen
2021-04-09 11:04 ` [PATCH net-next 4/4] self-tests: add veth tests Paolo Abeni
2021-04-12  0:10 ` [PATCH net-next 0/4] veth: allow GRO even without XDP patchwork-bot+netdevbpf

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=e72b0660f85d505c91544153b6c244a1a322651a.1617965243.git.pabeni@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=toshiaki.makita1@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.