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 B428BA0350; Mon, 3 Jan 2022 11:01:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 579FE41150; Mon, 3 Jan 2022 11:01:37 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 579D24003C for ; Mon, 3 Jan 2022 11:01:34 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3849A200CF9; Mon, 3 Jan 2022 11:01:34 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 00F8C200CB8; Mon, 3 Jan 2022 11:01:34 +0100 (CET) Received: from lsv03274.swis.in-blr01.nxp.com (lsv03274.swis.in-blr01.nxp.com [92.120.147.114]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 07829183AD05; Mon, 3 Jan 2022 18:01:32 +0800 (+08) From: nipun.gupta@nxp.com To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, stephen@networkplumber.org, Rohit Raj Subject: [PATCH v3 03/15] net/dpaa2: warn user in case of high nb desc Date: Mon, 3 Jan 2022 15:31:17 +0530 Message-Id: <20220103100129.23965-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220103100129.23965-1-nipun.gupta@nxp.com> References: <20211206121824.3493-1-nipun.gupta@nxp.com> <20220103100129.23965-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Rohit Raj Added warning message if application is configuring nb_desc more than supported by PEB memory suggesting user to configure HW descriptors in normal memory rather than in faster PEB memory. Signed-off-by: Rohit Raj --- drivers/net/dpaa2/dpaa2_ethdev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index a3706439d5..f5cac8f9d9 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -74,6 +74,9 @@ int dpaa2_timestamp_dynfield_offset = -1; /* Enable error queue */ bool dpaa2_enable_err_queue; +#define MAX_NB_RX_DESC 11264 +int total_nb_rx_desc; + struct rte_dpaa2_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; uint8_t page_id; /* dpni statistics page id */ @@ -694,6 +697,13 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, DPAA2_PMD_DEBUG("dev =%p, queue =%d, pool = %p, conf =%p", dev, rx_queue_id, mb_pool, rx_conf); + total_nb_rx_desc += nb_rx_desc; + if (total_nb_rx_desc > MAX_NB_RX_DESC) { + DPAA2_PMD_WARN("\nTotal nb_rx_desc exceeds %d limit. Please use Normal buffers", + MAX_NB_RX_DESC); + DPAA2_PMD_WARN("To use Normal buffers, run 'export DPNI_NORMAL_BUF=1' before running dynamic_dpl.sh script"); + } + /* Rx deferred start is not supported */ if (rx_conf->rx_deferred_start) { DPAA2_PMD_ERR("%p:Rx deferred start not supported", @@ -984,6 +994,9 @@ dpaa2_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t rx_queue_id) memset(&cfg, 0, sizeof(struct dpni_queue)); PMD_INIT_FUNC_TRACE(); + + total_nb_rx_desc -= dpaa2_q->nb_desc; + if (dpaa2_q->cgid != 0xff) { options = DPNI_QUEUE_OPT_CLEAR_CGID; cfg.cgid = dpaa2_q->cgid; -- 2.17.1