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 725E6A00C2; Tue, 1 Nov 2022 15:14:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E5C240693; Tue, 1 Nov 2022 15:14:01 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 423A040223 for ; Tue, 1 Nov 2022 15:14:00 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A18fwrK019897; Tue, 1 Nov 2022 07:13:59 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3kk063gy5y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Nov 2022 07:13:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TWLCqYr9dgGz0+mFuc00AId2baHf6T3vSa8tNLQqYlFhat6/LFREbFnkbIUdCeB/TerhlUKsn2YSkrmuY5lFCfROXMLqh6VLkzR/PL5uthLo9WaHQrQzAmF42jaySUz3x/vziv7AE5wTaYVPTFtn/ry2VeDp/LqotpOJHjn8ebnLH8WCz39hMdosdRrwvTHIxv8IOlGyFAvs3NRIuog2xh+6TuE7z1gkBddnYkYa8OqnfPGCtlAmcua8V4klMX+lHfeT2vJUfzR88p/oK2vFof6fXzztwA68itJiEgNXpkm4pu8Ffdbu8SUN0jFJTaAPyZiwGRk5ES2EF6+xgrbb5w== 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=lNhBiOV2Qd9Fch/68aNAk2iXQU4hcQG3vIwVJe8SJ9A=; b=nJwfkASGSUgQ3Fd7cbPh6vU2HzjXCdH2HiLgS0MEv79wDvQfTkZbwaKk8vf1Ehth/IpDLVOqlfyJmvZpb0hnIz6W7wZocMp3145Fz5mjti2axx/TSJoyk6/Atx39kSpVlSRzA/JPO9I6ZEQ5esuujyOHhfQ0w7FsU26zWx71PzEOoz6XVHdzrl7P4i0nslxtvnUz7tT2mD322klXy30aMMjbjWbQ3RxuEWu8u9EFaiABJ4mkYszyuq6PNZALoaSzbTGrxC1Hs8sPM6JWmXhap069N0O44HwSRA11wLyZXy4v0MpOfMAoBrznnHklUgFa3oCbd9+MVnXnucKDJbY0fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lNhBiOV2Qd9Fch/68aNAk2iXQU4hcQG3vIwVJe8SJ9A=; b=UlRku5f9pfNBGEicCJ3YbAjOyRnNiCTLxuVwNGoP7c5fYFRG4ZsloOHLCQKyeIwKBpdDkyFGBnEfeiozaP4zb5e7SCk2oFOw2irRIRvzsQnGwCdDvNbu20ZvE6oIDno8kqam94W5PuEtDFg17ifvobU9vGtscWSLfMyJaNduKg8= Received: from PH0PR18MB4750.namprd18.prod.outlook.com (2603:10b6:510:cd::11) by SN7PR18MB3919.namprd18.prod.outlook.com (2603:10b6:806:f5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.16; Tue, 1 Nov 2022 14:13:56 +0000 Received: from PH0PR18MB4750.namprd18.prod.outlook.com ([fe80::67e6:e404:239e:117a]) by PH0PR18MB4750.namprd18.prod.outlook.com ([fe80::67e6:e404:239e:117a%7]) with mapi id 15.20.5769.021; Tue, 1 Nov 2022 14:13:56 +0000 From: Hanumanth Reddy Pothula To: Hanumanth Reddy Pothula , Aman Singh , Yuying Zhang CC: "dev@dpdk.org" , "andrew.rybchenko@oktetlabs.ru" , "thomas@monjalon.net" , Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram Subject: RE: [PATCH v11 1/1] app/testpmd: support multiple mbuf pools per Rx queue Thread-Topic: [PATCH v11 1/1] app/testpmd: support multiple mbuf pools per Rx queue Thread-Index: AQHY6BK8Sv7CQHZkEE2o61KhzPuTS64qJ/wA Date: Tue, 1 Nov 2022 14:13:56 +0000 Message-ID: References: <20221024040757.2012432-1-hpothula@marvell.com> <20221025014005.2054913-1-hpothula@marvell.com> In-Reply-To: <20221025014005.2054913-1-hpothula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB4750:EE_|SN7PR18MB3919:EE_ x-ms-office365-filtering-correlation-id: 0edab923-6a0b-443b-c56b-08dabc13504b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jwIgKmX7WKrAtSctW1f432enHqT6dqvOtgdA1HkUhib0SC52KKl8TRDEuh9g7coORUf21opFtz2ie9zgx82ra9t2E8W4gKf89WWfhvHPdYZn+a1nqVmm6jo5vH7GRjZiEyf4mHYg0tbVcSu9lZsaOjwWNZfYOs9BuARJXTiMcE9gcZhhZ6ois5S3mtVNHqZgUIhcKC99KY47kR/g//rUwrrbUAyah4+6K5fmMx6QZdzOU0zoqsAPrLD/wkLxzGHKsiIvXMYeTm9ZBqNMB3qU9NhENcMcthqEALiH+nSPVY8wCJMSHjnlV6XcROLT7/YKGIJrY4iUZwnJlHHtJA9T5nOF7bXW9/4gwdT0QFue1W1bfLrnKlfGLDi/S6JyqzP3qpXnQbF61x+3jqY3JY0IZdCWfD8ZJn3Qs7ZbCLR7csh1x9fSzRt7dwm73T1F+5uoUHvd5m/9+gtpb08Nm5B6oknraE6dHgeygSPIHB98yqf6zX0LsxDiAK6hFnflQwyWDIUclEjdGycEQ7YXJKHlRkBKbnTkQwcLpiACOtSK4e3HVyCKNYUKgAv5fqJ5QRJuwV+t+CYXLZ4GiI8pQnTIMnyYvWYHW9Ubr1iBGdmd+6CxfFSBais5DfyFdBS64oOc3LONTzVkqkUlYLsOTPpXZuk0R/21WP4CVV7AKJmHgua91dwb+UpxzQkDtWHenpoGC6z6gKg1doDfpwC0CCnMDMVVQClbxgIuQOqF1go/yea8Xwo9jVIKD0+iIwiZWVCz x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4750.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(451199015)(76116006)(38070700005)(86362001)(2906002)(5660300002)(66446008)(66946007)(66556008)(52536014)(38100700002)(122000001)(83380400001)(66476007)(186003)(64756008)(33656002)(53546011)(26005)(9686003)(6506007)(107886003)(110136005)(478600001)(7696005)(316002)(71200400001)(54906003)(55016003)(8676002)(4326008)(8936002)(41300700001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S4W1/Z6/lHJSYXVp6tDIBgzZV4dk7bWeKyHH6+I6HVyPvWlR4BGeYvDL66Gg?= =?us-ascii?Q?/FnPsrrcPF7c+4zk/fEYo/Hq+oXNIeKHpFnbgn0qRUnpDN/3VYuAejZ9fshe?= =?us-ascii?Q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ihy0CxuCT+H5/IE8p2?= =?us-ascii?Q?qBD2AwvmChs2B0bu3sdAugVtaYmuqGmnwRFC55ujge0HyEEHXW7nQWyW39bD?= =?us-ascii?Q?eLxRVl2xYE5e6pKd3WmthiCWmUbS/IwgcocMs8TjczZ8fovhQzhycSbeOZNb?= =?us-ascii?Q?SN0EpsGscxKtn1wknZMI83mAVMQwGDfElP7D7/7aLEh8RmHUTLxLYe9tJgvY?= =?us-ascii?Q?yD+Dq16r84N9qhmEFO7J5t2ol+Cyi3Jknzus2NkmpQRAFvNl+7eQ249Dsupa?= =?us-ascii?Q?9bhYd6vXVNroN3lkc0x0hxc8c1LUzzcCLrIXPtRxr8gk5jarXsB+HADGhoSz?= =?us-ascii?Q?Bv5H0wcM8Ev4XJTcwdNtLD4b8wGB09laHZ7wfUDU372RlAOvUXrOddQgmR9P?= =?us-ascii?Q?C/h8+BizJsPGSRrywVdEGLGpO+z5JB33iV1uHXLuWPQzr0ZsmEhJfcSLQOPv?= =?us-ascii?Q?pqS8NsFrzGeUTg1ns/ye1j9rvXmm2iT+BQc6FQF70518mKFUh+6FjyoxcU4m?= =?us-ascii?Q?dlX/F0MeTe6zThWJi+apxhulK0Iqu4+eGtJvy2yxL5zrvKEo+GutzFT1fVSq?= =?us-ascii?Q?o9lgDTksJZzEqivFqo48uR4n98jrmVEvXwlIznXk?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4750.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0edab923-6a0b-443b-c56b-08dabc13504b X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2022 14:13:56.3733 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1s356f8vYEXD3yKMy+aRT6tA0JdAh/u+UkqPN7Lli2L6wM5h0Dc5LLoN+QtEs4EDuH5cUswsc67PtgJ3EGjB2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR18MB3919 X-Proofpoint-GUID: WjTfINQ2BwQIjQXs6FMniRgaww-Q1KY_ X-Proofpoint-ORIG-GUID: WjTfINQ2BwQIjQXs6FMniRgaww-Q1KY_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-01_07,2022-11-01_02,2022-06-22_01 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 Ping > -----Original Message----- > From: Hanumanth Pothula > Sent: Tuesday, October 25, 2022 7:10 AM > To: Aman Singh ; Yuying Zhang > > Cc: dev@dpdk.org; andrew.rybchenko@oktetlabs.ru; thomas@monjalon.net; > Jerin Jacob Kollanukkaran ; Nithin Kumar Dabilpuram > ; Hanumanth Reddy Pothula > > Subject: [PATCH v11 1/1] app/testpmd: support multiple mbuf pools per Rx > queue >=20 > Some of the HW has support for choosing memory pools based on the packet'= s > size. The pool sort capability allows PMD/NIC to choose a memory pool bas= ed > on the packet's length. >=20 > On multiple mempool support enabled, populate mempool array accordingly. > Also, print pool name on which packet is received. >=20 > Signed-off-by: Hanumanth Pothula > v11: > - Resolve compilation and warning. > v10: > - Populate multi-mempool array based on mbuf_data_size_n instead > of rx_pkt_nb_segs. > --- > app/test-pmd/testpmd.c | 63 +++++++++++++++++++++++++++--------------- > app/test-pmd/testpmd.h | 3 ++ > app/test-pmd/util.c | 4 +-- > 3 files changed, 45 insertions(+), 25 deletions(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 5b0f0838dc..62f7c9dba8 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2647,11 +2647,18 @@ rx_queue_setup(uint16_t port_id, uint16_t > rx_queue_id, > struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) { > union rte_eth_rxseg rx_useg[MAX_SEGS_BUFFER_SPLIT] =3D {}; > + struct rte_mempool *rx_mempool[MAX_MEMPOOL] =3D {}; > + struct rte_mempool *mpx; > unsigned int i, mp_n; > int ret; >=20 > - if (rx_pkt_nb_segs <=3D 1 || > - (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) =3D=3D 0) { > + /* 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) !=3D 0))) { > rx_conf->rx_seg =3D NULL; > rx_conf->rx_nseg =3D 0; > ret =3D rte_eth_rx_queue_setup(port_id, rx_queue_id, @@ - > 2659,29 +2666,39 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id= , > rx_conf, mp); > goto exit; > } > - for (i =3D 0; i < rx_pkt_nb_segs; i++) { > - struct rte_eth_rxseg_split *rx_seg =3D &rx_useg[i].split; > - struct rte_mempool *mpx; > - /* > - * Use last valid pool for the segments with number > - * exceeding the pool index. > - */ > - mp_n =3D (i >=3D mbuf_data_size_n) ? mbuf_data_size_n - 1 : i; > - mpx =3D mbuf_pool_find(socket_id, mp_n); > - /* Handle zero as mbuf data buffer size. */ > - rx_seg->offset =3D i < rx_pkt_nb_offs ? > - rx_pkt_seg_offsets[i] : 0; > - rx_seg->mp =3D mpx ? mpx : mp; > - if (rx_pkt_hdr_protos[i] !=3D 0 && rx_pkt_seg_lengths[i] =3D=3D 0) { > - rx_seg->proto_hdr =3D rx_pkt_hdr_protos[i]; > - } else { > - rx_seg->length =3D rx_pkt_seg_lengths[i] ? > - rx_pkt_seg_lengths[i] : > - mbuf_data_size[mp_n]; > + if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) { > + for (i =3D 0; i < rx_pkt_nb_segs; i++) { > + struct rte_eth_rxseg_split *rx_seg =3D &rx_useg[i].split; > + /* > + * Use last valid pool for the segments with number > + * exceeding the pool index. > + */ > + mp_n =3D (i > mbuf_data_size_n) ? mbuf_data_size_n - 1 : > i; > + mpx =3D mbuf_pool_find(socket_id, mp_n); > + if (rx_conf->offloads & > RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) { > + /** > + * On Segment length zero, update length as, > + * buffer size - headroom size > + * to make sure enough space is accomidate for > header. > + */ > + rx_seg->length =3D rx_pkt_seg_lengths[i] ? > + rx_pkt_seg_lengths[i] : > + mbuf_data_size[mp_n] - > RTE_PKTMBUF_HEADROOM; > + rx_seg->offset =3D i < rx_pkt_nb_offs ? > + rx_pkt_seg_offsets[i] : 0; > + rx_seg->mp =3D mpx ? mpx : mp; > + } > + } > + rx_conf->rx_nseg =3D rx_pkt_nb_segs; > + rx_conf->rx_seg =3D rx_useg; > + } else { > + for (i =3D 0; i < mbuf_data_size_n; i++) { > + mpx =3D mbuf_pool_find(socket_id, i); > + rx_mempool[i] =3D mpx ? mpx : mp; > } > + rx_conf->rx_mempools =3D rx_mempool; > + rx_conf->rx_nmempool =3D mbuf_data_size_n; > } > - rx_conf->rx_nseg =3D rx_pkt_nb_segs; > - rx_conf->rx_seg =3D rx_useg; > ret =3D rte_eth_rx_queue_setup(port_id, rx_queue_id, nb_rx_desc, > socket_id, rx_conf, NULL); > rx_conf->rx_seg =3D NULL; > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > e65be323b8..14be10dcef 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -80,6 +80,9 @@ extern uint8_t cl_quit; >=20 > #define MIN_TOTAL_NUM_MBUFS 1024 >=20 > +/* Maximum number of pools supported per Rx queue */ #define > +MAX_MEMPOOL 8 > + > typedef uint8_t lcoreid_t; > typedef uint16_t portid_t; > typedef uint16_t queueid_t; > diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index > fd98e8b51d..f9df5f69ef 100644 > --- a/app/test-pmd/util.c > +++ b/app/test-pmd/util.c > @@ -150,8 +150,8 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, > struct rte_mbuf *pkts[], > print_ether_addr(" - dst=3D", ð_hdr->dst_addr, > print_buf, buf_size, &cur_len); > MKDUMPSTR(print_buf, buf_size, cur_len, > - " - type=3D0x%04x - length=3D%u - nb_segs=3D%d", > - eth_type, (unsigned int) mb->pkt_len, > + " - pool=3D%s - type=3D0x%04x - length=3D%u - > nb_segs=3D%d", > + mb->pool->name, eth_type, (unsigned int) mb- > >pkt_len, > (int)mb->nb_segs); > ol_flags =3D mb->ol_flags; > if (ol_flags & RTE_MBUF_F_RX_RSS_HASH) { > -- > 2.25.1