* [PATCH net-next v1 0/1] queue_api: add subqueue variant netif_subqueue_sent
@ 2025-05-21 11:06 Gur Stavi
2025-05-21 11:06 ` [PATCH net-next v1 1/1] " Gur Stavi
0 siblings, 1 reply; 3+ messages in thread
From: Gur Stavi @ 2025-05-21 11:06 UTC (permalink / raw)
To: Gur Stavi
Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman
Add a new macro, netif_subqueue_sent, which is a wrapper for
netdev_tx_sent_queue.
Drivers that use the subqueue variant macros, netif_subqueue_xxx,
identify queue by index and are not required to obtain
struct netdev_queue explicitly.
Such drivers still need to call netdev_tx_sent_queue which is a
counterpart of netif_subqueue_completed_wake. Allowing drivers to use a
subqueue variant for this purpose improves their code consistency by
always referring to queue by its index.
Gur Stavi (1):
queue_api: add subqueue variant netif_subqueue_sent
include/net/netdev_queues.h | 8 ++++++++
1 file changed, 8 insertions(+)
base-commit: e6b3527c3b0a676c710e91798c2709cc0538d312
--
2.45.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net-next v1 1/1] queue_api: add subqueue variant netif_subqueue_sent
2025-05-21 11:06 [PATCH net-next v1 0/1] queue_api: add subqueue variant netif_subqueue_sent Gur Stavi
@ 2025-05-21 11:06 ` Gur Stavi
2025-05-22 3:35 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Gur Stavi @ 2025-05-21 11:06 UTC (permalink / raw)
To: Gur Stavi
Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman
Add a new macro, netif_subqueue_sent, which is a wrapper for
netdev_tx_sent_queue.
Drivers that use the subqueue variant macros, netif_subqueue_xxx,
identify queue by index and are not required to obtain
struct netdev_queue explicitly.
Such drivers still need to call netdev_tx_sent_queue which is a
counterpart of netif_subqueue_completed_wake. Allowing drivers to use a
subqueue variant for this purpose improves their code consistency by
always referring to queue by its index.
Signed-off-by: Gur Stavi <gur.stavi@huawei.com>
---
include/net/netdev_queues.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index ba2eaf39089b..7b6656ee549f 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -294,6 +294,14 @@ netdev_txq_completed_mb(struct netdev_queue *dev_queue,
netif_txq_try_stop(_txq, get_desc, start_thrs); \
})
+#define netif_subqueue_sent(dev, idx, bytes) \
+ ({ \
+ struct netdev_queue *_txq; \
+ \
+ _txq = netdev_get_tx_queue(dev, idx); \
+ netdev_tx_sent_queue(_txq, bytes); \
+ })
+
#define netif_subqueue_maybe_stop(dev, idx, get_desc, stop_thrs, start_thrs) \
({ \
struct netdev_queue *_txq; \
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v1 1/1] queue_api: add subqueue variant netif_subqueue_sent
2025-05-21 11:06 ` [PATCH net-next v1 1/1] " Gur Stavi
@ 2025-05-22 3:35 ` Jakub Kicinski
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-05-22 3:35 UTC (permalink / raw)
To: Gur Stavi
Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman
On Wed, 21 May 2025 14:06:12 +0300 Gur Stavi wrote:
> Add a new macro, netif_subqueue_sent, which is a wrapper for
> netdev_tx_sent_queue.
>
> Drivers that use the subqueue variant macros, netif_subqueue_xxx,
> identify queue by index and are not required to obtain
> struct netdev_queue explicitly.
>
> Such drivers still need to call netdev_tx_sent_queue which is a
> counterpart of netif_subqueue_completed_wake. Allowing drivers to use a
> subqueue variant for this purpose improves their code consistency by
> always referring to queue by its index.
You need to post it with a user in the same series.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-22 3:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 11:06 [PATCH net-next v1 0/1] queue_api: add subqueue variant netif_subqueue_sent Gur Stavi
2025-05-21 11:06 ` [PATCH net-next v1 1/1] " Gur Stavi
2025-05-22 3:35 ` Jakub Kicinski
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).