From patchwork Thu Nov 17 11:30:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanumanth Pothula X-Patchwork-Id: 119933 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7BA0CA0547; Thu, 17 Nov 2022 12:30:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BAB940DDC; Thu, 17 Nov 2022 12:30:59 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 50E3540DDA for ; Thu, 17 Nov 2022 12:30:57 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AH6pVpw025530; Thu, 17 Nov 2022 03:30:56 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=FnUUEP1/GUbIcEreUT5hXWerIISnG1+HCG3lEaJpcAk=; b=SJjcXS6OVBXkOD4W6zK2tb9CU13nbkEzAWD3hsgAouVFtrEcCLONSxw3vR8OV1HnRz6W dTD5E2weQVlbW+V4JZwFqkpOPTwIhQqkeq9JOIAcvibKp8E7IJ13JxwvS7XknVit/OAr blQ4Oul5XcDvJxaZjE/K7HUxTJYFSeWCmRCNzsEMHtyLV2mmGyNvtSv1E4Elg31J1mFp OOd5P37oOR/K/v9psC6QMpVmFsBAa6gxtv++WvGKcB+Nof0MLoLtf0v5P1/mAWlTapV1 MZ7SGOcBTe9WapiUcZTxXb8pHWGeMhtPq+08S9EoetPkXZJLl6dxirnqZGZd4fdkpo2I gA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3kwg2b0td1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Nov 2022 03:30:56 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 17 Nov 2022 03:30:54 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 17 Nov 2022 03:30:53 -0800 Received: from localhost.localdomain (unknown [10.28.36.155]) by maili.marvell.com (Postfix) with ESMTP id 0CBD15B6927; Thu, 17 Nov 2022 03:30:50 -0800 (PST) From: Hanumanth Pothula To: Aman Singh , Yuying Zhang CC: , , , , , , , Subject: [PATCH v1 1/1] app/testpmd: add valid check to verify multi mempool feature Date: Thu, 17 Nov 2022 17:00:47 +0530 Message-ID: <20221117113047.3088461-1-hpothula@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: AFMy3ZW2vUosNW9ur7uCFvtf-Wg5A6Dc X-Proofpoint-ORIG-GUID: AFMy3ZW2vUosNW9ur7uCFvtf-Wg5A6Dc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-17_06,2022-11-17_01,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 Validate ethdev parameter 'max_rx_mempools' to know wheater device supports multi-mempool feature or not. Bugzilla ID: 1128 Signed-off-by: Hanumanth Pothula --- app/test-pmd/testpmd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 78ea19fcbb..79c0951b62 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2648,16 +2648,22 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, { union rte_eth_rxseg rx_useg[MAX_SEGS_BUFFER_SPLIT] = {}; struct rte_mempool *rx_mempool[MAX_MEMPOOL] = {}; + struct rte_eth_dev_info dev_info; struct rte_mempool *mpx; unsigned int i, mp_n; int ret; + ret = rte_eth_dev_info_get(port_id, &dev_info); + if (ret != 0) + return ret; + /* Verify Rx queue configuration is single pool and segment or * multiple pool/segment. + * @see rte_eth_dev_info::max_rx_mempools * @see rte_eth_rxconf::rx_mempools * @see rte_eth_rxconf::rx_seg */ - if (!(mbuf_data_size_n > 1) && !(rx_pkt_nb_segs > 1 || + if (!(dev_info.max_rx_mempools != 0) && !(rx_pkt_nb_segs > 1 || ((rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) != 0))) { /* Single pool/segment configuration */ rx_conf->rx_seg = NULL;