diff mbox series

[V3,net,1/3] net: hns3: fix index limit to support all queue stats

Message ID 20240318132948.3624333-2-shaojijie@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series There are some bugfix for the HNS3 ethernet driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 939 this patch: 939
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 956 this patch: 956
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 956 this patch: 956
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-19--18-00 (tests: 907)

Commit Message

Jijie Shao March 18, 2024, 1:29 p.m. UTC
From: Jie Wang <wangjie125@huawei.com>

Currently, hns hardware supports more than 512 queues and the index limit
in hclge_comm_tqps_update_stats is wrong. So this patch removes it.

Fixes: 287db5c40d15 ("net: hns3: create new set of common tqp stats APIs for PF and VF reuse")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 .../ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Kubiak March 18, 2024, 2:26 p.m. UTC | #1
On Mon, Mar 18, 2024 at 09:29:46PM +0800, Jijie Shao wrote:
> From: Jie Wang <wangjie125@huawei.com>
> 
> Currently, hns hardware supports more than 512 queues and the index limit
> in hclge_comm_tqps_update_stats is wrong. So this patch removes it.
> 
> Fixes: 287db5c40d15 ("net: hns3: create new set of common tqp stats APIs for PF and VF reuse")
> Signed-off-by: Jie Wang <wangjie125@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
>  .../ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c  | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
> index f3c9395d8351..618f66d9586b 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
> @@ -85,7 +85,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle,
>  		hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS,
>  						true);
>  
> -		desc.data[0] = cpu_to_le32(tqp->index & 0x1ff);
> +		desc.data[0] = cpu_to_le32(tqp->index);
>  		ret = hclge_comm_cmd_send(hw, &desc, 1);
>  		if (ret) {
>  			dev_err(&hw->cmq.csq.pdev->dev,
> -- 
> 2.30.0
> 

Thanks,
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Kalesh Anakkur Purayil March 18, 2024, 2:36 p.m. UTC | #2
On Mon, Mar 18, 2024 at 7:05 PM Jijie Shao <shaojijie@huawei.com> wrote:
>
> From: Jie Wang <wangjie125@huawei.com>
>
> Currently, hns hardware supports more than 512 queues and the index limit
> in hclge_comm_tqps_update_stats is wrong. So this patch removes it.
>
> Fixes: 287db5c40d15 ("net: hns3: create new set of common tqp stats APIs for PF and VF reuse")
> Signed-off-by: Jie Wang <wangjie125@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Only question I have is whether this is a fix or an enhancement.
Nevertheless changes look good to me.

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> ---
>  .../ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c  | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
> index f3c9395d8351..618f66d9586b 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
> @@ -85,7 +85,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle,
>                 hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS,
>                                                 true);
>
> -               desc.data[0] = cpu_to_le32(tqp->index & 0x1ff);
> +               desc.data[0] = cpu_to_le32(tqp->index);
>                 ret = hclge_comm_cmd_send(hw, &desc, 1);
>                 if (ret) {
>                         dev_err(&hw->cmq.csq.pdev->dev,
> --
> 2.30.0
>
>
Jijie Shao March 25, 2024, 12:55 p.m. UTC | #3
on 2024/3/18 22:36, Kalesh Anakkur Purayil wrote:
> On Mon, Mar 18, 2024 at 7:05 PM Jijie Shao <shaojijie@huawei.com> wrote:
>> From: Jie Wang <wangjie125@huawei.com>
>>
>> Currently, hns hardware supports more than 512 queues and the index limit
>> in hclge_comm_tqps_update_stats is wrong. So this patch removes it.
>>
>> Fixes: 287db5c40d15 ("net: hns3: create new set of common tqp stats APIs for PF and VF reuse")
>> Signed-off-by: Jie Wang <wangjie125@huawei.com>
>> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> Only question I have is whether this is a fix or an enhancement.
> Nevertheless changes look good to me.

Actually, it's a fix. The capability of supporting more than 512 queues 
was not implemented by modifying this statistics. this bug prevents us 
from querying the statistics of more than 512 queues.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
index f3c9395d8351..618f66d9586b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
@@ -85,7 +85,7 @@  int hclge_comm_tqps_update_stats(struct hnae3_handle *handle,
 		hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS,
 						true);
 
-		desc.data[0] = cpu_to_le32(tqp->index & 0x1ff);
+		desc.data[0] = cpu_to_le32(tqp->index);
 		ret = hclge_comm_cmd_send(hw, &desc, 1);
 		if (ret) {
 			dev_err(&hw->cmq.csq.pdev->dev,