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 1CDF3A0C4B; Wed, 7 Jul 2021 18:49:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 067C341400; Wed, 7 Jul 2021 18:49:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 459DD413EE for ; Wed, 7 Jul 2021 18:49:58 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167Gj1T0026758 for ; Wed, 7 Jul 2021 09:49:57 -0700 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-type; s=pfpt0220; bh=9PwsJXLBrtQLC6Mg7TsHAxhEkncoW5NSeFKuiKGYc14=; b=Mo5JO2UMbaGewZi3dotitTIDebOkjYYDBQCLOR1bSJR8bkcX7qicxOj1MW1jJ+39Pt3d q29ubw7RdC/43Hjq84jIV9UXwSjiICkGmKoVuoMS7M9M3utF2epGJ+2qkAQQlJf6moMH VQlHAj5WeReRVMEm2wYaF6Xc+t7uBbyzxLpupMQFqtt28oOj//skzWBrKpfBcTyxFYr3 3LD4f08T9m2uNZ73FR5+LfWcgjlHwprnaVIWL1wgTvKTKAcag/ou8h0DrLBzyo3TmfeU 6buCGhvHpJ2utLfwuW/N+B2YqyS1FfzxGoP9bSGTgTEgPqdcCoWZ0bBGigVinQ/jJWC4 JQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 39n5tg2s43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 07 Jul 2021 09:49:57 -0700 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.18; Wed, 7 Jul 2021 09:49:55 -0700 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.18 via Frontend Transport; Wed, 7 Jul 2021 09:49:55 -0700 Received: from cavium.marvell.com (cavium.marvell.com [10.28.34.244]) by maili.marvell.com (Postfix) with ESMTP id 718073F707F; Wed, 7 Jul 2021 09:49:54 -0700 (PDT) From: To: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: , Satha Rao Date: Wed, 7 Jul 2021 12:49:16 -0400 Message-ID: <1625676557-2269-2-git-send-email-skoteshwar@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> References: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: AIpoW4PPdRaGIdh1iH0xEnN_6id0ahyN X-Proofpoint-ORIG-GUID: AIpoW4PPdRaGIdh1iH0xEnN_6id0ahyN X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-07_08:2021-07-06, 2021-07-07 signatures=0 Subject: [dpdk-dev] [PATCH 2/3] net/octeontx2: get tm node stats after resource allocated 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 Sender: "dev" From: Satha Rao We are getting kernel crash while reading tm node stats when tm hierarchy is not committed. Until hierarchy committed hardware resources are not allocated for node, this causes mbox timeout. This patch check for status of HW resources before reading statistics. Signed-off-by: Satha Rao --- drivers/net/octeontx2/otx2_tm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/octeontx2/otx2_tm.c b/drivers/net/octeontx2/otx2_tm.c index fdd5669..6aff1f9 100644 --- a/drivers/net/octeontx2/otx2_tm.c +++ b/drivers/net/octeontx2/otx2_tm.c @@ -2769,6 +2769,12 @@ int otx2_nix_sq_enable(void *_txq) return -EINVAL; } + if (!(tm_node->flags & NIX_TM_NODE_HWRES)) { + error->type = RTE_TM_ERROR_TYPE_NODE_ID; + error->message = "HW resources not allocated"; + return -EINVAL; + } + /* Stats support only for leaf node or TL1 root */ if (nix_tm_is_leaf(dev, tm_node->lvl)) { reg = (((uint64_t)tm_node->id) << 32); -- 1.8.3.1