DPDK patches and discussions
 help / color / mirror / Atom feed
From: <skoteshwar@marvell.com>
To: Jerin Jacob <jerinj@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>
Cc: <dev@dpdk.org>, Satha Rao <skoteshwar@marvell.com>
Subject: [dpdk-dev] [PATCH 2/3] net/octeontx2: get tm node stats after resource allocated
Date: Wed, 7 Jul 2021 12:49:16 -0400	[thread overview]
Message-ID: <1625676557-2269-2-git-send-email-skoteshwar@marvell.com> (raw)
In-Reply-To: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com>

From: Satha Rao <skoteshwar@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@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


  reply	other threads:[~2021-07-07 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 16:49 [dpdk-dev] [PATCH 1/3] net/octeontx2: handle link status when device stopped skoteshwar
2021-07-07 16:49 ` skoteshwar [this message]
2021-07-07 16:49 ` [dpdk-dev] [PATCH 3/3] net/cnxk: update " skoteshwar
2021-07-13  9:32 ` [dpdk-dev] [PATCH 1/3] net/octeontx2: handle " Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1625676557-2269-2-git-send-email-skoteshwar@marvell.com \
    --to=skoteshwar@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).