[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190925024043.31030-1-xiaolinkui@kylinos.cn>
Date: Wed, 25 Sep 2019 10:40:43 +0800
From: xiaolinkui <xiaolinkui@...inos.cn>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, xiaolinkui <xiaolinkui@...inos.cn>
Subject: [PATCH] net: use unlikely for dql_avail case
This is an unlikely case, use unlikely() on it seems logical.
Signed-off-by: xiaolinkui <xiaolinkui@...inos.cn>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 88292953aa6f..005f3da1b13d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3270,7 +3270,7 @@ static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
*/
smp_mb();
- if (dql_avail(&dev_queue->dql) < 0)
+ if (unlikely(dql_avail(&dev_queue->dql) < 0))
return;
if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state))
--
2.17.1
Powered by blists - more mailing lists