From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 00DF6A0566; Mon, 21 Nov 2022 19:05:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 982E642D18; Mon, 21 Nov 2022 19:05:30 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2085.outbound.protection.outlook.com [40.107.223.85]) by mails.dpdk.org (Postfix) with ESMTP id B9E5042C76 for ; Mon, 21 Nov 2022 19:05:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fmlqJOc2a9fUgfpwWGWMsGeSCMvnRwypIdNvT+Edk8fElzupj9i6e7cq6IvNR3M4m740tETWEMU078AXdzIDR5Pscln+UPuqjfjyR0ZOGbQsjTZlaPaeWpRzEWtq/8qQ8BZ6twUSZvXbc+IAZeS0wGP/VqXgMtYnhrIdBv3UTbHZxhMi69vz5o8JiD0xjgnMSZQcSu1z+780SkT3vCuP++QxZjmIaMyH+UmAC+hAO5190HYkcZUc3ze8OJns/zqusRoGdeWJTgRgbYGI2yZXNPQq/OH1IgRSdbfdYJx83gvpETUiBFraL2RG64bQzBOqa8AWNnDZ/t0RAx9sfhUeCA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3leRK3uWQV1Uxt1tTOqb0Mg0UAxamTzJ3YMa7iI3SgY=; b=HTy3AS4VugnimHPjPxULWLyEjWrI5Av7eYFsbyKbf1goxUrr3cXxAHol5aeMYGHA/ogBeV1smW7RO5uJIlmzX8kTe1mYDtXVqMRWN0fjRQjUNwHSLmqZ0+/ZdSySEU4sC9AEU7eaJQSulY5D/uqD8wgWCkGSvr6+YuNdzpHJRwUobS6+3URJHGMEbZlHZVm7CNhCOSzdwO8uZs9mSWdWTEIf3AS1VeL7f85SHINut+z0btfz/OAlTbUQ4oYyQwQI/BJg1LkUd1GvuzRNlkYPlalYRrZfDjY4vixR3xdB6QKh5r9wEh2LitMvGmcqazcO/610WHtn1o16ZdtS3saCog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3leRK3uWQV1Uxt1tTOqb0Mg0UAxamTzJ3YMa7iI3SgY=; b=Fd7wjHwk6I8lZ15eFEp072b9p29YS9MaoWpmklTL0FzLjJ1VzbHkeoME5eQCGP/froXbRrw+LTv6ThIuQTFBNLvUs25JCRbwhALWqbmem5UBdD7+jLCwRf0pho/bJSmqdVWkXz76Q25t5uoltMYHi+9BEv3B4W9ODbxNIbnI80s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SA0PR12MB7091.namprd12.prod.outlook.com (2603:10b6:806:2d5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Mon, 21 Nov 2022 18:05:27 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842%9]) with mapi id 15.20.5834.015; Mon, 21 Nov 2022 18:05:27 +0000 Message-ID: Date: Mon, 21 Nov 2022 18:05:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [EXT] Re: [PATCH v6 1/1] app/testpmd: add valid check to verify multi mempool feature Content-Language: en-US To: Hanumanth Reddy Pothula , Aman Singh , Yuying Zhang Cc: "dev@dpdk.org" , "andrew.rybchenko@oktetlabs.ru" , "thomas@monjalon.net" , "yux.jiang@intel.com" , Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram References: <20221121124546.3920722-1-hpothula@marvell.com> <20221121143347.3923255-1-hpothula@marvell.com> <6696ea9a-442b-a10b-0ce9-dee07d5bacb2@amd.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0365.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18e::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA0PR12MB7091:EE_ X-MS-Office365-Filtering-Correlation-Id: bc674793-7ffb-419e-9da5-08dacbeaf827 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5z/1yuakdLLjuu1/lzirombLa8zl/xW85nDwOZu4m+J7SfyyaCiwt/NUOXvtYG1NHoSdPajWwyPpnNBvC9BDtke7AwbVBAmcKHC2FiUbn3sFh4S4uRRlbJ1jK9qpA/tsCmpRHVUP1ilUsL9xUCDNrzbjI6/sjPhMeBIrPZxPKlO4je7IHOwQmCZkSJd9i2t1LlgriHKcESU7o1xcUDE/s+14QyWMW5Pb/+5FTvfgiDuOyaLHSblfq42WeuY4n/vkWIsiYKATYILpFpe3qVSL5gRxCcm7vE/2jQ3+NrDlGl7L8A2cOGjMQu22JZCmTBYRtJuwf9Bx9xf2uBy6lklYuO0mbH/a/X4LwQM/gn0fEdDwAXkedgFW6pSWrTEFo5WHIdDWNd/CFrtmgFmdawVFwog5AiH/QjXJjcrgZpJviTIuQcxThKYdJO9KW5zNmtZn2QDLHDDNkkZX6E7JJSLPJwnHBAlue+OQgpwA7bL5Q21CQ5dZu8EK18GDlyscKezariCJ+yt7Tsd6jRmeAp6IxeRrFgCbJMwO/BKL2j5pgDxtdBPeDoWuiUrYIwDFRIpAl1f8q52YmoiSr7DdBtMl3ro01vhTYog2AVnoPXM4DdgGo7v7Bi6PfZ1uD940wFGTvUyE4Fz4CsXxr5QIVXQ063H9DDjnHBWKhHSUQISowrranwZ4UoNL/zjP2j/A5OdQwfWNGPqSyvcGnnU4gxLrRhoIMGhECqsuu26HSmSpNMc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(366004)(39860400002)(346002)(136003)(451199015)(478600001)(8936002)(186003)(41300700001)(2616005)(6486002)(31686004)(6506007)(15650500001)(54906003)(38100700002)(110136005)(6512007)(316002)(83380400001)(6666004)(53546011)(26005)(66476007)(5660300002)(8676002)(4326008)(66946007)(86362001)(31696002)(36756003)(44832011)(66556008)(2906002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TzcxNUFqQXlTelVYSUVnRGZ5Zkp4OXUwN09VbnpmZXFFejRFUEtPbzNTRnZE?= =?utf-8?B?ZW1JRUR1WUIxRXVUMEZzT3B6TCtIWmo2WC8yWDZub0RSaU83eCtTb0YvUC9I?= =?utf-8?B?RzBzZGJJQnJlaW5xVDA4cUtpZDRmM2dXUStuWXpHSk45Rmo0L3lzcGNlMzFO?= =?utf-8?B?cWtFUkVNdjlwbW95RFFGdlI0U1laK3VmVUdrSDdZQ1BlaUxtd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UZVWXM4YzI2RE9PQXNMVjFHU3V4NTVMOE8xQVNRYTlu?= =?utf-8?B?WGljUWx1WG12SWFrNkFVcGplNmlDbFY5TXBpQWF2QWVPaGFDMG5CcWFYellx?= =?utf-8?Q?/UNMI/xKCKZPC8SACIKv/uOo/?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc674793-7ffb-419e-9da5-08dacbeaf827 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 18:05:27.4810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3e6bcLzYCb251si5dEBbqd6rDkUL+EN+vZy1CxJTUCrmEEOp2msqozEVkkgpf5uN X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7091 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 11/21/2022 5:45 PM, Hanumanth Reddy Pothula wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Monday, November 21, 2022 11:02 PM >> To: Hanumanth Reddy Pothula ; Aman Singh >> ; Yuying Zhang >> Cc: dev@dpdk.org; andrew.rybchenko@oktetlabs.ru; >> thomas@monjalon.net; yux.jiang@intel.com; Jerin Jacob Kollanukkaran >> ; Nithin Kumar Dabilpuram >> >> Subject: [EXT] Re: [PATCH v6 1/1] app/testpmd: add valid check to verify >> multi mempool feature >> >> External Email >> >> ---------------------------------------------------------------------- >> On 11/21/2022 2:33 PM, Hanumanth Pothula wrote: >>> Validate ethdev parameter 'max_rx_mempools' to know whether device >>> supports multi-mempool feature or not. >>> >> >> Validation 'max_rx_mempools' is not main purpose of this patch, I would >> move below paragraph up. >> >>> Also, add new testpmd command line argument, multi-mempool, to >> control >>> multi-mempool feature. By default its disabled. >>> >>> Bugzilla ID: 1128 >>> Fixes: 4f04edcda769 ("app/testpmd: support multiple mbuf pools per Rx >>> queue") >>> >>> Signed-off-by: Hanumanth Pothula >>> >>> --- >>> v6: >>> - Updated run_app.rst file with multi-mempool argument. >>> - defined and populated multi_mempool at related arguments. >>> - invoking rte_eth_dev_info_get() withing multi-mempool condition >>> v5: >>> - Added testpmd argument to enable multi-mempool feature. >>> - Simplified logic to distinguish between multi-mempool, >>> multi-segment and single pool/segment. >>> v4: >>> - updated if condition. >>> v3: >>> - Simplified conditional check. >>> - Corrected spell, whether. >>> v2: >>> - Rebased on tip of next-net/main. >>> --- >>> app/test-pmd/parameters.c | 4 ++ >>> app/test-pmd/testpmd.c | 66 +++++++++++++++++---------- >>> app/test-pmd/testpmd.h | 1 + >>> doc/guides/testpmd_app_ug/run_app.rst | 4 ++ >>> 4 files changed, 50 insertions(+), 25 deletions(-) >>> >>> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c >>> index aed4cdcb84..d0f7b2f11d 100644 >>> --- a/app/test-pmd/parameters.c >>> +++ b/app/test-pmd/parameters.c >>> @@ -155,6 +155,7 @@ usage(char* progname) >>> printf(" --rxhdrs=eth[,ipv4]*: set RX segment protocol to split.\n"); >>> printf(" --txpkts=X[,Y]*: set TX segment sizes" >>> " or total packet length.\n"); >>> + printf(" --multi-mempool: enable multi-mempool support\n"); >> >> Indentation is wrong, one space is missing. >> >> Can you also update the '--mbuf-size=' definition, it has: >> " ... extra memory pools will be created for allocating mbufs to receive >> packets with buffer splitting features.", Now it is for both "buffer splitting >> and multi Rx mempool features." >> Even it can be possible to reference to new argument. > Sure, will update. >> >>> printf(" --txonly-multi-flow: generate multiple flows in txonly >> mode\n"); >>> printf(" --tx-ip=src,dst: IP addresses in Tx-only mode\n"); >>> printf(" --tx-udp=src[,dst]: UDP ports in Tx-only mode\n"); @@ >>> -669,6 +670,7 @@ launch_args_parse(int argc, char** argv) >>> { "rxpkts", 1, 0, 0 }, >>> { "rxhdrs", 1, 0, 0 }, >>> { "txpkts", 1, 0, 0 }, >>> + { "multi-mempool", 0, 0, 0 }, >> >> Thinking twice, I am not sure about the 'multi-mempool' name, because >> 'mbuf-size' already cause to create multiple mempool, 'multi-mempool' >> can be confusing. >> As ethdev variable name is 'max_rx_mempools', what do you think to use >> 'multi-rx-mempools' here as argument? > > Yes, 'multi-rx-mempools' looks clean. > >> >>> { "txonly-multi-flow", 0, 0, 0 }, >>> { "rxq-share", 2, 0, 0 }, >>> { "eth-link-speed", 1, 0, 0 }, >>> @@ -1295,6 +1297,8 @@ launch_args_parse(int argc, char** argv) >>> else >>> rte_exit(EXIT_FAILURE, "bad >> txpkts\n"); >>> } >>> + if (!strcmp(lgopts[opt_idx].name, "multi- >> mempool")) >>> + multi_mempool = 1; >>> if (!strcmp(lgopts[opt_idx].name, "txonly-multi- >> flow")) >>> txonly_multi_flow = 1; >>> if (!strcmp(lgopts[opt_idx].name, "rxq-share")) { diff >> --git >>> a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index >>> 4e25f77c6a..0bf2e4bd0d 100644 >>> --- a/app/test-pmd/testpmd.c >>> +++ b/app/test-pmd/testpmd.c >>> @@ -245,6 +245,7 @@ uint32_t max_rx_pkt_len; >>> */ >>> uint16_t rx_pkt_seg_lengths[MAX_SEGS_BUFFER_SPLIT]; >>> uint8_t rx_pkt_nb_segs; /**< Number of segments to split */ >>> +uint8_t multi_mempool; /**< Enables multi-mempool feature */ >>> uint16_t rx_pkt_seg_offsets[MAX_SEGS_BUFFER_SPLIT]; >>> uint8_t rx_pkt_nb_offs; /**< Number of specified offsets */ >>> uint32_t rx_pkt_hdr_protos[MAX_SEGS_BUFFER_SPLIT]; >>> @@ -258,6 +259,8 @@ uint16_t >> tx_pkt_seg_lengths[RTE_MAX_SEGS_PER_PKT] >>> = { }; uint8_t tx_pkt_nb_segs = 1; /**< Number of segments in >>> TXONLY packets */ >>> >>> + >>> + >> >> Unintendend change. > > Ack >> >>> enum tx_pkt_split tx_pkt_split = TX_PKT_SPLIT_OFF; /**< Split policy >>> for packets to TX. */ >>> >>> @@ -2659,24 +2662,9 @@ rx_queue_setup(uint16_t port_id, uint16_t >> rx_queue_id, >>> uint32_t prev_hdrs = 0; >>> int ret; >>> >>> - /* Verify Rx queue configuration is single pool and segment or >>> - * multiple pool/segment. >>> - * @see rte_eth_rxconf::rx_mempools >>> - * @see rte_eth_rxconf::rx_seg >>> - */ >>> - if (!(mbuf_data_size_n > 1) && !(rx_pkt_nb_segs > 1 || >>> - ((rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) != >> 0))) { >>> - /* Single pool/segment configuration */ >>> - rx_conf->rx_seg = NULL; >>> - rx_conf->rx_nseg = 0; >>> - ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, >>> - nb_rx_desc, socket_id, >>> - rx_conf, mp); >>> - goto exit; >>> - } >>> >>> - if (rx_pkt_nb_segs > 1 || >>> - rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) { >>> + if ((rx_pkt_nb_segs > 1) && >>> + (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT)) { >>> /* multi-segment configuration */ >>> for (i = 0; i < rx_pkt_nb_segs; i++) { >>> struct rte_eth_rxseg_split *rx_seg = >> &rx_useg[i].split; @@ >>> -2701,22 +2689,50 @@ rx_queue_setup(uint16_t port_id, uint16_t >> rx_queue_id, >>> } >>> rx_conf->rx_nseg = rx_pkt_nb_segs; >>> rx_conf->rx_seg = rx_useg; >>> - } else { >>> + rx_conf->rx_mempools = NULL; >>> + rx_conf->rx_nmempool = 0; >>> + ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, >> nb_rx_desc, >>> + socket_id, rx_conf, NULL); >>> + rx_conf->rx_seg = NULL; >>> + rx_conf->rx_nseg = 0; >>> + } else if (multi_mempool == 1) { >>> /* multi-pool configuration */ >>> + struct rte_eth_dev_info dev_info; >>> + >>> + if (mbuf_data_size_n <= 1) { >>> + RTE_LOG(ERR, EAL, "invalid number of mempools >> %u", >>> + mbuf_data_size_n); >>> + return -EINVAL; >>> + } >>> + ret = rte_eth_dev_info_get(port_id, &dev_info); >>> + if (ret != 0) >>> + return ret; >>> + if (dev_info.max_rx_mempools == 0) { >>> + RTE_LOG(ERR, EAL, "device doesn't support >> requested multi-mempool configuration"); >>> + return -ENOTSUP; >>> + } >>> for (i = 0; i < mbuf_data_size_n; i++) { >>> mpx = mbuf_pool_find(socket_id, i); >>> rx_mempool[i] = mpx ? mpx : mp; >>> } >>> rx_conf->rx_mempools = rx_mempool; >>> rx_conf->rx_nmempool = mbuf_data_size_n; >>> - } >>> - ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, nb_rx_desc, >>> + rx_conf->rx_seg = NULL; >>> + rx_conf->rx_nseg = 0; >>> + ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, >> nb_rx_desc, >>> socket_id, rx_conf, NULL); >>> - rx_conf->rx_seg = NULL; >>> - rx_conf->rx_nseg = 0; >>> - rx_conf->rx_mempools = NULL; >>> - rx_conf->rx_nmempool = 0; >>> -exit: >>> + rx_conf->rx_mempools = NULL; >>> + rx_conf->rx_nmempool = 0; >>> + } else { >>> + /* Single pool/segment configuration */ >>> + rx_conf->rx_seg = NULL; >>> + rx_conf->rx_nseg = 0; >>> + rx_conf->rx_mempools = NULL; >>> + rx_conf->rx_nmempool = 0; >>> + ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, >> nb_rx_desc, >>> + socket_id, rx_conf, mp); >>> + } >>> + >> >> Technically execution can reach to this point without taking any of the >> braches above, in that case there should be an error here instead of silently >> continue. >> >> I think either there should be a check here, not sure how to do, or single >> mempool can be the default setup out of the 'else' block. What do you >> think? >> > Yes, default case(final else) is going to be single pool/segment. I think there is no need of error return. > > This function(rx_queue_setup()) returns return of rte_eth_rx_queue_setup(). > ack >>> ports[port_id].rxq[rx_queue_id].state = rx_conf->rx_deferred_start >> ? >>> >> RTE_ETH_QUEUE_STATE_STOPPED : >>> >> RTE_ETH_QUEUE_STATE_STARTED; >>> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index >>> aaf69c349a..e4f9b142c9 100644 >>> --- a/app/test-pmd/testpmd.h >>> +++ b/app/test-pmd/testpmd.h >>> @@ -589,6 +589,7 @@ extern uint32_t max_rx_pkt_len; extern >> uint32_t >>> rx_pkt_hdr_protos[MAX_SEGS_BUFFER_SPLIT]; >>> extern uint16_t rx_pkt_seg_lengths[MAX_SEGS_BUFFER_SPLIT]; >>> extern uint8_t rx_pkt_nb_segs; /**< Number of segments to split */ >>> +extern uint8_t multi_mempool; /**< Enables multi-mempool feature. >> */ >>> extern uint16_t rx_pkt_seg_offsets[MAX_SEGS_BUFFER_SPLIT]; >>> extern uint8_t rx_pkt_nb_offs; /**< Number of specified offsets */ >>> >>> diff --git a/doc/guides/testpmd_app_ug/run_app.rst >>> b/doc/guides/testpmd_app_ug/run_app.rst >>> index 610e442924..329570e721 100644 >>> --- a/doc/guides/testpmd_app_ug/run_app.rst >>> +++ b/doc/guides/testpmd_app_ug/run_app.rst >>> @@ -365,6 +365,10 @@ The command line options are: >>> Set TX segment sizes or total packet length. Valid for ``tx-only`` >>> and ``flowgen`` forwarding modes. >>> >>> +* ``--multi-mempool`` >>> + >>> + Enable multi-mempool, multiple mbuf pools per Rx queue, support. >>> + >>> * ``--txonly-multi-flow`` >>> >>> Generate multiple flows in txonly mode. >