DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: qi.z.zhang@intel.com, qiming.yang@intel.com
Cc: dev@dpdk.org, jingjing.wu@intel.com, junfeng.guo@intel.com,
	beilei.xing@intel.com, simei.su@intel.com, jia.guo@intel.com
Subject: [dpdk-dev] [dpdk-dev v5 3/4] net/ice: enable new input set for rss hash
Date: Tue,  7 Jul 2020 13:25:45 +0800	[thread overview]
Message-ID: <20200707052546.14151-4-jia.guo@intel.com> (raw)
In-Reply-To: <20200707052546.14151-1-jia.guo@intel.com>

PF could add or delete a RSS rule base on the PF's hash capability.
Some new rss input set will be supported, the protocols as below:
eth/vlan/l2tpv3/esp/ah/pfcp.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v5->v4:
fix checkpatch issue
refine for eth/vlan hash
---
 drivers/net/ice/ice_hash.c | 146 +++++++++++++++++++++++++++++++++++++
 1 file changed, 146 insertions(+)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 2aacd70ec..f23cc9517 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -124,6 +124,45 @@ struct rss_type_match_hdr hint_eth_pppoes_ipv4_tcp = {
 struct rss_type_match_hdr hint_eth_pppoes_ipv4_sctp = {
 	ICE_FLOW_SEG_HDR_PPPOE,
 	ETH_RSS_ETH | ETH_RSS_PPPOE | ETH_RSS_NONFRAG_IPV4_SCTP};
+struct rss_type_match_hdr hint_eth_ipv4_esp = {
+	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_ESP,
+	ETH_RSS_ETH | ETH_RSS_IPV4 | ETH_RSS_ESP};
+struct rss_type_match_hdr hint_eth_ipv4_udp_esp = {
+	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_NAT_T_ESP,
+	ETH_RSS_ETH | ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_ESP};
+struct rss_type_match_hdr hint_eth_ipv4_ah = {
+	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_AH,
+	ETH_RSS_ETH | ETH_RSS_IPV4 | ETH_RSS_AH};
+struct rss_type_match_hdr hint_eth_ipv4_l2tpv3 = {
+	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_L2TPV3,
+	ETH_RSS_ETH | ETH_RSS_IPV4 | ETH_RSS_L2TPV3};
+struct rss_type_match_hdr hint_eth_ipv4_pfcp = {
+	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_PFCP_SESSION,
+	ETH_RSS_ETH | ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_PFCP};
+struct rss_type_match_hdr hint_eth_vlan_ipv4 = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV4 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER,
+	ETH_RSS_ETH | ETH_RSS_IPV4 | ETH_RSS_C_VLAN};
+struct rss_type_match_hdr hint_eth_vlan_ipv4_udp = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV4 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_UDP,
+	ETH_RSS_ETH | ETH_RSS_C_VLAN |
+	ETH_RSS_NONFRAG_IPV4_UDP};
+struct rss_type_match_hdr hint_eth_vlan_ipv4_tcp = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV4 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_TCP,
+	ETH_RSS_ETH | ETH_RSS_C_VLAN |
+	ETH_RSS_NONFRAG_IPV4_TCP};
+struct rss_type_match_hdr hint_eth_vlan_ipv4_sctp = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV4 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_SCTP,
+	ETH_RSS_ETH | ETH_RSS_C_VLAN |
+	ETH_RSS_NONFRAG_IPV4_SCTP};
 struct rss_type_match_hdr hint_eth_ipv6 = {
 	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER,
 	ETH_RSS_ETH | ETH_RSS_IPV6};
@@ -139,6 +178,45 @@ struct rss_type_match_hdr hint_eth_ipv6_sctp = {
 	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_SCTP,
 	ETH_RSS_ETH | ETH_RSS_NONFRAG_IPV6_SCTP};
