aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
authorJakub Kicinski <kuba@kernel.org>2026-05-26 09:01:43 -0700
committerJakub Kicinski <kuba@kernel.org>2026-05-28 14:37:46 -0700
commitc801a207794eee9c62bca3f4ca636231dc1b9bff (patch)
tree78cbf5c053fe2d793e1e08226d72d640d42aa9dc /Documentation
parentea50122e4520b05e45e3366cc4a8a9942f0c5ab9 (diff)
downloadlinux-next-history-c801a207794eee9c62bca3f4ca636231dc1b9bff.tar.gz
docs: net: fix minor issues with driver guide
Update the driver documentation TX queue example to match current APIs: - use the ring-local tx_ring_mask field in drv_tx_avail() - stop the selected netdev_queue with netif_tx_stop_queue() instead of stopping queue 0 with netif_stop_queue() Link: https://patch.msgid.link/20260526160151.2793354-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/networking/driver.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/networking/driver.rst b/Documentation/networking/driver.rst
index 4f5dfa9c022ec..195a916dc0dee 100644
--- a/Documentation/networking/driver.rst
+++ b/Documentation/networking/driver.rst
@@ -51,7 +51,7 @@ for a driver implementing scatter-gather this means:
{
u32 used = READ_ONCE(dr->prod) - READ_ONCE(dr->cons);
- return dr->tx_ring_size - (used & bp->tx_ring_mask);
+ return dr->tx_ring_size - (used & dr->tx_ring_mask);
}
static netdev_tx_t drv_hard_start_xmit(struct sk_buff *skb,
@@ -69,7 +69,7 @@ for a driver implementing scatter-gather this means:
//...
/* This should be a very rare race - log it. */
if (drv_tx_avail(dr) <= skb_shinfo(skb)->nr_frags + 1) {
- netif_stop_queue(dev);
+ netif_tx_stop_queue(txq);
netdev_warn(dev, "Tx Ring full when queue awake!\n");
return NETDEV_TX_BUSY;
}
@@ -103,6 +103,9 @@ Lockless queue stop / wake helper macros
.. kernel-doc:: include/net/netdev_queues.h
:doc: Lockless queue stopping / waking helpers.
+The standard macros like netif_txq_maybe_stop(), netif_txq_try_stop() etc.
+are well tested, prefer them over local synchronization schemes.
+
No exclusive ownership
----------------------