DPDK patches and discussions
 help / color / mirror / Atom feed
From: Lijun Ou <oulijun@huawei.com>
To: <ferruh.yigit@intel.com>
Cc: <dev@dpdk.org>, <linuxarm@huawei.com>
Subject: [dpdk-dev] [PATCH v2 1/8] net/hns3: enable RSS for ipv6-sctp dst/src port fields
Date: Thu, 29 Oct 2020 20:17:48 +0800
Message-ID: <1603973875-8431-2-git-send-email-oulijun@huawei.com> (raw)
In-Reply-To: <1603973875-8431-1-git-send-email-oulijun@huawei.com>

For Kunpeng930 NIC hardware, it supports to use dst/src port to
RSS hash for ipv6-sctp packet type. However, the Kunpeng920 NIC
hardware is different with it. The Kunpeng920 NIC only supports
dst/src ip to RSS hash for ipv6-sctp packet type.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    |  2 ++
 drivers/net/hns3/hns3_ethdev_vf.c |  2 ++
 drivers/net/hns3/hns3_flow.c      | 12 +++++++++++-
 drivers/net/hns3/hns3_rss.c       | 12 ++++++++++--
 drivers/net/hns3/hns3_rss.h       |  6 ++++++
 5 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 5a234e2..c34dbea 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -3037,6 +3037,7 @@ hns3_get_capability(struct hns3_hw *hw)
 		hw->vlan_mode = HNS3_SW_SHIFT_AND_DISCARD_MODE;
 		hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
 		pf->tqp_config_mode = HNS3_FIXED_MAX_TQP_NUM_MODE;
+		hw->rss_info.ipv6_sctp_offload_supported = false;
 		return 0;
 	}
 
@@ -3055,6 +3056,7 @@ hns3_get_capability(struct hns3_hw *hw)
 	hw->vlan_mode = HNS3_HW_SHIFT_AND_DISCARD_MODE;
 	hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
 	pf->tqp_config_mode = HNS3_FLEX_MAX_TQP_NUM_MODE;
+	hw->rss_info.ipv6_sctp_offload_supported = true;
 
 	return 0;
 }
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index d1c3fb8..7d3750d 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1213,6 +1213,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
 		hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
 		hw->tso_mode = HNS3_TSO_SW_CAL_PSEUDO_H_CSUM;
 		hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
+		hw->rss_info.ipv6_sctp_offload_supported = false;
 		return 0;
 	}
 
@@ -1229,6 +1230,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
 	hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
 	hw->tso_mode = HNS3_TSO_HW_CAL_PSEUDO_H_CSUM;
 	hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
+	hw->rss_info.ipv6_sctp_offload_supported = true;
 
 	return 0;
 }
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 4fb129e..73f5e8e 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1399,8 +1399,18 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "too many queues for RSS context");
 
+	/*
+	 * For Kunpeng920 and Kunpeng930 NIC hardware, it is not supported to
+	 * use dst port/src port fields to RSS hash for the following packet
+	 * types.
+	 * - IPV4 FRAG | IPV4 NONFRAG | IPV6 FRAG | IPV6 NONFRAG
+	 * Besides, for Kunpeng920, The NIC hardware is not supported to use
+	 * src/dst port fields to RSS hash for IPV6 SCTP packet type.
+	 */
 	if (rss->types & (ETH_RSS_L4_DST_ONLY | ETH_RSS_L4_SRC_ONLY) &&
-	    (rss->types & ETH_RSS_IP))
+	   (rss->types & ETH_RSS_IP ||
+	   (!hw->rss_info.ipv6_sctp_offload_supported &&
+	   rss->types & ETH_RSS_NONFRAG_IPV6_SCTP)))
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  &rss->types,
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index a8b8143..2efd410 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -61,8 +61,10 @@ enum hns3_tuple_field {
 	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D,
 	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S,
 
-	/* IPV6_UDP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D = 50,
+	/* IPV6_SCTP ENABLE FIELD */
+	HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_D = 48,
+	HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_S,
+	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D,
 	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S,
 	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER,
 
@@ -133,6 +135,10 @@ static const struct {
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) },
 	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L3_DST_ONLY,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) },