+struct rss_type_match_hdr hint_eth_ipv6_esp = {
+	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_ESP,
+	ETH_RSS_ETH | ETH_RSS_IPV6 | ETH_RSS_ESP};
+struct rss_type_match_hdr hint_eth_ipv6_udp_esp = {
+	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_NAT_T_ESP,
+	ETH_RSS_ETH | ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_ESP};
+struct rss_type_match_hdr hint_eth_ipv6_ah = {
+	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_AH,
+	ETH_RSS_ETH | ETH_RSS_IPV6 | ETH_RSS_AH};
+struct rss_type_match_hdr hint_eth_ipv6_l2tpv3 = {
+	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_L2TPV3,
+	ETH_RSS_ETH | ETH_RSS_IPV6 | ETH_RSS_L2TPV3};
+struct rss_type_match_hdr hint_eth_ipv6_pfcp = {
+	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
+	ICE_FLOW_SEG_HDR_PFCP_SESSION,
+	ETH_RSS_ETH | ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_PFCP};
+struct rss_type_match_hdr hint_eth_vlan_ipv6 = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV6 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER,
+	ETH_RSS_ETH | ETH_RSS_IPV6 | ETH_RSS_C_VLAN};
+struct rss_type_match_hdr hint_eth_vlan_ipv6_udp = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV6 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_UDP,
+	ETH_RSS_ETH | ETH_RSS_C_VLAN |
+	ETH_RSS_NONFRAG_IPV6_UDP};
+struct rss_type_match_hdr hint_eth_vlan_ipv6_tcp = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV6 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_TCP,
+	ETH_RSS_ETH | ETH_RSS_C_VLAN |
+	ETH_RSS_NONFRAG_IPV6_TCP};
+struct rss_type_match_hdr hint_eth_vlan_ipv6_sctp = {
+	ICE_FLOW_SEG_HDR_VLAN | ICE_FLOW_SEG_HDR_IPV6 |
+	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_SCTP,
+	ETH_RSS_ETH | ETH_RSS_C_VLAN |
+	ETH_RSS_NONFRAG_IPV6_SCTP};
 struct rss_type_match_hdr hint_eth_pppoes_ipv6 = {
 	ICE_FLOW_SEG_HDR_PPPOE,
 	ETH_RSS_ETH | ETH_RSS_PPPOE | ETH_RSS_IPV6};
@@ -196,6 +274,24 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {
 		&hint_eth_pppoes_ipv4_tcp},
 	{pattern_eth_pppoes_ipv4_sctp,	    ICE_INSET_NONE,
 		&hint_eth_pppoes_ipv4_sctp},
+	{pattern_eth_ipv4_esp,		    ICE_INSET_NONE,
+		&hint_eth_ipv4_esp},
+	{pattern_eth_ipv4_udp_esp,	    ICE_INSET_NONE,
+		&hint_eth_ipv4_udp_esp},
+	{pattern_eth_ipv4_ah,		    ICE_INSET_NONE,
+		&hint_eth_ipv4_ah},
+	{pattern_eth_ipv4_l2tp,		    ICE_INSET_NONE,
+		&hint_eth_ipv4_l2tpv3},
+	{pattern_eth_ipv4_pfcp,		    ICE_INSET_NONE,
+		&hint_eth_ipv4_pfcp},
+	{pattern_eth_vlan_ipv4,		    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv4},
+	{pattern_eth_vlan_ipv4_udp,	    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv4_udp},
+	{pattern_eth_vlan_ipv4_tcp,	    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv4_tcp},
+	{pattern_eth_vlan_ipv4_sctp,	    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv4_sctp},
 	{pattern_eth_ipv6,		    ICE_INSET_NONE,
 		&hint_eth_ipv6},
 	{pattern_eth_ipv6_udp,		    ICE_INSET_NONE,
@@ -204,6 +300,24 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {
 		&hint_eth_ipv6_tcp},
 	{pattern_eth_ipv6_sctp,		    ICE_INSET_NONE,
 		&hint_eth_ipv6_sctp},
+	{pattern_eth_ipv6_esp,		    ICE_INSET_NONE,
+		&hint_eth_ipv6_esp},
+	{pattern_eth_ipv6_udp_esp,	    ICE_INSET_NONE,
+		&hint_eth_ipv6_udp_esp},
+	{pattern_eth_ipv6_ah,		    ICE_INSET_NONE,
+		&hint_eth_ipv6_ah},
+	{pattern_eth_ipv6_l2tp,		    ICE_INSET_NONE,
+		&hint_eth_ipv6_l2tpv3},
+	{pattern_eth_ipv6_pfcp,		    ICE_INSET_NONE,
+		&hint_eth_ipv6_pfcp},
+	{pattern_eth_vlan_ipv6,		    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv6},
+	{pattern_eth_vlan_ipv6_udp,	    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv6_udp},
+	{pattern_eth_vlan_ipv6_tcp,	    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv6_tcp},
+	{pattern_eth_vlan_ipv6_sctp,	    ICE_INSET_NONE,
+		&hint_eth_vlan_ipv6_sctp},
 	{pattern_eth_pppoes_ipv6,	    ICE_INSET_NONE,
 		&hint_eth_pppoes_ipv6},
 	{pattern_eth_pppoes_ipv6_udp,	    ICE_INSET_NONE,
@@ -221,11 +335,34 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {
  * the second member is hash fields.
  */
 struct ice_hash_match_type ice_hash_type_list[] = {
+	{ETH_RSS_L2_SRC_ONLY,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA)},
+	{ETH_RSS_L2_DST_ONLY,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_DA)},
+	{ETH_RSS_ETH | ETH_RSS_L2_SRC_ONLY,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA)},
+	{ETH_RSS_ETH | ETH_RSS_L2_DST_ONLY,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_DA)},
+	{ETH_RSS_ETH,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA) |
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_DA)},
 	{ETH_RSS_PPPOE,
 		ICE_FLOW_HASH_PPPOE_SESS_ID},
 	{ETH_RSS_ETH | ETH_RSS_PPPOE | ETH_RSS_L2_SRC_ONLY,
 		ICE_FLOW_HASH_PPPOE_SESS_ID |
 		BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA)},
