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 1AB52A04B1; Thu, 17 Sep 2020 04:08:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C082B1D447; Thu, 17 Sep 2020 04:08:22 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C10901D446 for ; Thu, 17 Sep 2020 04:08:16 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08H24hkW013205; Wed, 16 Sep 2020 19:08:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=K9bwma+ucelW8mU87rp1izr3KlqCWM3XAW7s/klZHfQ=; b=TBhwFSoQM0n7jQEzwWr9LyxhGKfRyd7QUmmsqhFalnBqUZT3QeWCJwZ/nDuxFjOPnhqD sLW6LJek+kGsXthj4wxLRWDTtwzV013xFxQg/BoqoSq1R3skzvnGfAnTWehG+FyYcbui 9ogXD8oaOei2EvOp1QHBEEyS3iPK6zTkk1bbu7LgOpcA1gPQI9e9WJ/YuFQ3n6Hz/Vwr DvVTNAA5+ci5E+R9zufCs3pKOH3XZwpG2m0fu2Td5FNyreACq0nXEqTZuCi+mXJKHatu R3nIHsQURsaMG4VImMPhnhiGJbnfVViWzYhm4i8QvXYaSrl8WzwWZ8AYC/RcStdRD6rN BA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 33k5njnbtd-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2020 19:08:12 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Sep 2020 19:08:11 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Sep 2020 19:08:10 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 16 Sep 2020 19:08:10 -0700 Received: from localhost.localdomain (unknown [10.28.34.15]) by maili.marvell.com (Postfix) with ESMTP id A11C63F703F; Wed, 16 Sep 2020 19:07:58 -0700 (PDT) From: To: Wenzhuo Lu , Beilei Xing , Bernard Iremonger CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Kiran Kumar K Date: Thu, 17 Sep 2020 07:37:34 +0530 Message-ID: <20200917020735.2195069-2-kirankumark@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200917020735.2195069-1-kirankumark@marvell.com> References: <20200901032708.58247-1-kirankumark@marvell.com> <20200917020735.2195069-1-kirankumark@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-17_02:2020-09-16, 2020-09-17 signatures=0 Subject: [dpdk-dev] [PATCH v8 2/3] app/testpmd: support ethdev rss level config 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: Kiran Kumar K Adding support to set RSS level from ethdev config. level-default will requests the default behavior. level-outer will requests RSS to be performed on the outermost packet encapsulation level. level-inner will request RSS to be performed on the specified inner packet encapsulation level, from outermost to innermost. Signed-off-by: Kiran Kumar K --- app/test-pmd/cmdline.c | 17 ++++++++++++++--- app/test-pmd/parameters.c | 14 +++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 0a6ed85f3..db6263026 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -794,7 +794,8 @@ static void cmd_help_long_parsed(void *parsed_result, "receive buffers available.\n\n" "port config all rss (all|default|ip|tcp|udp|sctp|" - "ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|)\n" + "ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|level-default|" + "level-outer|level-inner|)\n" " Set the RSS mode.\n\n" "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" @@ -2334,7 +2335,16 @@ cmd_config_rss_parsed(void *parsed_result, rss_conf.rss_hf = ETH_RSS_GTPU; else if (!strcmp(res->value, "none")) rss_conf.rss_hf = 0; - else if (!strcmp(res->value, "default")) + else if (!strcmp(res->value, "level-default")) { + rss_hf &= (~ETH_RSS_LEVEL_MASK); + rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_PMD_DEFAULT); + } else if (!strcmp(res->value, "level-outer")) { + rss_hf &= (~ETH_RSS_LEVEL_MASK); + rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_OUTERMOST); + } else if (!strcmp(res->value, "level-inner")) { + rss_hf &= (~ETH_RSS_LEVEL_MASK); + rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNERMOST); + } else if (!strcmp(res->value, "default")) use_default = 1; else if (isdigit(res->value[0]) && atoi(res->value) > 0 && atoi(res->value) < 64) @@ -2393,7 +2403,8 @@ cmdline_parse_inst_t cmd_config_rss = { .data = NULL, .help_str = "port config all rss " "all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|" - "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|none|", + "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|none|level-default|" + "level-outer|level-inner|", .tokens = { (void *)&cmd_config_rss_port, (void *)&cmd_config_rss_keyword, diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 7cb0e3d6e..34a793945 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -66,9 +66,9 @@ usage(char* progname) "--tx-ip=SRC,DST | --tx-udp=PORT | " #endif "--pkt-filter-mode= |" - "--rss-ip | --rss-udp | " - "--rxpt= | --rxht= | --rxwt= | --rxfreet= | " - "--txpt= | --txht= | --txwt= | --txfreet= | " + "--rss-ip | --rss-udp | --rss-level-inner | --rss-level-outer |" + "--rxpt= | --rxht= | --rxwt= |" + " --rxfreet= | --txpt= | --txht= | --txwt= | --txfreet= | " "--txrst= | --tx-offloads= | | --rx-offloads= | " "--vxlan-gpe-port= ]\n", progname); @@ -151,6 +151,8 @@ usage(char* progname) "swap L2,L3,L4 for MAC, IPv4/IPv6 and TCP/UDP only.\n"); printf(" --rss-ip: set RSS functions to IPv4/IPv6 only .\n"); printf(" --rss-udp: set RSS functions to IPv4/IPv6 + UDP.\n"); + printf(" --rss-level-inner: set RSS hash level to innermost\n"); + printf(" --rss-level-outer: set RSS hash level to outermost\n"); printf(" --rxq=N: set the number of RX queues per port to N.\n"); printf(" --rxd=N: set the number of descriptors in RX rings to N.\n"); printf(" --txq=N: set the number of TX queues per port to N.\n"); @@ -632,6 +634,8 @@ launch_args_parse(int argc, char** argv) { "forward-mode", 1, 0, 0 }, { "rss-ip", 0, 0, 0 }, { "rss-udp", 0, 0, 0 }, + { "rss-level-outer", 0, 0, 0 }, + { "rss-level-inner", 0, 0, 0 }, { "rxq", 1, 0, 0 }, { "txq", 1, 0, 0 }, { "rxd", 1, 0, 0 }, @@ -1051,6 +1055,10 @@ launch_args_parse(int argc, char** argv) rss_hf = ETH_RSS_IP; if (!strcmp(lgopts[opt_idx].name, "rss-udp")) rss_hf = ETH_RSS_UDP; + if (!strcmp(lgopts[opt_idx].name, "rss-level-inner")) + rss_hf |= ETH_RSS_LEVEL_INNERMOST; + if (!strcmp(lgopts[opt_idx].name, "rss-level-outer")) + rss_hf |= ETH_RSS_LEVEL_OUTERMOST; if (!strcmp(lgopts[opt_idx].name, "rxq")) { n = atoi(optarg); if (n >= 0 && check_nb_rxq((queueid_t)n) == 0) -- 2.25.1