Skip to content

Commit 3dc95a3

Browse files
alobakinanguy11
authored andcommitted
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 <[email protected]> Signed-off-by: Alexander Lobakin <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent d9028db commit 3dc95a3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/linux/netdevice.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3568,6 +3568,17 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q)
35683568
#endif
35693569
}
35703570

3571+
/**
3572+
* netdev_tx_reset_subqueue - reset the BQL stats and state of a netdev queue
3573+
* @dev: network device
3574+
* @qid: stack index of the queue to reset
3575+
*/
3576+
static inline void netdev_tx_reset_subqueue(const struct net_device *dev,
3577+
u32 qid)
3578+
{
3579+
netdev_tx_reset_queue(netdev_get_tx_queue(dev, qid));
3580+
}
3581+
35713582
/**
35723583
* netdev_reset_queue - reset the packets and bytes count of a network device
35733584
* @dev_queue: network device
@@ -3577,7 +3588,7 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q)
35773588
*/
35783589
static inline void netdev_reset_queue(struct net_device *dev_queue)
35793590
{
3580-
netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0));
3591+
netdev_tx_reset_subqueue(dev_queue, 0);
35813592
}
35823593

35833594
/**

0 commit comments

Comments
 (0)