Skip to content

Commit 8d2ad99

Browse files
Guangbin Huangkuba-moo
authored andcommitted
net: hns3: fix VF RSS failed problem after PF enable multi-TCs
When PF is set to multi-TCs and configured mapping relationship between priorities and TCs, the hardware will active these settings for this PF and its VFs. In this case when VF just uses one TC and its rx packets contain priority, and if the priority is not mapped to TC0, as other TCs of VF is not valid, hardware always put this kind of packets to the queue 0. It cause this kind of packets of VF can not be used RSS function. To fix this problem, set tc mode of all unused TCs of VF to the setting of TC0, then rx packet with priority which map to unused TC will be direct to TC0. Fixes: e2cb1de ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0435a4d commit 8d2ad99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,9 @@ static int hclgevf_set_rss_tc_mode(struct hclgevf_dev *hdev, u16 rss_size)
703703
roundup_size = ilog2(roundup_size);
704704

705705
for (i = 0; i < HCLGEVF_MAX_TC_NUM; i++) {
706-
tc_valid[i] = !!(hdev->hw_tc_map & BIT(i));
706+
tc_valid[i] = 1;
707707
tc_size[i] = roundup_size;
708-
tc_offset[i] = rss_size * i;
708+
tc_offset[i] = (hdev->hw_tc_map & BIT(i)) ? rss_size * i : 0;
709709
}
710710

711711
hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_RSS_TC_MODE, false);

0 commit comments

Comments
 (0)