netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heng Qi <hengqi@linux.alibaba.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: [PATCH 1/2] Revert "bpf: veth driver panics when xdp prog attached before veth_open"
Date: Mon, 21 Nov 2022 19:28:47 +0800	[thread overview]
Message-ID: <20221121112848.51388-2-hengqi@linux.alibaba.com> (raw)
In-Reply-To: <20221121112848.51388-1-hengqi@linux.alibaba.com>

This reverts commit 5e5dc33d5dacb34b0165061bc5a10efd2fd3b66f.

This patch fixes the panic maked by 2e0de6366ac16. Now Paolo
and Toke suggest reverting the patch 2e0de6366ac16 and making
it stronger, so do this first.

Signed-off-by: Heng Qi <hengqi@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.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 2a4592780141..b1ed5a93b6c5 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1125,7 +1125,7 @@ static int veth_enable_xdp(struct net_device *dev)
 	int err, i;
 
 	rq = &priv->rq[0];
-	napi_already_on = rcu_access_pointer(rq->napi);
+	napi_already_on = (dev->flags & IFF_UP) && rcu_access_pointer(rq->napi);
 
 	if (!xdp_rxq_info_is_reg(&priv->rq[0].xdp_rxq)) {
 		err = veth_enable_xdp_range(dev, 0, dev->real_num_rx_queues, napi_already_on);
-- 
2.19.1.6.gb485710b


  reply	other threads:[~2022-11-21 11:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 23:33 [PATCH net-next 0/2] veth: a couple of fixes Paolo Abeni
2022-11-17 23:33 ` [PATCH net-next 1/2] veth: fix uninitialized napi disable Paolo Abeni
2022-11-17 23:33 ` [PATCH net-next 2/2] veth: fix double napi enable Paolo Abeni
2022-11-18 14:24   ` Heng Qi
2022-11-18  8:41 ` [PATCH net-next 0/2] veth: a couple of fixes Paolo Abeni
2022-11-18 11:05   ` Toke Høiland-Jørgensen
2022-11-19  1:06     ` Jakub Kicinski
2022-11-21  6:15       ` John Fastabend
2022-11-21  3:33   ` Xuan Zhuo
2022-11-21  3:55     ` Heng Qi
2022-11-21 10:11       ` Paolo Abeni
2022-11-21 11:28         ` [PATCH 0/2] Revert "veth: Avoid drop packets when xdp_redirect performs" and its fix Heng Qi
2022-11-21 11:28           ` Heng Qi [this message]
2022-11-21 11:28           ` [PATCH 2/2] Revert "veth: Avoid drop packets when xdp_redirect performs" Heng Qi
2022-11-22  3:50 [PATCH 0/2] Revert "veth: Avoid drop packets when xdp_redirect performs" and its fix Heng Qi
2022-11-22  3:50 ` [PATCH 1/2] Revert "bpf: veth driver panics when xdp prog attached before veth_open" Heng Qi

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=20221121112848.51388-2-hengqi@linux.alibaba.com \
    --to=hengqi@linux.alibaba.com \
    --cc=bpf@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xuanzhuo@linux.alibaba.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).