mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jijie Shao <shaojijie@huawei.com>
To: Tariq Toukan <tariqt@nvidia.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>
Cc: <shaojijie@huawei.com>, Jian Shen <shenjian15@huawei.com>,
	Salil Mehta <salil.mehta@huawei.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>, Leon Romanovsky <leon@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, Gal Pressman <gal@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>,
	Shahar Shitrit <shshitrit@nvidia.com>,
	Yael Chemla <ychemla@nvidia.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [PATCH net-next V2 2/3] net: hns3: Use netif_xmit_timeout_ms() helper
Date: Mon, 12 Jan 2026 19:22:33 +0800	[thread overview]
Message-ID: <6c01abe2-7d0f-47d9-b4db-098e11b2b9e6@huawei.com> (raw)
In-Reply-To: <1768209383-1546791-3-git-send-email-tariqt@nvidia.com>


on 2026/1/12 17:16, Tariq Toukan wrote:
> From: Shahar Shitrit <shshitrit@nvidia.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@nvidia.com>
> Reviewed-by: Yael Chemla <ychemla@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Thanks,
Reviewed-by: Jijie Shao <shaojijie@huawei.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;
>   		}
>   	}

  reply	other threads:[~2026-01-12 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12  9:16 [PATCH net-next V2 0/3] Introduce and use " Tariq Toukan
2026-01-12  9:16 ` [PATCH net-next V2 1/3] net: Introduce " Tariq Toukan
2026-01-12  9:16 ` [PATCH net-next V2 2/3] net: hns3: Use " Tariq Toukan
2026-01-12 11:22   ` Jijie Shao [this message]
2026-01-12  9:16 ` [PATCH net-next V2 3/3] net/mlx5e: Refine TX timeout handling to skip non-timed-out SQ Tariq Toukan
2026-01-14  9:18 ` [PATCH net-next V2 0/3] Introduce and use netif_xmit_timeout_ms() helper Simon Horman
2026-01-15 11:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c01abe2-7d0f-47d9-b4db-098e11b2b9e6@huawei.com \
    --to=shaojijie@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=salil.mehta@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=shshitrit@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=ychemla@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®