+	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_SRC_ONLY,
+	  BIT_ULL(HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_S) },
+	{ ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_DST_ONLY,
+	  BIT_ULL(HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_D) },
 	{ ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_L3_SRC_ONLY,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) },
 	{ ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_L3_DST_ONLY,
@@ -177,6 +183,8 @@ static const struct {
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D) },
 	{ ETH_RSS_NONFRAG_IPV6_SCTP, BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) |
+	  BIT_ULL(HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_D) |
+	  BIT_ULL(HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER) },
 	{ ETH_RSS_NONFRAG_IPV6_OTHER,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) |
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index b5ac8ae..6d1d25f 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -48,6 +48,12 @@ struct hns3_rss_conf {
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE]; /* Shadow table */
 	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
 	bool valid; /* check if RSS rule is valid */
+	/*
+	 * For IPv6 SCTP packets type, check whether the NIC hardware support
+	 * RSS hash using the src/dst port as the input tuple. For Kunpeng920
+	 * NIC hardware, it is not supported
+	 */
+	bool ipv6_sctp_offload_supported;
 };
 
 #ifndef ilog2
-- 
2.7.4


  reply	other threads:[~2020-10-29 12:18 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 11:14 [dpdk-dev] [PATCH 0/8] hns3 misc updates Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 1/8] net/hns3: add queue count of Rx API support Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 2/8] net/hns3: fix RSS max queue id allowed in multi-TC case Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 3/8] net/hns3: fix packect type report in Rx Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 4/8] net/hns3: fix uncheck return value warning Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 5/8] net/hns3: fix data type to release fake queue > 255 Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 6/8] net/hns3: fix HW ring not clear after queue stop Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 7/8] net/hns3: fix return value check of setting VF bus master Lijun Ou
2020-10-29 11:14 ` [dpdk-dev] [PATCH 8/8] net/hns3: fix meson build for enabling SVE Rx/Tx Lijun Ou
2020-10-29 12:17 ` [dpdk-dev] [PATCH v2 0/8] hns3 misc updates Lijun Ou
2020-10-29 12:17   ` Lijun Ou [this message]
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 2/8] net/hns3: add queue count of Rx API support Lijun Ou
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 3/8] net/hns3: fix RSS max queue id allowed in multi-TC case Lijun Ou
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 4/8] net/hns3: fix packect type report in Rx Lijun Ou
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 5/8] net/hns3: fix uncheck return value warning Lijun Ou
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 6/8] net/hns3: fix data type to release fake queue > 255 Lijun Ou
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 7/8] net/hns3: fix HW ring not clear after queue stop Lijun Ou
2020-10-29 12:17   ` [dpdk-dev] [PATCH v2 8/8] net/hns3: fix return value check of setting VF bus Lijun Ou
2020-10-29 12:49   ` [dpdk-dev] [PATCH v2 0/8] hns3 misc updates Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 1/8] net/hns3: enable RSS for ipv6-sctp dst/src port fields Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 2/8] net/hns3: add queue count of Rx API support Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 3/8] net/hns3: fix RSS max queue id allowed in multi-TC case Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 4/8] net/hns3: fix packect type report in Rx Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 5/8] net/hns3: fix uncheck return value warning Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 6/8] net/hns3: fix data type to release fake queue > 255 Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 7/8] net/hns3: fix HW ring not clear after queue stop Lijun Ou
2020-10-29 12:49     ` [dpdk-dev] [PATCH v2 8/8] net/hns3: fix return value check of setting VF bus Lijun Ou
2020-10-29 12:51     ` [dpdk-dev] [PATCH v3 0/8] hns3 misc updates Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 1/8] net/hns3: add queue count of Rx API support Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 2/8] net/hns3: fix RSS max queue id allowed in multi-TC case Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 3/8] net/hns3: fix packect type report in Rx Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 4/8] net/hns3: fix uncheck return value warning Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 5/8] net/hns3: fix data type to release fake queue > 255 Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 6/8] net/hns3: fix HW ring not clear after queue stop Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 7/8] net/hns3: fix value check of setting VF PCI bus function Lijun Ou
2020-10-29 12:51       ` [dpdk-dev] [PATCH v3 8/8] net/hns3: fix meson build for enabling SVE Rx/Tx Lijun Ou
2020-10-30 17:00       ` [dpdk-dev] [PATCH v3 0/8] hns3 misc updates Ferruh Yigit

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=1603973875-8431-2-git-send-email-oulijun@huawei.com \
    --to=oulijun@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=linuxarm@huawei.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git