From: Huisong Li Date: Sat, 10 Jul 2021 01:58:34 +0000 (+0800) Subject: net/hns3: support multiple TC MAC pause X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fafa81dece7fe22369073235b636c2fc6cda6601;p=dpdk.git net/hns3: support multiple TC MAC pause MAC PAUSE can take effect on a single TC or multiple TCs, depending on the hardware. For example, the Kunpeng 920 supports MAC pause in a single TC, and the Kunpeng 930 supports MAC pause in multiple TCs. This patch supports MAC PAUSE in multiple TC for some hardware. Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index e51512560e..17b995af15 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -3317,6 +3317,7 @@ hns3_get_capability(struct hns3_hw *hw) pf->tqp_config_mode = HNS3_FIXED_MAX_TQP_NUM_MODE; hw->rss_info.ipv6_sctp_offload_supported = false; hw->udp_cksum_mode = HNS3_SPECIAL_PORT_SW_CKSUM_MODE; + pf->support_multi_tc_pause = false; return 0; } @@ -3337,6 +3338,7 @@ hns3_get_capability(struct hns3_hw *hw) pf->tqp_config_mode = HNS3_FLEX_MAX_TQP_NUM_MODE; hw->rss_info.ipv6_sctp_offload_supported = true; hw->udp_cksum_mode = HNS3_SPECIAL_PORT_HW_CKSUM_MODE; + pf->support_multi_tc_pause = true; return 0; } @@ -6103,6 +6105,7 @@ static int hns3_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(dev->data->dev_private); int ret; if (fc_conf->high_water || fc_conf->low_water || @@ -6132,7 +6135,7 @@ hns3_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) return -EOPNOTSUPP; } - if (hw->num_tc > 1) { + if (hw->num_tc > 1 && !pf->support_multi_tc_pause) { hns3_err(hw, "in multi-TC scenarios, MAC pause is not supported."); return -EOPNOTSUPP; } diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index 729e1c3fc2..3485614b6f 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -783,6 +783,7 @@ struct hns3_pf { uint8_t prio_tc[HNS3_MAX_USER_PRIO]; /* TC indexed by prio */ uint16_t pause_time; bool support_fc_autoneg; /* support FC autonegotiate */ + bool support_multi_tc_pause; uint16_t wanted_umv_size; uint16_t max_umv_size;