+	{ETH_RSS_C_VLAN,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN)},
+	{ETH_RSS_S_VLAN,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_S_VLAN)},
+	{ETH_RSS_ESP,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_ESP_SPI)},
+	{ETH_RSS_AH,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_AH_SPI)},
+	{ETH_RSS_L2TPV3,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV3_SESS_ID)},
+	{ETH_RSS_PFCP,
+		BIT_ULL(ICE_FLOW_FIELD_IDX_PFCP_SEID)},
 	/* IPV4 */
 	{ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
 		BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},
@@ -602,6 +739,15 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
 				}
 			}
 
+			/* update hash field for nat-t esp. */
+			if (rss_type == ETH_RSS_ESP &&
+			    (m->eth_rss_hint & ETH_RSS_NONFRAG_IPV4_UDP)) {
+				hash_meta->hash_flds &=
+				~(BIT_ULL(ICE_FLOW_FIELD_IDX_ESP_SPI));
+				hash_meta->hash_flds |=
+				BIT_ULL(ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI);
+			}
+
 			/* update hash field for gtpu-ip and gtpu-eh. */
 			if (rss_type != ETH_RSS_GTPU)
 				break;
-- 
2.20.1


  parent reply	other threads:[~2020-07-07  5:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12  2:57 [dpdk-dev] " Jeff Guo
2020-06-14 15:08 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
2020-06-21 14:09   ` [dpdk-dev] [dpdk-dev v3 1/2] app/testpmd: add GTPU to RSS hash commands Jeff Guo
2020-06-21 14:09     ` [dpdk-dev] [dpdk-dev v3 2/2] net/ice: enable new input set for rss hash Jeff Guo
2020-07-01 13:02       ` Zhang, Qi Z
2020-07-03  3:53         ` Jeff Guo
2020-07-03  3:58       ` [dpdk-dev] [dpdk-dev v4 0/4] enable new hash flow for pf Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 1/4] net/ice: refactor for pf hash flow Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 2/4] net/ice: support hash for new GTPU protocols Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 3/4] net/ice: enable new input set for rss hash Jeff Guo
2020-07-03  3:58         ` [dpdk-dev] [dpdk-dev v4 4/4] app/testpmd: add GTPU to RSS hash commands Jeff Guo
2020-07-07  5:25       ` [dpdk-dev] [dpdk-dev v5 0/4] enable new hash flow for pf Jeff Guo
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 1/4] net/ice: refactor for pf hash flow Jeff Guo
2020-07-07 14:24           ` Ferruh Yigit
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 2/4] net/ice: support hash for new GTPU protocols Jeff Guo
2020-07-07  5:25         ` Jeff Guo [this message]
2020-07-07  5:25         ` [dpdk-dev] [dpdk-dev v5 4/4] app/testpmd: add GTPU to RSS hash commands Jeff Guo
2020-07-07  9:31         ` [dpdk-dev] [dpdk-dev v5 0/4] enable new hash flow for pf Zhang, Qi Z

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=20200707052546.14151-4-jia.guo@intel.com \
    --to=jia.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=simei.su@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).