Commit 977f1aa5 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: bql: add more documentation

Add some documentation for netdev_tx_sent_queue() and
netdev_tx_completed_queue()

Stating that netdev_tx_completed_queue() must be called once
per TX completion round is apparently not obvious for everybody.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25de4a0b
...@@ -3353,6 +3353,16 @@ static inline void netdev_txq_bql_complete_prefetchw(struct netdev_queue *dev_qu ...@@ -3353,6 +3353,16 @@ static inline void netdev_txq_bql_complete_prefetchw(struct netdev_queue *dev_qu
#endif #endif
} }
/**
* netdev_tx_sent_queue - report the number of bytes queued to a given tx queue
* @dev_queue: network device queue
* @bytes: number of bytes queued to the device queue
*
* Report the number of bytes queued for sending/completion to the network
* device hardware queue. @bytes should be a good approximation and should
* exactly match netdev_completed_queue() @bytes.
* This is typically called once per packet, from ndo_start_xmit().
*/
static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
unsigned int bytes) unsigned int bytes)
{ {
...@@ -3398,13 +3408,14 @@ static inline bool __netdev_tx_sent_queue(struct netdev_queue *dev_queue, ...@@ -3398,13 +3408,14 @@ static inline bool __netdev_tx_sent_queue(struct netdev_queue *dev_queue,
} }
/** /**
* netdev_sent_queue - report the number of bytes queued to hardware * netdev_sent_queue - report the number of bytes queued to hardware
* @dev: network device * @dev: network device
* @bytes: number of bytes queued to the hardware device queue * @bytes: number of bytes queued to the hardware device queue
* *
* Report the number of bytes queued for sending/completion to the network * Report the number of bytes queued for sending/completion to the network
* device hardware queue. @bytes should be a good approximation and should * device hardware queue#0. @bytes should be a good approximation and should
* exactly match netdev_completed_queue() @bytes * exactly match netdev_completed_queue() @bytes.
* This is typically called once per packet, from ndo_start_xmit().
*/ */
static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes) static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes)
{ {
...@@ -3419,6 +3430,15 @@ static inline bool __netdev_sent_queue(struct net_device *dev, ...@@ -3419,6 +3430,15 @@ static inline bool __netdev_sent_queue(struct net_device *dev,
xmit_more); xmit_more);
} }
/**
* netdev_tx_completed_queue - report number of packets/bytes at TX completion.
* @dev_queue: network device queue
* @pkts: number of packets (currently ignored)
* @bytes: number of bytes dequeued from the device queue
*
* Must be called at most once per TX completion round (and not per
* individual packet), so that BQL can adjust its limits appropriately.
*/
static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue, static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
unsigned int pkts, unsigned int bytes) unsigned int pkts, unsigned int bytes)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment