DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 3/4] net/hns3: support multiple TC MAC pause
Date: Sun, 13 Jun 2021 11:05:07 +0800	[thread overview]
Message-ID: <1623553508-5478-4-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1623553508-5478-1-git-send-email-humin29@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

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 <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 5 ++++-
 drivers/net/hns3/hns3_ethdev.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index e515125..17b995a 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 b8347c2..5f448af 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;
-- 
2.7.4


  parent reply	other threads:[~2021-06-13  3:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13  3:05 [dpdk-dev] [PATCH 0/4] features for hns3 PMD Min Hu (Connor)
2021-06-13  3:05 ` [dpdk-dev] [PATCH 1/4] net/hns3: add query basic info support for VF Min Hu (Connor)
2021-06-13  3:05 ` [dpdk-dev] [PATCH 2/4] net/hns3: support for VF modify VLAN filter state Min Hu (Connor)
2021-06-13  3:05 ` Min Hu (Connor) [this message]
2021-06-13  3:05 ` [dpdk-dev] [PATCH 4/4] net/hns3: supports disabling PFC by dev configure API Min Hu (Connor)
2021-06-14 14:59   ` Andrew Rybchenko
2021-06-14 15:00 ` [dpdk-dev] [PATCH 0/4] features for hns3 PMD Andrew Rybchenko
2021-07-09  1:32   ` Min Hu (Connor)
2021-07-09  9:20     ` Andrew Rybchenko
2021-07-10  1:59       ` Min Hu (Connor)
2021-07-10  1:58 ` [dpdk-dev] [PATCH v2 0/3] " Min Hu (Connor)
2021-07-10  1:58   ` [dpdk-dev] [PATCH v2 1/3] net/hns3: add query basic info support for VF Min Hu (Connor)
2021-07-10  1:58   ` [dpdk-dev] [PATCH v2 2/3] net/hns3: support for VF modify VLAN filter state Min Hu (Connor)
2021-07-10  1:58   ` [dpdk-dev] [PATCH v2 3/3] net/hns3: support multiple TC MAC pause Min Hu (Connor)
2021-07-13  9:43   ` [dpdk-dev] [PATCH v2 0/3] features for hns3 PMD Andrew Rybchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1623553508-5478-4-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).