[dpdk-dev] [PATCH 2/3] net/octeontx2: get tm node stats after resource allocated

skoteshwar at marvell.com skoteshwar at marvell.com
Wed Jul 7 18:49:16 CEST 2021


From: Satha Rao <skoteshwar at marvell.com>

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 <skoteshwar at marvell.com>
---
 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



More information about the dev mailing list