From patchwork Fri Jul 3 11:16:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gordon@dpdk.org, Noonan@dpdk.org, gordon.noonan@intel.com X-Patchwork-Id: 73034 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 37731A0519; Fri, 3 Jul 2020 16:40:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D07E81DC93; Fri, 3 Jul 2020 16:38:02 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B42231D8CF for ; Fri, 3 Jul 2020 13:17:18 +0200 (CEST) IronPort-SDR: hFYmJv9Xc7bkCUIleljOcyjPodgawmBgdPVR00jjdeqrKi2zhN7O6OLI/ib75IdB3Ofdlf5to9 /WN64mt6pIyg== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="146220568" X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="146220568" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 04:17:18 -0700 IronPort-SDR: 8H03Tu4OMHnew/Sie432hW9JQgKxKP+xOp5d2yuo3qPxvyVd//724gIzdAVvpEGBVeiyoyEOv0 LkPREfLsts5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,308,1589266800"; d="scan'208";a="321780384" Received: from silpixa00400380.ir.intel.com ([10.237.213.188]) by FMSMGA003.fm.intel.com with ESMTP; 03 Jul 2020 04:17:17 -0700 From: Gordon@dpdk.org, Noonan@dpdk.org, gordon.noonan@intel.com To: dev@dpdk.org Cc: gordon.noonan@intel.com Date: Fri, 3 Jul 2020 12:16:42 +0100 Message-Id: <20200703111644.73351-7-gordon.noonan@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200703111644.73351-1-gordon.noonan@intel.com> References: <20200703111644.73351-1-gordon.noonan@intel.com> X-Mailman-Approved-At: Fri, 03 Jul 2020 16:37:41 +0200 Subject: [dpdk-dev] [PATCH RFC 6/8] ICE: Enable advanced RSS for PPPoE 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" From: gordonno --- app/test-pmd/cmdline.c | 6 ++++-- app/test-pmd/config.c | 1 + drivers/net/ice/ice_hash.c | 31 ++++++++++++++++++++++++++++++- lib/librte_ethdev/rte_ethdev.h | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 996a49876..1ac0b89dd 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2317,6 +2317,8 @@ cmd_config_rss_parsed(void *parsed_result, rss_conf.rss_hf = ETH_RSS_AH; else if (!strcmp(res->value, "pfcp")) rss_conf.rss_hf = ETH_RSS_PFCP; + else if (!strcmp(res->value, "pppoe")) + rss_conf.rss_hf = ETH_RSS_PPPOE; else if (!strcmp(res->value, "none")) rss_conf.rss_hf = 0; else if (!strcmp(res->value, "default")) @@ -2490,7 +2492,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type = "ipv6-tcp-ex#ipv6-udp-ex#" "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#" "l2-src-only#l2-dst-only#s-vlan#c-vlan#" - "l2tpv3#esp#ah#pfcp"); + "l2tpv3#esp#ah#pfcp#pppoe"); cmdline_parse_token_string_t cmd_config_rss_hash_key_value = TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL); @@ -2503,7 +2505,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = { "l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|" "l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|" "l2-src-only|l2-dst-only|s-vlan|c-vlan|" - "l2tpv3|esp|ah|pfcp " + "l2tpv3|esp|ah|pfcp|pppoe " "", .tokens = { (void *)&cmd_config_rss_hash_key_port, diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 5381207cc..ef046992d 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -118,6 +118,7 @@ const struct rss_type_info rss_type_table[] = { { "ah", ETH_RSS_AH }, { "l2tpv3", ETH_RSS_L2TPV3 }, { "pfcp", ETH_RSS_PFCP }, + { "pppoe", ETH_RSS_PPPOE }, { NULL, 0 }, }; diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 11435cbfb..69a469863 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -108,6 +108,16 @@ struct rss_type_match_hdr hint_14 = { ICE_FLOW_SEG_HDR_GTPU_EH, ETH_RSS_NONFRAG_IPV4_UDP}; struct rss_type_match_hdr hint_15 = { ICE_FLOW_SEG_HDR_GTPU_EH, ETH_RSS_NONFRAG_IPV4_TCP}; +struct rss_type_match_hdr hint_16 = { + ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_IPV6}; +struct rss_type_match_hdr hint_17 = { + ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_NONFRAG_IPV6_UDP}; +struct rss_type_match_hdr hint_18 = { + ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_NONFRAG_IPV6_TCP}; +struct rss_type_match_hdr hint_19 = { + ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_NONFRAG_IPV6_SCTP}; +struct rss_type_match_hdr hint_20 = { + ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_ETH | ETH_RSS_PPPOE}; /* Supported pattern for os default package. */ static struct ice_pattern_match_item ice_hash_pattern_list_os[] = { @@ -140,6 +150,11 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = { {pattern_eth_pppoes_ipv4_udp, ICE_INSET_NONE, &hint_11}, {pattern_eth_pppoes_ipv4_tcp, ICE_INSET_NONE, &hint_12}, {pattern_eth_pppoes_ipv4_sctp, ICE_INSET_NONE, &hint_13}, + {pattern_eth_pppoes_ipv6, ICE_INSET_NONE, &hint_16}, + {pattern_eth_pppoes_ipv6_udp, ICE_INSET_NONE, &hint_17}, + {pattern_eth_pppoes_ipv6_tcp, ICE_INSET_NONE, &hint_18}, + {pattern_eth_pppoes_ipv6_sctp, ICE_INSET_NONE, &hint_19}, + {pattern_eth_pppoes, ICE_INSET_NONE, &hint_20}, }; /** @@ -207,6 +222,9 @@ struct ice_hash_match_type ice_hash_type_list[] = { {ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)}, {ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT)}, {ETH_RSS_NONFRAG_IPV6_SCTP, ICE_HASH_SCTP_IPV6}, + {ETH_RSS_ETH | ETH_RSS_L2_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_SA)}, + {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)}, }; static struct ice_flow_engine ice_hash_engine = { @@ -325,6 +343,13 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item, RTE_FLOW_ERROR_TYPE_ACTION, action, "Not supported flow"); + if ((rss_hf & ETH_RSS_ETH) && (rss_hf & ~ETH_RSS_PPPOE)) + m->eth_rss_hint = ETH_RSS_ETH; + else if ((rss_hf & ETH_RSS_PPPOE) && (rss_hf & ~ETH_RSS_ETH)) + m->eth_rss_hint = ETH_RSS_PPPOE; + else if ((rss_hf & ETH_RSS_ETH) && (rss_hf & ETH_RSS_PPPOE)) + m->eth_rss_hint = ETH_RSS_ETH | ETH_RSS_PPPOE; + /* Check if rss types match pattern. */ if (rss->func != RTE_ETH_HASH_FUNCTION_SIMPLE_XOR) { if (((rss_hf & ETH_RSS_IPV4) != m->eth_rss_hint) && @@ -334,7 +359,11 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item, ((rss_hf & ETH_RSS_IPV6) != m->eth_rss_hint) && ((rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) != m->eth_rss_hint) && ((rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) != m->eth_rss_hint) && - ((rss_hf & ETH_RSS_NONFRAG_IPV6_SCTP) != m->eth_rss_hint)) + ((rss_hf & ETH_RSS_NONFRAG_IPV6_SCTP) != m->eth_rss_hint) && + ((rss_hf & ETH_RSS_ETH) != m->eth_rss_hint) && + ((rss_hf & ETH_RSS_PPPOE) != m->eth_rss_hint) && + (((rss_hf & (ETH_RSS_ETH | ETH_RSS_PPPOE)) != + m->eth_rss_hint))) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, action, "Not supported RSS types"); diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index a49242bcd..631b146bd 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -521,7 +521,7 @@ struct rte_eth_rss_conf { #define ETH_RSS_AH (1ULL << 28) #define ETH_RSS_L2TPV3 (1ULL << 29) #define ETH_RSS_PFCP (1ULL << 30) - +#define ETH_RSS_PPPOE (1ULL << 31) /* * We use the following macros to combine with above ETH_RSS_* for