[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2e3a02cd2a584aa1ed036e90c5c71764e0b8373.camel@gmail.com>
Date: Wed, 11 Jan 2023 08:31:18 -0800
From: Alexander H Duyck <alexander.duyck@...il.com>
To: Hao Lan <lanhao@...wei.com>, davem@...emloft.net, kuba@...nel.org
Cc: yisen.zhuang@...wei.com, salil.mehta@...wei.com,
edumazet@...gle.com, pabeni@...hat.com, richardcochran@...il.com,
shenjian15@...wei.com, wangjie125@...wei.com,
netdev@...r.kernel.org
Subject: Re: [PATCH net] net: hns3: fix wrong use of rss size during VF rss
config
On Tue, 2023-01-10 at 19:53 +0800, Hao Lan wrote:
> From: Jie Wang <wangjie125@...wei.com>
>
> Currently, it used old rss size to get current tc mode. As a result, the
> rss size is updated, but the tc mode is still configured based on the old
> rss size.
>
> So this patch fixes it by using the new rss size in both process.
>
> Fixes: 93969dc14fcd ("net: hns3: refactor VF rss init APIs with new common rss init APIs")
> Signed-off-by: Jie Wang <wangjie125@...wei.com>
> Signed-off-by: Hao Lan <lanhao@...wei.com>
> ---
> drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> index 081bd2c3f289..e84e5be8e59e 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> @@ -3130,7 +3130,7 @@ static int hclgevf_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
>
> hclgevf_update_rss_size(handle, new_tqps_num);
>
> - hclge_comm_get_rss_tc_info(cur_rss_size, hdev->hw_tc_map,
> + hclge_comm_get_rss_tc_info(kinfo->rss_size, hdev->hw_tc_map,
> tc_offset, tc_valid, tc_size);
> ret = hclge_comm_set_rss_tc_mode(&hdev->hw.hw, tc_offset,
> tc_valid, tc_size);
I can see how this was confused. It isn't really clear that handle is
being used to update the kinfo->rss_size value. Maybe think about
adding a comment to prevent someone from reverting this without
realizing that? It might also be useful to do a follow-on patch for
net-next that renames cur_rss_size to orig_rss_size to make it more
obvious that the value is changing.
Reviewed-by: Alexander Duyck <alexanderduyck@...com>
Powered by blists - more mailing lists