diff options
| author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-11-13 09:31:46 +0100 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-11-13 09:31:46 +0100 |
| commit | 9e3e4d8a093b81a6e5bf453b073a0a531411ab6e (patch) | |
| tree | 4f4b54f5192dabddeb2864035115336f5cdade51 /include/linux/netdevice.h | |
| parent | 647ad49ca672b80a3fbf8396bd453ef68ba4916c (diff) | |
| parent | ccda4af0f4b92f7b4c308d3acc262f4a7e3affad (diff) | |
Merge tag 'v4.20-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into nand/next
Linux 4.20-rc2
Diffstat (limited to 'include/linux/netdevice.h')
| -rw-r--r-- | include/linux/netdevice.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index dc1d9ed33b31..857f8abf7b91 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3190,6 +3190,26 @@ static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, #endif } +/* Variant of netdev_tx_sent_queue() for drivers that are aware + * that they should not test BQL status themselves. + * We do want to change __QUEUE_STATE_STACK_XOFF only for the last + * skb of a batch. + * Returns true if the doorbell must be used to kick the NIC. + */ +static inline bool __netdev_tx_sent_queue(struct netdev_queue *dev_queue, + unsigned int bytes, + bool xmit_more) +{ + if (xmit_more) { +#ifdef CONFIG_BQL + dql_queued(&dev_queue->dql, bytes); +#endif + return netif_tx_queue_stopped(dev_queue); + } + netdev_tx_sent_queue(dev_queue, bytes); + return true; +} + /** * netdev_sent_queue - report the number of bytes queued to hardware * @dev: network device |
