Skip to content

Commit c3b9c50

Browse files
Huazhong Tandavem330
authored andcommitted
net: hns3: fix wrong combined count returned by ethtool -l
The current code returns the number of all queues that can be used and the number of queues that have been allocated, which is incorrect. What should be returned is the number of queues allocated for each enabled TC and the number of queues that can be allocated. This patch fixes it. Fixes: 482d2e9 ("net: hns3: add support to query tqps number") Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: Yunsheng Lin <[email protected]> Signed-off-by: Peng Li <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 205a24c commit c3b9c50

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7510,18 +7510,17 @@ static u32 hclge_get_max_channels(struct hnae3_handle *handle)
75107510
struct hclge_vport *vport = hclge_get_vport(handle);
75117511
struct hclge_dev *hdev = vport->back;
75127512

7513-
return min_t(u32, hdev->rss_size_max * kinfo->num_tc, hdev->num_tqps);
7513+
return min_t(u32, hdev->rss_size_max,
7514+
vport->alloc_tqps / kinfo->num_tc);
75147515
}
75157516

75167517
static void hclge_get_channels(struct hnae3_handle *handle,
75177518
struct ethtool_channels *ch)
75187519
{
7519-
struct hclge_vport *vport = hclge_get_vport(handle);
7520-
75217520
ch->max_combined = hclge_get_max_channels(handle);
75227521
ch->other_count = 1;
75237522
ch->max_other = 1;
7524-
ch->combined_count = vport->alloc_tqps;
7523+
ch->combined_count = handle->kinfo.rss_size;
75257524
}
75267525

75277526
static void hclge_get_tqps_and_rss_info(struct hnae3_handle *handle,

0 commit comments

Comments
 (0)