[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6c01abe2-7d0f-47d9-b4db-098e11b2b9e6@huawei.com>
Date: Mon, 12 Jan 2026 19:22:33 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: Tariq Toukan <tariqt@...dia.com>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Andrew
Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>
CC: <shaojijie@...wei.com>, Jian Shen <shenjian15@...wei.com>, Salil Mehta
<salil.mehta@...wei.com>, Saeed Mahameed <saeedm@...dia.com>, Mark Bloch
<mbloch@...dia.com>, Leon Romanovsky <leon@...nel.org>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-rdma@...r.kernel.org>, Gal Pressman <gal@...dia.com>, Moshe Shemesh
<moshe@...dia.com>, Shahar Shitrit <shshitrit@...dia.com>, Yael Chemla
<ychemla@...dia.com>, Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [PATCH net-next V2 2/3] net: hns3: Use netif_xmit_timeout_ms()
helper
on 2026/1/12 17:16, Tariq Toukan wrote:
> From: Shahar Shitrit <shshitrit@...dia.com>
>
> 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@...dia.com>
> Reviewed-by: Yael Chemla <ychemla@...dia.com>
> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
Thanks,
Reviewed-by: Jijie Shao <shaojijie@...wei.com>
> ---
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index 7a0654e2d3dd..7b9269f6fdfc 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -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;
> }
> }
Powered by blists - more mailing lists