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 3F908A0352; Wed, 6 May 2020 04:53:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A41C91BF8F; Wed, 6 May 2020 04:53:19 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2088.outbound.protection.outlook.com [40.107.21.88]) by dpdk.org (Postfix) with ESMTP id DFF424C7A for ; Wed, 6 May 2020 04:53:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=keDbN9iKA48alFs/gu5fV/hjN3W//PJZyR0WjMV0k0e401Ir3id4NC0v91CnCxqPwP3Bx+uNV1xp+l8Tarxm5vp0UJDDBKJ/vMrvmFp02uq94LAb05X+ndPxLdWEUsWaEwdJu17E4w2SpGkRzWtMOgQ1+63WawaSSZofnwhOlwlU+hKLXnAGePcL6kJqrgNebiRAYs72rLQUPuCDtTwiAb/9KEaiu9YlxqujShBG0DdLLvxzg8QUemXVASGIJ7wSmZ1f0fV7iRleJXjx5ifGixzDSxsWgclKkgErDYPKXeggUJR8F4pYlWMTDjp5GdoYcigL04BwnxzAm3ShPrkD3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jY20I+Y2qBveEcrx1L6fnaI0/oxrYB4tNMJCHB51q1Q=; b=KpjXz5LmZEVUirX/6mLET4NamcNVpZvkm8zDWGqxgFEIL+hkPmeI2Ee36/LF7hXdDzcay9f72k8NC5Efks5UGlCgIKRjEHhbDYzLCxKKxcHbKYZmUPnCgdedybPHniY7xPSTDiJCeohq7c3MpgOJaYLSLBkJLXK7G65aGSEKmmjzm+xNGI/M4uiyqsR/bIQc3wowi8DyaB0hHKPb7pmH134A31IlmdBl8G76VkS3GARrAcd9cB5DZtnRRe/G1Q+nenjzMp7t8k7jMB18jN5LHlen86mtGfhRX/LpSUKhuZVkk4gAMQpRzy+OxpoyMVDudf03QKuhHap3Dto/nQgRKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jY20I+Y2qBveEcrx1L6fnaI0/oxrYB4tNMJCHB51q1Q=; b=CA0Ey78S/OC9a7JsIb2RygPnnwnWbDtByEwFf5ZfGSQl0G1EBVblQ/K7BcHWtNUqJyry+stbXxNFwx/4l8kT/p/kp7B8J86j5f4iVYbOYlshxD2xIe258+CM/C4NuGry29Lz5jh6fN0YycMNvgRILT2RBVW59tnzyiQdR70om24= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; Received: from AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) by AM6PR05MB4822.eurprd05.prod.outlook.com (2603:10a6:20b:b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Wed, 6 May 2020 02:53:16 +0000 Received: from AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::5513:b664:af25:6551]) by AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::5513:b664:af25:6551%5]) with mapi id 15.20.2958.030; Wed, 6 May 2020 02:53:16 +0000 Date: Wed, 6 May 2020 10:52:47 +0800 From: Xiaoyu Min To: Ferruh Yigit Cc: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , dev@dpdk.org Message-ID: <20200506025247.psjk3deaitbwa6pd@mellanox.com> References: <127483b3dbf4840a80c6177a6230d1f3e8f40fb2.1588251701.git.jackmin@mellanox.com> <8a562aef-6d7b-4713-7fb9-e4da12d6bf56@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a562aef-6d7b-4713-7fb9-e4da12d6bf56@intel.com> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: HK2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:202:16::13) To AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (2408:8025:34d:a20:1447:fc6f:8c68:ff25) by HK2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:202:16::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Wed, 6 May 2020 02:53:04 +0000 X-Originating-IP: [2408:8025:34d:a20:1447:fc6f:8c68:ff25] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 52d4a499-8a8f-4d2f-5718-08d7f1689db2 X-MS-TrafficTypeDiagnostic: AM6PR05MB4822: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6x4cVvhd+Y7T3hFskTDyti6+rXc9bnsO6Kqg9iDzQ9uKxR1Gk5geDoQAwNYMnM+VbR1kQF/72Biah48nVUTl9jI7LUJNr5ncVOpLhCjG6+qLd45X5iUKfj3lBmJRQY/1jcJo2Qltk4dNtFpHuN/chu7yn7aVLT3kHjXqWyFeq7CcbeJQ1N9XLgUit5HNJ1iIBeg3sZjkpDPyxKxjrvZE6EObbI3cnQ7xo8nJBBWdgQI3UsAgs2RoCun4gIvMEN8M8Y0gBteGMNz9oEgxucdWg+x4ycPNNBwm9OPGeN+1fL1HOwbvmC+bEgeRG7gaUrJ5nuJxN7J4b1mdpqb8uX/Zus1V0+w20XEYyIyEuErvPC7v/VW4WGbU61P3iU6rbcmGzrYOhBsx9gN8Lu/iQ1ftD8Un7LKK/S4uV4CPEzIv+2Qtr+UhSbuD/itrcj+ST6h8mOqPzZE0g0OuCSvdaLIwyX6Ky5nfY7QNVaeSSerY29Jd8GDpVSkxmLBPPIDDRYtELHkCKJHIe31g/L5uWtDOsA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB6567.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(366004)(396003)(136003)(346002)(376002)(33430700001)(8886007)(8936002)(36756003)(7696005)(52116002)(55016002)(8676002)(6666004)(1076003)(66946007)(66556008)(33440700001)(66476007)(86362001)(316002)(16526019)(2906002)(4326008)(2616005)(478600001)(5660300002)(186003)(54906003)(6916009)(53546011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: eGxj+/WjL/GpXY9RorEzUCh8E7jAmRFL/b5T4/DRUPRl6M0RDtAA5w7vEQ7La3dXwniZFZCLb9efXpBp/Y+Dhb7Pvn/2kOPuYmRFDJpeMQx6vJyzIIkBEeU0majzH9FNlK1Mxg9QvRUaGBG137mc4zPWq45J7iXYRLtm2LJM5Q2hNwtkYTqFxQuYgzETs9lAq1CVpihdSiZlbF/mNt66f+y0KFvCw2T1SX/0GNWf82N4tVWleta3205NWd52IK/+2m9VY+seCfNATtcYL/oHaRie9+BJb3TuXGvx9BhqiRk0cdn0j1OdoeKBApmij2KuEO3RXWVHo0f9r42fjtMcBRCL6lQudBqO5tjW8LhwlpM3wfIsR+jy+nHFibcTctdKbjnPNNuXrzS6kyUVVXf4D4xTbrmdXUigpHdcexb333MqaTMszjITvCJJENeWpiBlTpaB2BFavytkgSNIdy0ItxfqVO2AjpzR4HjvPbgR0o05kd3k7NjpF8kj2EhP9iWHhCm3w1A3bU+A8RlNRm6dQsA9pMs69+jFdMCzhMcU4rZJDWHyC/QUMrQ9Rzgrn8E6S+0j9koK2eeL7ACb7v+XwYroVMbz5qNJA8+yQDuxM75Xq5Lc05SKanPCYi3sgaJR6mHivITgLp0AH6EPlN7r8ZNKtz3WebUwD3QWpGPIODiB1GwY+cBY0abyuGTUoPlXkROKK2SXy9Mviffd5/3bOCxlHluH0x8ql5n6htM9p6dhQT72EitBYtxm40T+WmGBKBkwHxMCSBQMru/VUf0QSt7TLzWHRm8WCmHH7voQidvOq+9q+CPZqlDVBmGxHfNP4yC7nB/2PWTu3jAnjv/9q+B32JMQv8i5TDrTonyy0Go= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52d4a499-8a8f-4d2f-5718-08d7f1689db2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 02:53:16.1025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nbFGgTlKX+vYTHiuUzKVxt00xecCRwjEnuN2b9QAHUwl9vNyypx5RnW1qXKY0RjtjlL8FoJpFIRg3Ry3eGc7/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4822 Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: add cmdline option to set Rx mq mode 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" On Tue, 20-05-05, 17:06, Ferruh Yigit wrote: > On 4/30/2020 2:07 PM, Xiaoyu Min wrote: > > One new cmdline option `--rx-mq-mode` is added in order to have the > > possibility to check whether PMD handle the mq mode correctly or not. > > > > The reason is some NICs need to do different settings based on different > > RX mq mode, i.e RSS or not. > > > > With this support in testpmd, the above scenario can be tested easily. > > > > Signed-off-by: Xiaoyu Min > > --- > > app/test-pmd/parameters.c | 12 ++++++++++++ > > app/test-pmd/testpmd.c | 17 ++++++++++++++--- > > app/test-pmd/testpmd.h | 3 +++ > > doc/guides/rel_notes/release_20_05.rst | 4 ++++ > > doc/guides/testpmd_app_ug/run_app.rst | 7 +++++++ > > 5 files changed, 40 insertions(+), 3 deletions(-) > > > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > > index 30c1753c32..a9dd58e96b 100644 > > --- a/app/test-pmd/parameters.c > > +++ b/app/test-pmd/parameters.c > > @@ -212,6 +212,7 @@ usage(char* progname) > > printf(" --noisy-lkup-num-writes=N: do N random reads and writes per packet\n"); > > printf(" --no-iova-contig: mempool memory can be IOVA non contiguous. " > > "valid only with --mp-alloc=anon\n"); > > + printf(" --rx-mq-mode=0xX: hexadecimal bitmask of RX mq mode\n"); > > Do you think does it worth to say the bitmask is for modes that can be enabled, > to remove need to look the code, not sure. So you mean something like: + printf(" --rx-mq-mode=0xX: hexadecimal bitmask of RX mq mode can be enabled\n"); Is it right? > > > } > > > > #ifdef RTE_LIBRTE_CMDLINE > > @@ -670,6 +671,7 @@ launch_args_parse(int argc, char** argv) > > { "noisy-lkup-num-reads", 1, 0, 0 }, > > { "noisy-lkup-num-reads-writes", 1, 0, 0 }, > > { "no-iova-contig", 0, 0, 0 }, > > + { "rx-mq-mode", 1, 0, 0 }, > > { 0, 0, 0, 0 }, > > }; > > > > @@ -1363,6 +1365,16 @@ launch_args_parse(int argc, char** argv) > > } > > if (!strcmp(lgopts[opt_idx].name, "no-iova-contig")) > > mempool_flags = MEMPOOL_F_NO_IOVA_CONTIG; > > + > > + if (!strcmp(lgopts[opt_idx].name, "rx-mq-mode")) { > > + char *end = NULL; > > + n = strtoul(optarg, &end, 16); > > + if (n >= 0) > > + rx_mq_mode = (enum rte_eth_rx_mq_mode)n; > > Should we check if the provided value, 'n', is not out of the enum range? OK, I'll add the check. > > > + else > > + rte_exit(EXIT_FAILURE, > > + "rx-mq-mode must be >= 0\n"); > > + } > > break; > > case 'h': > > usage(argv[0]); > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > > index 99bacddbfd..9536d6ee27 100644 > > --- a/app/test-pmd/testpmd.c > > +++ b/app/test-pmd/testpmd.c > > @@ -482,6 +482,11 @@ uint8_t bitrate_enabled; > > struct gro_status gro_ports[RTE_MAX_ETHPORTS]; > > uint8_t gro_flush_cycles = GRO_DEFAULT_FLUSH_CYCLES; > > > > +/* > > + * RX mq mode value set in the commandline > > This is not the "RX mq mode value", the above help string seems more accurate, > "hexadecimal bitmask of RX mq mode". Can you please update here? Sure, I'll update. > > > + */ > > +enum rte_eth_rx_mq_mode rx_mq_mode = ETH_MQ_RX_VMDQ_DCB_RSS; > > + > > /* Forward function declarations */ > > static void setup_attached_port(portid_t pi); > > static void map_port_queue_stats_mapping_registers(portid_t pi, > > @@ -3337,7 +3342,9 @@ init_port_config(void) > > > > if (port->dcb_flag == 0) { > > if( port->dev_conf.rx_adv_conf.rss_conf.rss_hf != 0) > > - port->dev_conf.rxmode.mq_mode = ETH_MQ_RX_RSS; > > + port->dev_conf.rxmode.mq_mode = > > + (enum rte_eth_rx_mq_mode) > > Do we need this enum type cast? Yes, we need this cast otherwise the coverity will complain about enum type mixed with other type. > > > + (rx_mq_mode & ETH_MQ_RX_RSS); > > else > > port->dev_conf.rxmode.mq_mode = ETH_MQ_RX_NONE; > > } > > @@ -3438,7 +3445,9 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, > > } > > > > /* set DCB mode of RX and TX of multiple queues */ > > - eth_conf->rxmode.mq_mode = ETH_MQ_RX_VMDQ_DCB; > > + eth_conf->rxmode.mq_mode = > > + (enum rte_eth_rx_mq_mode) > > + (rx_mq_mode & ETH_MQ_RX_VMDQ_DCB); > > eth_conf->txmode.mq_mode = ETH_MQ_TX_VMDQ_DCB; > > } else { > > struct rte_eth_dcb_rx_conf *rx_conf = > > @@ -3458,7 +3467,9 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, > > tx_conf->dcb_tc[i] = i % num_tcs; > > } > > > > - eth_conf->rxmode.mq_mode = ETH_MQ_RX_DCB_RSS; > > + eth_conf->rxmode.mq_mode = > > + (enum rte_eth_rx_mq_mode) > > + (rx_mq_mode & ETH_MQ_RX_DCB_RSS); > > eth_conf->rx_adv_conf.rss_conf = rss_conf; > > eth_conf->txmode.mq_mode = ETH_MQ_TX_DCB; > > } > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > > index 7ff4c5dba3..32bb324c94 100644 > > --- a/app/test-pmd/testpmd.h > > +++ b/app/test-pmd/testpmd.h > > @@ -602,6 +602,9 @@ struct mplsoudp_decap_conf { > > }; > > extern struct mplsoudp_decap_conf mplsoudp_decap_conf; > > > > +/* RX mq mode parameter. */ > > The variable name gives as much context as the comment, may it be dropped? OK, I'll dorp this comment. > > > +extern enum rte_eth_rx_mq_mode rx_mq_mode; > > + > > static inline unsigned int > > lcore_num(void) > > { > > diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst > > index b124c3f287..8026afb451 100644 > > --- a/doc/guides/rel_notes/release_20_05.rst > > +++ b/doc/guides/rel_notes/release_20_05.rst > > @@ -212,6 +212,10 @@ New Features > > * Added IPsec inbound load-distribution support for ipsec-secgw application > > using NIC load distribution feature(Flow Director). > > > > +* **Updated testpmd application.** > > + > > + * Added a new cmdline option ``--rx-mq-mode`` which can be used to test PMD's > > + behaviour on handling Rx mq mode. > > > > Removed Items > > ------------- > > diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst > > index 727ef52b8f..4f46299e68 100644 > > --- a/doc/guides/testpmd_app_ug/run_app.rst > > +++ b/doc/guides/testpmd_app_ug/run_app.rst > > @@ -481,3 +481,10 @@ The command line options are: > > > > Enable to create mempool which is not IOVA contiguous. Valid only with --mp-alloc=anon. > > The default value is 0. > > + > > +* ``--rx-mq-mode`` > > + > > + Set the hexadecimal bitmask of RX queue mq mode. > > It is good to expand the 'mq' at least in the documentation, and I guess it is > "multi queue". OK, I'll expand it. Thank you -Jack > > > + The default value is 0x7:: > > + > > + ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG | ETH_MQ_RX_VMDQ_FLAG > > >