From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5BC5BA0519; Fri, 3 Jul 2020 06:00:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 142BD1D9E1; Fri, 3 Jul 2020 05:59:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id B37571D9DC for ; Fri, 3 Jul 2020 05:59:56 +0200 (CEST) IronPort-SDR: d6pv69+/zk+d2BzUvAUYY6QMorItPu935F7WXPzKpuIX6V9tgjJnywo4NKnwyB8NyNS0awBA+u 1+Uy9xgiKqzA== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="134544957" X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="134544957" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 20:59:56 -0700 IronPort-SDR: 10/AA8Jp/W9IQVVrIhd4UiDuA6XJRGcA+9dDq9YPMgGKfkenRrR1fU/Bny4Nqnvd7pR3wbf1hU w+RFjjLaZVkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,306,1589266800"; d="scan'208";a="282165974" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by orsmga006.jf.intel.com with ESMTP; 02 Jul 2020 20:59:54 -0700 From: Jeff Guo 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 Date: Fri, 3 Jul 2020 11:58:58 +0800 Message-Id: <20200703035859.87987-4-jia.guo@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200703035859.87987-1-jia.guo@intel.com> References: <20200621140927.20602-2-jia.guo@intel.com> <20200703035859.87987-1-jia.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [dpdk-dev v4 3/4] net/ice: enable new input set for rss hash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/ice/ice_hash.c | 104 +++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 2aacd70ec..5583c7b29 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -124,6 +124,30 @@ 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_ipv6 = { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER, ETH_RSS_ETH | ETH_RSS_IPV6}; @@ -139,6 +163,30 @@ 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_pppoes_ipv6 = { ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_ETH | ETH_RSS_PPPOE | ETH_RSS_IPV6}; @@ -196,6 +244,18 @@ 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_ipv6, ICE_INSET_NONE, &hint_eth_ipv6}, {pattern_eth_ipv6_udp, ICE_INSET_NONE, @@ -204,6 +264,18 @@ 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_pppoes_ipv6, ICE_INSET_NONE, &hint_eth_pppoes_ipv6}, {pattern_eth_pppoes_ipv6_udp, ICE_INSET_NONE, @@ -221,11 +293,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 +697,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