diff mbox series

[05/10] net/hns3: fix flow control exception

Message ID 1617184904-55349-6-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series some bugfixes for hns3 PMD | expand


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) March 31, 2021, 10:01 a.m. UTC
From: Huisong Li <lihuisong@huawei.com>

In multi-TC scenarios, MAC pause is not supported. Otherwise, only
TC0 can trigger pause frames, and other TCs cannot trigger pause
frames. In this case, flow control does not meet the expectation.

Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
 drivers/net/hns3/hns3_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series


diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 005e8bf..2bb0c43 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5500,6 +5500,11 @@  hns3_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 		return -EOPNOTSUPP;
+	if (hw->num_tc > 1) {
+		hns3_err(hw, "in multi-TC scenarios, MAC pause is not supported.");
+		return -EOPNOTSUPP;
+	}
 	hns3_get_fc_mode(hw, fc_conf->mode);
 	if (hw->requested_mode == hw->current_mode &&
 	    pf->pause_time == fc_conf->pause_time)