diff options
| author | Alexander Lobakin <aleksander.lobakin@intel.com> | 2024-09-04 18:47:45 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-18 09:24:05 +0300 |
| commit | 370635397b623f5519a3b01c58954b447f16555c (patch) | |
| tree | 29231436c779984729f03c1ba34f2e3cfb7ec24a /include/linux | |
| parent | fa1fe9f3ddb916f22fc0a2678ca0a5fb8750ec70 (diff) | |
| download | linux-370635397b623f5519a3b01c58954b447f16555c.tar.xz | |
netdevice: add netdev_tx_reset_subqueue() shorthand
[ Upstream commit 3dc95a3edd0a86b4a59670b3fafcc64c7d83e2e7 ]
Add a shorthand similar to other net*_subqueue() helpers for resetting
the queue by its index w/o obtaining &netdev_tx_queue beforehand
manually.
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Stable-dep-of: 4db6c75124d8 ("net: ethernet: mtk_eth_soc: reset all TX queues on DMA free")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netdevice.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 337a9d1c558f..0b0a172337db 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3615,6 +3615,17 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q) } /** + * netdev_tx_reset_subqueue - reset the BQL stats and state of a netdev queue + * @dev: network device + * @qid: stack index of the queue to reset + */ +static inline void netdev_tx_reset_subqueue(const struct net_device *dev, + u32 qid) +{ + netdev_tx_reset_queue(netdev_get_tx_queue(dev, qid)); +} + +/** * netdev_reset_queue - reset the packets and bytes count of a network device * @dev_queue: network device * @@ -3623,7 +3634,7 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q) */ static inline void netdev_reset_queue(struct net_device *dev_queue) { - netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0)); + netdev_tx_reset_subqueue(dev_queue, 0); } /** |
