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 3F0C4A034F; Wed, 6 May 2020 18:04:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C04BC1D9C3; Wed, 6 May 2020 18:04:32 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150089.outbound.protection.outlook.com [40.107.15.89]) by dpdk.org (Postfix) with ESMTP id 133FE1D9C1 for ; Wed, 6 May 2020 18:04:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mPsShjv5xb1fh0bIwxd0+SEgqpXOjeCWsETZWwpJWFxipu9hBY1R960IBo6MdTDAfFRux7KZkGmAxx/VgKDkupg4w9aKGJtazrX/7MZ87p9iaB+WXK9CZWYvQhAthrLkIcLUjfJVWAVDph4Ep0pa23AIs1LyGSrrvUS32cvE6+IAtB5leui1PPtZtccGkzuczxgucDzqosapS6QsG/MAwWTmj6cptNiKAqj/Z2lev+rphqL6dMloK+a/fvNZbmavXRnqox/zaa5sIor46XJBl6CsbQ41SQ7C7Q64iP93P9Z0oeNrQ1cBp1L4dOsd152zZezTN/EDBp1NFjP89Rrj9A== 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=JzdA+xYgcn4wn31PomfTKSjBGZhFTj/NTQsqHI3INbI=; b=gt698GasG4fil319YvskwcCXU0Fv3armMsrTh+qL9GqTpM8TxINHBBhOsPpyG8x8K54JEHp+e0/JWnChQ2zGe5koo65muNSitTII/m3P7MC5pzJ/zGHfVYLKQNLwz7biE7N24TSeXGu5n8l6eDG9+0yksumbMVNgaIwyfUyc4xRcTKWLumZQIuYknP4MCLl23N2hCStTYJlBJqER4rgV9PC00ObLjEev3RYveTkfbriNbHuLfQeg044y33x09dQFiyeKGj4ZS5xtZIYuCWwwYw9Efty5lDAOVsWiI2IFLnU+X4k+/qFDf+TOiso9OW+mu2XEnruC08Vtb5kvZt2TaA== 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=JzdA+xYgcn4wn31PomfTKSjBGZhFTj/NTQsqHI3INbI=; b=XgBBHxyPFWDBCkgCir6pJA5wyi6eEHU8GUAW06ioHuawelkxwRp2Aal72vOxGWtvOTkh9G9MqcJRRty/m7LJoK99mcHMRGMOIx0PVdjwrhJcC4W87ldm2HA/O0RzQMr5/WWnmqI4PHLAaZmHJDcbfobtKlTRq8ZoGKJMFrZlbuk= 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 AM6PR05MB6568.eurprd05.prod.outlook.com (2603:10a6:20b:73::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Wed, 6 May 2020 16:04:29 +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 16:04:29 +0000 Date: Thu, 7 May 2020 00:04:05 +0800 From: Xiaoyu Min To: Ferruh Yigit Cc: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , dev@dpdk.org Message-ID: <20200506160405.muh4g4lagbocqirj@mellanox.com> References: <127483b3dbf4840a80c6177a6230d1f3e8f40fb2.1588251701.git.jackmin@mellanox.com> <8a562aef-6d7b-4713-7fb9-e4da12d6bf56@intel.com> <20200506025247.psjk3deaitbwa6pd@mellanox.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-ClientProxiedBy: HK2PR04CA0090.apcprd04.prod.outlook.com (2603:1096:202:15::34) 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 HK2PR04CA0090.apcprd04.prod.outlook.com (2603:1096:202:15::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Wed, 6 May 2020 16:04:20 +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: 020ca1e9-f45b-4575-0387-08d7f1d727ea X-MS-TrafficTypeDiagnostic: AM6PR05MB6568: 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: KJ4RMDRe0jl5vK7b1ID1/4TN/12GCCElOEjNSFYXIrFT27NsO/h/D4x/pqtyCci6rSyF1QJmMC3Om8EpGt+6WV0kr1ygMUxC88EpV2+wWTiKQdE+QzqZT/cZEOb0Jlob4DRzwkHDRK+9ZPop5gRb61TcPD7Ygoa45/cbbcs5xzggmWxf+mpNvx/n8MSaUNqUsZd9UMH0w4WjBBRigE1CEl4/+r3x9V5QHO7XI5OMx2ylk8GlxbFM3x+tiohuxpE6KKvkFD9G5p9+N1Okv+cne4AUSf10ofnOdCsrVX2XKWgm7rBRsBV0Ui2pZ+z8EkVvKD386JCZOeKVJNPBmdb+60UxJN0vDg2S2CctS2CkEfbpId9QTkhM0dvaw9FIZIZgHTyqil3lZ5tEADbcxsXrY16OWalNnaP2HGb3wJTY47lKVTLt8easAviM4/8l3TqMIGAR3ta0uu8ExDipigBZMNpAruSMvIg4XXglwPsj+NWr8HyQnjwfCZqfOKJDZX6AHfHVnzxqLR2RRHUra+vc8A== 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)(396003)(136003)(346002)(39860400002)(376002)(366004)(33430700001)(86362001)(4326008)(186003)(16526019)(2906002)(478600001)(8676002)(54906003)(53546011)(1076003)(6916009)(66476007)(66556008)(6666004)(55016002)(66946007)(33440700001)(8886007)(36756003)(7696005)(316002)(5660300002)(8936002)(2616005)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: VbJR02ea6gyeSUttuF3g/g1BNs2/taO4tDrEA4EGko8ODwTFH3lCLaO/472j/CzJJA2+VqiV5jZPvOAoa/Y1NqSwQ7EhE/uJF4xoj0RaZycT9yEAswVvkmXCLv9bMzW9rSZzFtVoRe4hPSxHAUIT3LGT+gpJkcRnvoBrAMaEh5S6r86rJJppVV6qdB7Bq4I2lVU9ziAU0/kLglzn1ePS07Kr3/asb2xE9LHxCWe4B2MV+yxlNdHmvlI9LSES/40Is0skOG6iJA91c1kvOY3hWJCbBISwYJLeFIa9eOOJwvijFIIpCld3t2fCueYXIYSenIfwrux24qH5xNGu6Xt4fajfwefmPOS4hsHFYWow1p7dg6DwWnyTv0JQGKVyLB0Q7FNnaZLjFFjc7kYQg66n6WHWQvqAF+ic1PwCcOyfGVupsYEvpfANsklX1/h7fp0yjXFtA35hgZ6edU8WSDYQI8ZE/+cDs0uMl0SV6gveg8cWI/RzCSX0aP0hKPPzuG4yPj+po8rGavgb13zQMjTrb3Z0aS7rHhW4P/H/Yh72pYUUK7U1PwAbkjJ2HaKGxFCGvJaXl4CjpZSULzkYKh5fGfx0dPTX+APPLvbxsWosVjB9fdMDP3yMv53tZdWV5AeXDCvevGeurnYRL22mGsnUbyzSRr/wBMUVnXpm9jL7L52ePMu8ktc2qt1UDQ4iT72eIiRHmLwsb/SIN8V73vMArh/mMbyZUdBepV8oEo359eDT3GrQxKF7/LpFM88+Ocy4BlGwHTuztPCi7BE6MYVRXoZRvk7h/MhDUAfJocO28SDSEVRQ6Vt0jBaAWZDdpiMS7vBiFomhjE1UVtIhPKQid1RSxMpulTQHxQopce/ISCY= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 020ca1e9-f45b-4575-0387-08d7f1d727ea X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 16:04:29.6439 (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: s6PRZxFCCoxDaM3wcuq3fnMrzr8hOER0vCp/iOBJ8uVeQjFXmZ9IbbrowbEOb9ddpfDy28n17M50qTXO//oSVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6568 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 Wed, 20-05-06, 10:36, Ferruh Yigit wrote: > On 5/6/2020 3:52 AM, Xiaoyu Min wrote: > > 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? > > Yes. > > > > >> > >>> } > >>> > >>> #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. > > Here all variables looks an enum, 'mq_mode' type is enum, 'rx_mq_mode' is enum > and 'ETH_MQ_RX_RSS' is enum item. With which type it is mixed with? > > I didn't run coverity for it, if it is giving warning OK to keep them, but can > you please double check with coverity scan? > As you asked, I double checked with coverity by removing the enum cast. The coverity has the below warning [1] but this time the warning is supressed by filter(I guess it's newly added). It seems coverity doesn't allow the bitwise operators(?) Anyhow I prefer to keep the cast this time since it's already there. What do you think? [1]: [2020-05-06T10:31:01.899Z] Detected 1 defect occurrence that passes the filter criteria. [2020-05-06T10:31:01.899Z] There are 267 suppressed defects due to filters. [2020-05-06T10:31:01.900Z] [2020-05-06T10:31:01.900Z] app/test-pmd/testpmd.c:3345: CID 154009 (#1 of 1): [2020-05-06T10:31:01.901Z] Type: Parse warning (PW.MIXED_ENUM_TYPE) [2020-05-06T10:31:01.901Z] Classification: Unclassified [2020-05-06T10:31:01.901Z] Severity: Unspecified [2020-05-06T10:31:01.902Z] Action: Undecided [2020-05-06T10:31:01.902Z] Owner: Unassigned [2020-05-06T10:31:01.903Z] Defect only exists locally. [2020-05-06T10:31:01.903Z] app/test-pmd/testpmd.c:3345: [2020-05-06T10:31:01.903Z] 1. mixed_enum_type: enumerated type mixed with another 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 > >>> > >> >