netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, andrew+netdev@lunn.ch,
	michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
	horms@kernel.org, shuah@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Cc: almasrymina@google.com, asml.silence@gmail.com,
	willemb@google.com, kaiyuanz@google.com, skhawaja@google.com,
	sdf@fomichev.me, gospo@broadcom.com, somnath.kotur@broadcom.com,
	dw@davidwei.uk, amritha.nambiar@intel.com,
	xuanzhuo@linux.alibaba.com, ap420073@gmail.com
Subject: [PATCH v3 net 7/8] net: devmem: do not WARN conditionally after netdev_rx_queue_restart()
Date: Sun,  9 Mar 2025 13:42:18 +0000	[thread overview]
Message-ID: <20250309134219.91670-8-ap420073@gmail.com> (raw)
In-Reply-To: <20250309134219.91670-1-ap420073@gmail.com>

When devmem socket is closed, netdev_rx_queue_restart() is called to
reset queue by the net_devmem_unbind_dmabuf(). But callback may return
-ENETDOWN if the interface is down because queues are already freed
when the interface is down so queue reset is not needed.
So, it should not warn if the return value is -ENETDOWN.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---

v3:
 - No changes.

v2:
 - Patch added.

 net/core/devmem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/devmem.c b/net/core/devmem.c
index 3bba3f018df0..0e5a2c672efd 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -109,6 +109,7 @@ void net_devmem_unbind_dmabuf(struct net_devmem_dmabuf_binding *binding)
 	struct netdev_rx_queue *rxq;
 	unsigned long xa_idx;
 	unsigned int rxq_idx;
+	int err;
 
 	if (binding->list.next)
 		list_del(&binding->list);
@@ -120,7 +121,8 @@ void net_devmem_unbind_dmabuf(struct net_devmem_dmabuf_binding *binding)
 
 		rxq_idx = get_netdev_rx_queue_index(rxq);
 
-		WARN_ON(netdev_rx_queue_restart(binding->dev, rxq_idx));
+		err = netdev_rx_queue_restart(binding->dev, rxq_idx);
+		WARN_ON(err && err != -ENETDOWN);
 	}
 
 	xa_erase(&net_devmem_dmabuf_bindings, binding->id);
-- 
2.34.1


  parent reply	other threads:[~2025-03-09 13:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-09 13:42 [PATCH v3 net 0/8] eth: bnxt: fix several bugs in the bnxt module Taehee Yoo
2025-03-09 13:42 ` [PATCH v3 net 1/8] eth: bnxt: fix truesize for mb-xdp-pass case Taehee Yoo
2025-03-09 13:42 ` [PATCH v3 net 2/8] eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc() Taehee Yoo
2025-03-09 21:44   ` Mina Almasry
2025-03-10  2:10     ` Taehee Yoo
2025-03-10 20:30       ` Jakub Kicinski
2025-03-09 13:42 ` [PATCH v3 net 3/8] eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic Taehee Yoo
2025-03-09 13:42 ` [PATCH v3 net 4/8] eth: bnxt: do not update checksum in bnxt_xdp_build_skb() Taehee Yoo
2025-03-10  2:58   ` Somnath Kotur
2025-03-09 13:42 ` [PATCH v3 net 5/8] eth: bnxt: fix kernel panic in the bnxt_get_queue_stats{rx | tx} Taehee Yoo
2025-03-10  2:59   ` Somnath Kotur
2025-03-09 13:42 ` [PATCH v3 net 6/8] eth: bnxt: fix memory leak in queue reset Taehee Yoo
2025-03-09 13:42 ` Taehee Yoo [this message]
2025-03-09 21:45   ` [PATCH v3 net 7/8] net: devmem: do not WARN conditionally after netdev_rx_queue_restart() Mina Almasry
2025-03-09 13:42 ` [PATCH v3 net 8/8] selftests: drv-net: add xdp cases for ping.py Taehee Yoo
2025-03-10 20:40 ` [PATCH v3 net 0/8] eth: bnxt: fix several bugs in the bnxt module 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=20250309134219.91670-8-ap420073@gmail.com \
    --to=ap420073@gmail.com \
    --cc=almasrymina@google.com \
    --cc=amritha.nambiar@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=asml.silence@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=gospo@broadcom.com \
    --cc=horms@kernel.org \
    --cc=kaiyuanz@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=skhawaja@google.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=willemb@google.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).