From: Alexander Lobakin Date: Wed, 4 Sep 2024 15:47:45 +0000 (+0200) Subject: netdevice: add netdev_tx_reset_subqueue() shorthand X-Git-Tag: v6.12-rc1~232^2~33^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3dc95a3edd0a86b4a59670b3fafcc64c7d83e2e7;p=thirdparty%2Fkernel%2Flinux.git netdevice: add netdev_tx_reset_subqueue() shorthand 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 Signed-off-by: Alexander Lobakin Signed-off-by: Tony Nguyen --- diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b47c00657bd04..44d1dbb54ffe5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3568,6 +3568,17 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q) #endif } +/** + * 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 @@ -3577,7 +3588,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); } /**