mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
net: hns3: Use netif_xmit_timeout_ms() helper
Replace the open-coded TX queue timeout check in hns3_get_timeout_queue() with a call to netif_xmit_timeout_ms() helper. Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com> Reviewed-by: Yael Chemla <ychemla@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Jijie Shao <shaojijie@huawei.com> Link: https://patch.msgid.link/1768209383-1546791-3-git-send-email-tariqt@nvidia.com Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
cfbc8b6bab
commit
3ae02d6597
|
|
@ -25,6 +25,7 @@
|
|||
#include <net/tcp.h>
|
||||
#include <net/vxlan.h>
|
||||
#include <net/geneve.h>
|
||||
#include <net/netdev_queues.h>
|
||||
|
||||
#include "hnae3.h"
|
||||
#include "hns3_enet.h"
|
||||
|
|
@ -2807,14 +2808,12 @@ static int hns3_get_timeout_queue(struct net_device *ndev)
|
|||
|
||||
/* Find the stopped queue the same way the stack does */
|
||||
for (i = 0; i < ndev->num_tx_queues; i++) {
|
||||
unsigned int timedout_ms;
|
||||
struct netdev_queue *q;
|
||||
unsigned long trans_start;
|
||||
|
||||
q = netdev_get_tx_queue(ndev, i);
|
||||
trans_start = READ_ONCE(q->trans_start);
|
||||
if (netif_xmit_stopped(q) &&
|
||||
time_after(jiffies,
|
||||
(trans_start + ndev->watchdog_timeo))) {
|
||||
timedout_ms = netif_xmit_timeout_ms(q);
|
||||
if (timedout_ms) {
|
||||
#ifdef CONFIG_BQL
|
||||
struct dql *dql = &q->dql;
|
||||
|
||||
|
|
@ -2823,8 +2822,7 @@ static int hns3_get_timeout_queue(struct net_device *ndev)
|
|||
dql->adj_limit, dql->num_completed);
|
||||
#endif
|
||||
netdev_info(ndev, "queue state: 0x%lx, delta msecs: %u\n",
|
||||
q->state,
|
||||
jiffies_to_msecs(jiffies - trans_start));
|
||||
q->state, timedout_ms);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user