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 1358EA00C2; Thu, 6 Oct 2022 20:16:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AAE2240DDC; Thu, 6 Oct 2022 20:16:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 61F6940042 for ; Thu, 6 Oct 2022 20:16:14 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2969IdRB006908; Thu, 6 Oct 2022 11:14:06 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3k1v9at2aw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Oct 2022 11:14:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzPaTmNopdnMcNo/XpTDdS4TQBJptIPTlH9MIdAIdX3WZS3k5WLxFiDB+VXeyC9W4GUE0Nrii64GJrnwtKUVL1acxtyNowFd57heiTNL2Ft8uplse5/+FtzCiLgaKxVW2vn3kxcRsnnI3N7x16qKQeoFW7Jkw+dfZOD9ioKyQPj4Gy3/jfEr6iButrsLIbwVe91C95r0IQ8xx7UUF9JI3JzCGcIJ5D1+1nj/fLBn0EyOb9F79GbivcA8y1ErWfqiXEJTO3jMFQvdbw+55F4S7dlp0Ad9vOWYq4FgluMEWRnsAfmuLDN/dtpNgIhiS9rEsSirHY5knCw5UK/hSoAbvg== 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=fqqd5iYiDyfKCxxrrBwmU6kjCQTcJBRyoyq3cKQUWU8=; b=V+MWMxg/jd3Euzjv7+QwsO3QRL1PoUgNh3Z8AnNfInfMYrnoJUnT1FvDS9ndqKIA9EbFlRnQrkeoEkjvriU/wf8QOUPWIpnUdXlcynG9KFhN9wYvA3vN3qncRUVXdwjAWO9ynB9WPcA28xVyDAS+FaUCKll7GmIWx8SVsvHrMlX0u1n1RweCOP1SntODoihnJ/cxExU17e9P4SM890yLMTdO1BK/ylQ6ERtS3OHASx/RYGmH7xQo0ikrAZCdmGmR91c9wngz6VeiqxWQdzCaSOlMjh96Mn9W91f4N3W+826m9ucOF8M7L1UZejzyl9cjOh99z1pxUIMAhnGF8ImxWg== 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=fqqd5iYiDyfKCxxrrBwmU6kjCQTcJBRyoyq3cKQUWU8=; b=kyTPaOPJvah22rcyHQbA6WP17tCUyScQ0MoV8aZpkuwhDxWnExZBU0rUZJZudM16Jsgy+BrtdYFwhf7FP6sTIyAtVc/DmeMIpQEhl8dxzXqvIPHDvmazphGKqlejprrPArtidXvpkBsvx0w2J0Qz98OPoaO9uzjntlCClHeCC/I= Received: from PH0PR18MB4750.namprd18.prod.outlook.com (2603:10b6:510:cd::11) by SA1PR18MB4679.namprd18.prod.outlook.com (2603:10b6:806:1d6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.36; Thu, 6 Oct 2022 18:14:03 +0000 Received: from PH0PR18MB4750.namprd18.prod.outlook.com ([fe80::39e8:cd18:6afd:f292]) by PH0PR18MB4750.namprd18.prod.outlook.com ([fe80::39e8:cd18:6afd:f292%4]) with mapi id 15.20.5676.031; Thu, 6 Oct 2022 18:14:03 +0000 From: Hanumanth Reddy Pothula To: Hanumanth Reddy Pothula , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: "dev@dpdk.org" , "xuan.ding@intel.com" , "xiaoyun.li@intel.com" , "stephen@networkplumber.org" , "yuanx.wang@intel.com" , "mdr@ashroe.eu" , "yuying.zhang@intel.com" , "qi.z.zhang@intel.com" , "viacheslavo@nvidia.com" , Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram Subject: RE: [PATCH v6 1/3] ethdev: support mulitiple mbuf pools per Rx queue Thread-Topic: [PATCH v6 1/3] ethdev: support mulitiple mbuf pools per Rx queue Thread-Index: AQHY2aykU9IibosjLkCJdiAJIGDgz64BpiJw Date: Thu, 6 Oct 2022 18:14:03 +0000 Message-ID: References: <20221006170126.1322852-1-hpothula@marvell.com> <20221006175355.1327673-1-hpothula@marvell.com> In-Reply-To: <20221006175355.1327673-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_|SA1PR18MB4679:EE_ x-ms-office365-filtering-correlation-id: abb1a900-5ef0-4c6d-7b42-08daa7c68d0d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JdfRJ105xbCQCqc8tu4CM6Cz9ZUnWK2/XbR9+r4An+TxOuHuc1yFlUYns5MhgfVnxScPShMLsG5+vkRta1PHqlmKH2yrTFIYCH6rpbTf9HM3GV9Cwjkf/yFnoxEqEJ73qE+FmIffvtwA4E40MRq9JgeSu423KqsTKA0CWLi4wkGF5QeL56jEDSqjYXOchmQGLEiLi5S6xinO1nl7OB8hWLKvGkcUqEtRvyv5uovPpz3pMZ3WsJGp7MI4tHBCrLgNV0laFQRDdSYvaT085skbylHMaNYA5+5Uwxp1OpKzs0ebSPjL8s9jFcyAx+hjOUuzBcRn7Xaa+39Z+W3d7SOwP7+ce6bXMG7dp3V0zy1re+JFOlcY06HcYoMOMDDXqVZclCQh71I3rXO+RWyPuSdx2t+qr7hK6BjXS/ycufAJ4Dvlc+GiGYdkMtFLEcI96ZhEvPuzpkPG/0t6GGNmBI50H6s5MPs+1HX/g5hergXOJaLM21+Ny7m+y3SNafKvh8LmoO0hCpYxYJg7gszyDq3/BfNeSiijyOCFBZcXeGolKagoHZYVPO/tT+YlFqhHcQK805zObZrSGNcbp+s7c8aGvdVf0THu5XMZAwVakj4Lar6aS9xu2z361tQ2TXgo/ez6qxdbrTqHScXvDVK0tIZRZKGGIjv6vpfYM4e1qvnYRq02GTb78FSNqN16XgbCjy3EoakXsG9/tLCTnTNN5VQ9bZPXB1AI1sNmb8G7vnhehe/n9kJOa/V87o3jxPi6HQ/1 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)(39860400002)(366004)(136003)(376002)(346002)(396003)(451199015)(38100700002)(122000001)(86362001)(55016003)(33656002)(38070700005)(316002)(66556008)(54906003)(71200400001)(110136005)(8936002)(66446008)(52536014)(5660300002)(7416002)(8676002)(4326008)(76116006)(66946007)(41300700001)(2906002)(66476007)(64756008)(186003)(83380400001)(107886003)(6506007)(478600001)(53546011)(7696005)(9686003)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?M2wjEIwtVcrldaq1hDSfNz4FlcZAweOTSIhWJk+BFPTHFYpLPpN3bdq6txz2?= =?us-ascii?Q?6rvGlYIg70B5ZXAMxRM+V5bLzpvnzMFw9NUhunS6GYt17dJT/XS5y4ZvYTCX?= =?us-ascii?Q?CjucNfkkBEx0bXANcBNVQ3D+7GoJ93dtpL1GeZAsuD9agV005CLbUJqDv+bT?= =?us-ascii?Q?GXFnMns08RZ/EERBkap7AIOxmkp/B+48/B8oPVAnvJIiR8CSJBRPC1ZUsIOz?= =?us-ascii?Q?8KHSubBXF1j3A7Dl7dZA1zttbNpMBaEFH+JKzuifi09wpaoMs6TX2JL4QLzJ?= =?us-ascii?Q?Xryxceej1iHgD9avneYKsoEf1pc3ZfCpKXZW0AlFsZJFYRmvxLlrq9kWpnhm?= =?us-ascii?Q?BXPxyF01+1lYlWKJY3ncyBrVBi2X7r3IPwi+tCvjBMWXzcrahysJUlOUdGb9?= =?us-ascii?Q?AFs3ZX4Lqnlg5A7SdMdt3aB3spGYr2yOXBBt+C6s0Tyj6hv8inRCAgKdm995?= =?us-ascii?Q?3/jNUhiVl8xWWjQg4bcYRVai91He4kZoe50KXeLf+Jahh+2ntK62E2hpjB1O?= =?us-ascii?Q?uRW8jvrEKhUMjMWnhhGkK3PDB2GaXDZPbfpRiMgqZbHFMiJ3qbVAvUW6sy8i?= =?us-ascii?Q?jgmMD45FoOQio5jJubagDzeOdLEzdNyNlqBuVixt2Lt1eJ5slRO0ADgrRN8y?= =?us-ascii?Q?+cZziMp8XLLWuRI1hkYq0o5CJWs41VSMxbLuLvAHtfB47DXsoy0Ddkp5p5vX?= =?us-ascii?Q?R5Ui44VtcquTJvkHDuXbHBo31rtSozk+RmwC33BuvszDzv0y1FxxSHp25OEJ?= =?us-ascii?Q?siVWPWxjVZT1lCFr6UqCyPQkrbACg5Vte8c9rdwsssAWuTXh9QseKzkYtIKs?= =?us-ascii?Q?jzU59ouMPTiJ3yS61TL+LBFMcAzXF84p9WMRcgdkHyP2WXpNeyEOQlVgJ8Lv?= =?us-ascii?Q?yE8vwvf0eivbmh0vEnS3KsYuZGDtAZt6vI/4odnRoSsT0+TxIuU9JFvtdyve?= =?us-ascii?Q?x14Jw/fyZc4GKuUMSOXfucO7Rh8fLDuGuVP+y0rFxIRdAqT/i/SRLWYZ19hX?= =?us-ascii?Q?2VyJt2D4tfMoiOOudKYvFozaY3oi4h5VbCPgXpVTG4m8Ws/MaQtCFqUtKwZN?= =?us-ascii?Q?XqCdyBRDk3pLQegLzNRgG/jPASFqogppYLTWTVG3GobW/Omi/1XI4Qh7KAU+?= =?us-ascii?Q?6aAXriUvoVpYhl/wx9goY33gR8YVJPvWtNi+Ae+Jf83ueY1/GxqIT9LBF1so?= =?us-ascii?Q?wT2MDru3Kky7CkuEX0ecWUPKpH6fxBiVTDQt5R3jSjOMrdBBN5ankypRWw1D?= =?us-ascii?Q?1qXMmxdNo9wmZ1XSkBfSJxkMmf8rkNAmQAD+1X4veLuS//SUNQ7+5UU5xQ/u?= =?us-ascii?Q?FXMxINfN5nI0G/Lv7I7q40O7g2RaCPNlA728WhydwUPt0wKMnkdsISp2ReX0?= =?us-ascii?Q?qxYAA8Z2DOaktpaic+LCh4j7iRykgq19O0Hh8stY6ZIHnLqwP81dx1iea8h2?= =?us-ascii?Q?Bfh/sh7D9QJWfX6U2fBl2BuUyiOBH+4fvEnkVpyH6IrNf9NjBK0tRjBgf15l?= =?us-ascii?Q?ScLBAhJr37ROFxD/P2W64v3qpRM68/71CYZS1bFqzqQyQbUOQfnaTAJIZ2Hf?= =?us-ascii?Q?xEHmcAoVVwrwE4BFUhUZC7+wGYolG49M0HTAVMCF?= 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: abb1a900-5ef0-4c6d-7b42-08daa7c68d0d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Oct 2022 18:14:03.7855 (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: jcY2EsYGyplw/QqOjh8o9Oat2BzXFwS5WJluh9r+uy/uOl27Kg9VzlptJ1Uv0gyM2pjYvasDpFaTl9W+gumIIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR18MB4679 X-Proofpoint-GUID: -9buFYcwO56aA5EiQw3QBWuk-7IwIb3c X-Proofpoint-ORIG-GUID: -9buFYcwO56aA5EiQw3QBWuk-7IwIb3c X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-06_04,2022-10-06_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 Hello Andrew/Thomas/Ferruh, Thank You for your comments. I have taken care and uploaded new patch-set. As tomorrow is RC1 release. Could you please help in reviewing the changes = and in merging the changes, if changes looks good. Regards, Hanumanth=20 > -----Original Message----- > From: Hanumanth Pothula > Sent: Thursday, October 6, 2022 11:24 PM > To: Thomas Monjalon ; Ferruh Yigit > ; Andrew Rybchenko > > Cc: dev@dpdk.org; xuan.ding@intel.com; wenxuanx.wu@intel.com; > xiaoyun.li@intel.com; stephen@networkplumber.org; yuanx.wang@intel.com; > mdr@ashroe.eu; yuying.zhang@intel.com; qi.z.zhang@intel.com; > viacheslavo@nvidia.com; Jerin Jacob Kollanukkaran ; > Nithin Kumar Dabilpuram ; Hanumanth Reddy > Pothula > Subject: [PATCH v6 1/3] ethdev: support mulitiple mbuf pools per Rx queue >=20 > This patch adds support for multiple mempool capability. > Some of the HW has support for choosing memory pools based on the packet'= s > size. The capability allows PMD to choose a memory pool based on the pack= et's > length. >=20 > This is often useful for saving the memory where the application can crea= te a > different pool to steer the specific size of the packet, thus enabling ef= fective use > of memory. >=20 > For example, let's say HW has a capability of three pools, > - pool-1 size is 2K > - pool-2 size is > 2K and < 4K > - pool-3 size is > 4K > Here, > pool-1 can accommodate packets with sizes < 2K > pool-2 can accommodate packets with sizes > 2K and < 4K > pool-3 can accommodate packets with sizes > 4K >=20 > With multiple mempool capability enabled in SW, an application may create > three pools of different sizes and send them to PMD. Allowing PMD to prog= ram > HW based on the packet lengths. So that packets with less than 2K are rec= eived > on pool-1, packets with lengths between 2K and 4K are received on pool-2 = and > finally packets greater than 4K are received on pool-3. >=20 > Signed-off-by: Hanumanth Pothula >=20 > v6: > - Updated release notes, release_22_11.rst. > v5: > - Declared memory pools as struct rte_mempool **rx_mempools rather than > as struct rte_mempool *mp. > - Added the feature in release notes. > - Updated conditions and strings as per review comments. > v4: > - Renamed Offload capability name from > RTE_ETH_RX_OFFLOAD_BUFFER_SORT > to RTE_ETH_RX_OFFLOAD_MUL_MEMPOOL. > - In struct rte_eth_rxconf, defined new pointer, which holds array of > type struct rte_eth_rx_mempool(memory pools). This array is used > by PMD to program multiple mempools. > v3: > - Implemented Pool Sort capability as new Rx offload capability, > RTE_ETH_RX_OFFLOAD_BUFFER_SORT. > v2: > - Along with spec changes, uploading testpmd and driver changes. > --- > doc/guides/rel_notes/release_22_11.rst | 6 +++ > lib/ethdev/rte_ethdev.c | 74 ++++++++++++++++++++++---- > lib/ethdev/rte_ethdev.h | 22 ++++++++ > 3 files changed, 92 insertions(+), 10 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_22_11.rst > b/doc/guides/rel_notes/release_22_11.rst > index 2e076ba2ad..8bb19155d9 100644 > --- a/doc/guides/rel_notes/release_22_11.rst > +++ b/doc/guides/rel_notes/release_22_11.rst > @@ -55,6 +55,12 @@ New Features > Also, make sure to start the actual text at the margin. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > +* ** Added support ethdev support for mulitiple mbuf pools per Rx > +queue.** > + > + * Added new Rx offload flag ``RTE_ETH_RX_OFFLOAD_MUL_MEMPOOL`` to > support > + mulitiple mbuf pools per Rx queue. Thisi capability allows PMD to ch= oose > + a memory pool based on the packet's length > + > * **Updated Wangxun ngbe driver.** >=20 > * Added support to set device link down/up. > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > 1979dc0850..eed4834e6b 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -1634,6 +1634,44 @@ rte_eth_dev_is_removed(uint16_t port_id) > return ret; > } >=20 > +static int > +rte_eth_rx_queue_check_mempool(struct rte_mempool **rx_mempool, > + uint16_t n_pool, uint32_t *mbp_buf_size, > + const struct rte_eth_dev_info *dev_info) { > + uint16_t pool_idx; > + > + if (n_pool > dev_info->max_pools) { > + RTE_ETHDEV_LOG(ERR, > + "Too many Rx mempools %u vs maximum %u\n", > + n_pool, dev_info->max_pools); > + return -EINVAL; > + } > + > + for (pool_idx =3D 0; pool_idx < n_pool; pool_idx++) { > + struct rte_mempool *mpl =3D rx_mempool[pool_idx]; > + > + if (mpl =3D=3D NULL) { > + RTE_ETHDEV_LOG(ERR, "null Rx mempool pointer\n"); > + return -EINVAL; > + } > + > + *mbp_buf_size =3D rte_pktmbuf_data_room_size(mpl); > + if (*mbp_buf_size < dev_info->min_rx_bufsize + > + RTE_PKTMBUF_HEADROOM) { > + RTE_ETHDEV_LOG(ERR, > + "%s mbuf_data_room_size %u < %u > (RTE_PKTMBUF_HEADROOM=3D%u + min_rx_bufsize(dev)=3D%u)\n", > + mpl->name, *mbp_buf_size, > + RTE_PKTMBUF_HEADROOM + > dev_info->min_rx_bufsize, > + RTE_PKTMBUF_HEADROOM, > + dev_info->min_rx_bufsize); > + return -EINVAL; > + } > + } > + > + return 0; > +} > + > static int > rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split *rx_seg, > uint16_t n_seg, uint32_t *mbp_buf_size, @@ - > 1733,9 +1771,12 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t > rx_queue_id, >=20 > if (mp !=3D NULL) { > /* Single pool configuration check. */ > - if (rx_conf !=3D NULL && rx_conf->rx_nseg !=3D 0) { > + if (((rx_conf->offloads & > RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) && > + rx_conf !=3D NULL && rx_conf->rx_nseg !=3D 0) || > + ((rx_conf->offloads & > RTE_ETH_RX_OFFLOAD_MUL_MEMPOOL) && > + rx_conf !=3D NULL && rx_conf->rx_npool !=3D 0)) { > RTE_ETHDEV_LOG(ERR, > - "Ambiguous segment configuration\n"); > + "Ambiguous Rx mempools > configuration\n"); > return -EINVAL; > } > /* > @@ -1763,30 +1804,43 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t > rx_queue_id, > dev_info.min_rx_bufsize); > return -EINVAL; > } > - } else { > + } else if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) { > const struct rte_eth_rxseg_split *rx_seg; > uint16_t n_seg; >=20 > /* Extended multi-segment configuration check. */ > if (rx_conf =3D=3D NULL || rx_conf->rx_seg =3D=3D NULL || rx_conf- > >rx_nseg =3D=3D 0) { > RTE_ETHDEV_LOG(ERR, > - "Memory pool is null and no extended > configuration provided\n"); > + "Memory pool is null and no multi-segment > configuration > +provided\n"); > return -EINVAL; > } >=20 > rx_seg =3D (const struct rte_eth_rxseg_split *)rx_conf->rx_seg; > n_seg =3D rx_conf->rx_nseg; >=20 > - if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) > { > - ret =3D rte_eth_rx_queue_check_split(rx_seg, n_seg, > + ret =3D rte_eth_rx_queue_check_split(rx_seg, n_seg, > &mbp_buf_size, > &dev_info); > - if (ret !=3D 0) > - return ret; > - } else { > - RTE_ETHDEV_LOG(ERR, "No Rx segmentation offload > configured\n"); > + if (ret !=3D 0) > + return ret; > + } else if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_MUL_MEMPOOL) > { > + /* Extended multi-pool configuration check. */ > + if (rx_conf =3D=3D NULL || rx_conf->rx_mempools =3D=3D NULL || > rx_conf->rx_npool =3D=3D 0) { > + RTE_ETHDEV_LOG(ERR, > + "Memory pool is null and no multi-pool > configuration > +provided\n"); > return -EINVAL; > } > + > + ret =3D rte_eth_rx_queue_check_mempool(rx_conf- > >rx_mempools, > + rx_conf->rx_npool, > + &mbp_buf_size, > + &dev_info); > + > + if (ret !=3D 0) > + return ret; > + } else { > + RTE_ETHDEV_LOG(ERR, "Missing Rx mempool > configuration\n"); > + return -EINVAL; > } >=20 > /* Use default specified by driver, if nb_rx_desc is zero */ diff --git > a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index > b62ac5bb6f..306c2b3573 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1067,6 +1067,25 @@ struct rte_eth_rxconf { > */ > union rte_eth_rxseg *rx_seg; >=20 > + /** > + * Points to an array of mempools. > + * > + * Valid only when RTE_ETH_RX_OFFLOAD_MUL_MEMPOOL flag is set > in > + * Rx offloads. > + * > + * This provides support for multiple mbuf pools per Rx queue. > + * > + * This is often useful for saving the memory where the application can > + * create a different pools to steer the specific size of the packet, t= hus > + * enabling effective use of memory. > + * > + * Note that on Rx scatter enable, a packet may be delivered using a > chain > + * of mbufs obtained from single mempool or multiple mempools based > on > + * the NIC implementation. > + */ > + struct rte_mempool **rx_mempools; > + uint16_t rx_npool; /** < number of mempools */ > + > uint64_t reserved_64s[2]; /**< Reserved for future fields */ > void *reserved_ptrs[2]; /**< Reserved for future fields */ > }; > @@ -1395,6 +1414,7 @@ struct rte_eth_conf { #define > RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM RTE_BIT64(18) > #define RTE_ETH_RX_OFFLOAD_RSS_HASH RTE_BIT64(19) > #define RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT RTE_BIT64(20) > +#define RTE_ETH_RX_OFFLOAD_MUL_MEMPOOL RTE_BIT64(21) >=20 > #define RTE_ETH_RX_OFFLOAD_CHECKSUM > (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | \ > RTE_ETH_RX_OFFLOAD_UDP_CKSUM | \ > @@ -1615,6 +1635,8 @@ struct rte_eth_dev_info { > /** Configured number of Rx/Tx queues */ > uint16_t nb_rx_queues; /**< Number of Rx queues. */ > uint16_t nb_tx_queues; /**< Number of Tx queues. */ > + /** Maximum number of pools supported per Rx queue. */ > + uint16_t max_pools; > /** Rx parameter recommendations */ > struct rte_eth_dev_portconf default_rxportconf; > /** Tx parameter recommendations */ > -- > 2.25.1