From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: kernel@pengutronix.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition
Date: Fri, 12 Jan 2024 17:13:14 +0100 [thread overview]
Message-ID: <20240112-netdev_queue-v1-1-102c2d57e20a@pengutronix.de> (raw)
netif_txq_try_stop() uses "get_desc >= start_thrs" as the check for
the call to netif_tx_start_queue().
Use ">=" i netdev_txq_completed_mb(), too.
Fixes: c91c46de6bbc ("net: provide macros for commonly copied lockless queue stop/wake code")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Hello,
I'm currently converting a networking driver with a TX-FIFO depth of
1 (CAN device with lots of errata :/) to the netdev_queue.h helpers
and stumbled over an off-by-one error on __netif_txq_completed_wake().
regards,
Marc
---
include/net/netdev_queues.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index d68b0a483431..8b8ed4e13d74 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -128,7 +128,7 @@ netdev_txq_completed_mb(struct netdev_queue *dev_queue,
netdev_txq_completed_mb(txq, pkts, bytes); \
\
_res = -1; \
- if (pkts && likely(get_desc > start_thrs)) { \
+ if (pkts && likely(get_desc >= start_thrs)) { \
_res = 1; \
if (unlikely(netif_tx_queue_stopped(txq)) && \
!(down_cond)) { \
---
base-commit: 907ee6681788556b9ade3ad0a1f6f4aea192399c
change-id: 20240112-netdev_queue-e91686f5fece
Best regards,
--
Marc Kleine-Budde <mkl@pengutronix.de>
next reply other threads:[~2024-01-12 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 16:13 Marc Kleine-Budde [this message]
2024-01-13 2:44 ` [PATCH] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition Jakub Kicinski
2024-01-13 18:30 ` 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=20240112-netdev_queue-v1-1-102c2d57e20a@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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