From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD754356A18; Mon, 12 Jan 2026 11:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768216967; cv=none; b=kttis/RD5XvlCcXFqMF/IB1X+DiYWUywbPMSB8Jl3yjpWVW0r9BxfLK2bBXW2HEl96B2u09NjAlIi5XcZha0HtcxfD0rpxZ4pCTluBOUHHfyjX96eAH+zYGunmwt1DAIEb7uUEWi3H3Q51vzuKLJxGX+dPjtmwsngfV7AJbRtyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768216967; c=relaxed/simple; bh=wHINRcFIg9zMRYnWoIA5DvfXXX2LdiW47hI/Zj2u9fo=; h=Message-ID:Date:MIME-Version:CC:Subject:To:References:From: In-Reply-To:Content-Type; b=Mns8ywApmeiFdb5UplS8GCy4tD/0PmEiaApPAxmElTgOtu/GQudLLzZw2wBvMi21/aCanKPeAg9e/mMpAOioNlnkLroUf1Su4JkHXeqnGOi3t1/0jSN2gBvqcFg7iBJiX6a1oIlU5IB1YJJphGdkrIozSvNsEIP8J9fLHYrrmI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=AD7f0bZ+; arc=none smtp.client-ip=113.46.200.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="AD7f0bZ+" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=vbDYGIXXRXLnCmsRtUPUIjw1vXocJzMCGRQqtNEDzgY=; b=AD7f0bZ+NL61KYTnk8rvo+Xd3BitgZNT4IGtXVpTpFnOIhMzgy8IyMednDhlh7SbdF/41PuA1 1lcOKTfDeYk8mGx8sRtllCtTpxxRvOqoQVf23PC+EmKdconn/tamS7SSz1rZIt+GRzXca0kS5dd HhFDvh4c9anppPLqt3lSXj4= Received: from mail.maildlp.com (unknown [172.19.162.92]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4dqVJS6CsFz1K96f; Mon, 12 Jan 2026 19:19:20 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 3F53340562; Mon, 12 Jan 2026 19:22:37 +0800 (CST) Received: from [10.67.120.192] (10.67.120.192) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Mon, 12 Jan 2026 19:22:35 +0800 Message-ID: <6c01abe2-7d0f-47d9-b4db-098e11b2b9e6@huawei.com> Date: Mon, 12 Jan 2026 19:22:33 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , Jian Shen , Salil Mehta , Saeed Mahameed , Mark Bloch , Leon Romanovsky , , , , Gal Pressman , Moshe Shemesh , Shahar Shitrit , Yael Chemla , Jamal Hadi Salim Subject: Re: [PATCH net-next V2 2/3] net: hns3: Use netif_xmit_timeout_ms() helper To: Tariq Toukan , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" References: <1768209383-1546791-1-git-send-email-tariqt@nvidia.com> <1768209383-1546791-3-git-send-email-tariqt@nvidia.com> From: Jijie Shao In-Reply-To: <1768209383-1546791-3-git-send-email-tariqt@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemk100013.china.huawei.com (7.202.194.61) on 2026/1/12 17:16, Tariq Toukan wrote: > From: Shahar Shitrit > > 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 > Reviewed-by: Yael Chemla > Signed-off-by: Tariq Toukan Thanks, Reviewed-by: Jijie Shao > --- > 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 > #include > #include > +#include > > #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; > } > }