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 D351C41DC3; Fri, 3 Mar 2023 09:11:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E1E942B7E; Fri, 3 Mar 2023 09:11:00 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id AF20D42B71 for ; Fri, 3 Mar 2023 09:10:59 +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 3236NeCE006795 for ; Fri, 3 Mar 2023 00:10:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=nVOJghPme20nuBc3rzrYBrub58MKTK52O//aKI9P00I=; b=PizTw0nPheCc13uQaIiq3+ZawKl3dXAM8VgzT+wUjlZnMbAAAj6XCeS2iopbCQ+aa49s 4XnSBOo+7/DCj/ttKLqPobTqxUuXuisX2RGqzSE+O/OJECv1mkUIV8QNfjrlrtoXXF4Y wBinh19ZuuYc6C+qWrVkejbk1yL/o5aD0JmfEg9nKiZmRrKsC58qoc0PkTEBRiuRfEHL FviL5aFCWyHfSGhExVwYkJtbltm6GU45A856NQnSYAiVSAX1Mb8wJotT+MVgsap1Nk2A L8gm+mgsqmvLD2CUVIGeWOrGb3BG4hKLsukJDjEr5Ha/0EuNwM0pV4Y4at1/+5ZCQzTL iQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3p1wr9xbhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 03 Mar 2023 00:10:59 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 3 Mar 2023 00:10:56 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Fri, 3 Mar 2023 00:10:56 -0800 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id D1EA33F70C0; Fri, 3 Mar 2023 00:10:52 -0800 (PST) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Rakesh Kudurumalla Subject: [PATCH 03/15] net/cnxk: release LBK bpid for after freeing resources Date: Fri, 3 Mar 2023 13:40:01 +0530 Message-ID: <20230303081013.589868-3-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303081013.589868-1-ndabilpuram@marvell.com> References: <20230303081013.589868-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: GPrULY_44Wz8GZgaFblw_TVtdYCyFMoL X-Proofpoint-GUID: GPrULY_44Wz8GZgaFblw_TVtdYCyFMoL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-03_01,2023-03-02_02,2023-02-09_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 From: Rakesh Kudurumalla bpids are not disabled while freeing resources for NIX device as a result a new bpid is assigned which leads to exhaustion of bpid's after soft exit of application. This patch fixes the same Signed-off-by: Rakesh Kudurumalla --- drivers/net/cnxk/cnxk_ethdev.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 22072d29b0..e99335b117 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -900,6 +900,27 @@ cnxk_rss_ethdev_to_nix(struct cnxk_eth_dev *dev, uint64_t ethdev_rss, return flowkey_cfg; } +static int +nix_rxchan_cfg_disable(struct cnxk_eth_dev *dev) +{ + struct roc_nix *nix = &dev->nix; + struct roc_nix_fc_cfg fc_cfg; + int rc; + + if (!roc_nix_is_lbk(nix)) + return 0; + + memset(&fc_cfg, 0, sizeof(struct roc_nix_fc_cfg)); + fc_cfg.type = ROC_NIX_FC_RXCHAN_CFG; + fc_cfg.rxchan_cfg.enable = false; + rc = roc_nix_fc_config_set(nix, &fc_cfg); + if (rc) { + plt_err("Failed to setup flow control, rc=%d(%s)", rc, roc_error_msg_get(rc)); + return rc; + } + return 0; +} + static void nix_free_queue_mem(struct cnxk_eth_dev *dev) { @@ -1218,6 +1239,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) goto fail_configure; roc_nix_tm_fini(nix); + nix_rxchan_cfg_disable(dev); roc_nix_lf_free(nix); } @@ -1456,6 +1478,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) roc_nix_tm_fini(nix); free_nix_lf: nix_free_queue_mem(dev); + rc |= nix_rxchan_cfg_disable(dev); rc |= roc_nix_lf_free(nix); fail_configure: dev->configured = 0; @@ -2026,6 +2049,11 @@ cnxk_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool reset) /* Free ROC RQ's, SQ's and CQ's memory */ nix_free_queue_mem(dev); + /* free nix bpid */ + rc = nix_rxchan_cfg_disable(dev); + if (rc) + plt_err("Failed to free nix bpid, rc=%d", rc); + /* Free nix lf resources */ rc = roc_nix_lf_free(nix); if (rc) -- 2.25.1