All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Baum <michaelba@nvidia.com>
To: dev@dpdk.org
Cc: Matan Azrad <matan@nvidia.com>,
	Raslan Darawsheh <rasland@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH 5/7] regex/mlx5: improve error messages in RXP rules flush
Date: Wed, 18 Nov 2020 17:00:09 +0000	[thread overview]
Message-ID: <1605718811-18652-5-git-send-email-michaelba@nvidia.com> (raw)
In-Reply-To: <1605718811-18652-1-git-send-email-michaelba@nvidia.com>

During the rules flush, the rxp_poll_csr_for_value function is called
twice. The rxp_poll_csr_for_value function can fail for two reasons:
1. It could not read the value from register, in which case the
function returns -1.
2. It read a value, but not the value it expected to receive. In this
case it returns -EBUZY.

When the function fails it prints an error message that is relevant only
for a second type of failure. Moreover, for failure of the first type it
prints a value of an uninitialized variable.
In case of success, the function prints a debug message about the number
of cycles it took. This line was probably copied by mistake, since the
variable it reads from, is always equal to 0 and is not an indicator of
the number of cycles.

Remove the incorrect line about the cycles, and reduce the error print
only for the relevant error.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/regex/mlx5/mlx5_rxp.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c
index ba78cc0..fcbc766 100644
--- a/drivers/regex/mlx5/mlx5_rxp.c
+++ b/drivers/regex/mlx5/mlx5_rxp.c
@@ -179,12 +179,14 @@
 				     count, ~0,
 				     MLX5_RXP_POLL_CSR_FOR_VALUE_TIMEOUT, id);
 	if (ret < 0) {
-		DRV_LOG(ERR, "Rules not rx by RXP: credit: %d, depth: %d", val,
-			fifo_depth);
+		if (ret == -EBUSY)
+			DRV_LOG(ERR, "Rules not rx by RXP: credit: %d, depth:"
+				" %d", val, fifo_depth);
+		else
+			DRV_LOG(ERR, "CSR poll failed, can't read value!");
 		return ret;
 	}
 	DRV_LOG(DEBUG, "RTRU FIFO depth: 0x%x", fifo_depth);
-	DRV_LOG(DEBUG, "Rules flush took %d cycles.", ret);
 	ret = mlx5_devx_regex_register_read(ctx, id, MLX5_RXP_RTRU_CSR_CTRL,
 					    &val);
 	if (ret) {
@@ -203,10 +205,12 @@
 				     MLX5_RXP_RTRU_CSR_STATUS_UPDATE_DONE,
 				     MLX5_RXP_POLL_CSR_FOR_VALUE_TIMEOUT, id);
 	if (ret < 0) {
-		DRV_LOG(ERR, "Rules update timeout: 0x%08X", val);
+		if (ret == -EBUSY)
+			DRV_LOG(ERR, "Rules update timeout: 0x%08X", val);
+		else
+			DRV_LOG(ERR, "CSR poll failed, can't read value!");
 		return ret;
 	}
-	DRV_LOG(DEBUG, "Rules update took %d cycles", ret);
 	if (mlx5_devx_regex_register_read(ctx, id, MLX5_RXP_RTRU_CSR_CTRL,
 					  &val)) {
 		DRV_LOG(ERR, "CSR read failed!");
@@ -215,7 +219,7 @@
 	val &= ~(MLX5_RXP_RTRU_CSR_CTRL_GO);
 	if (mlx5_devx_regex_register_write(ctx, id, MLX5_RXP_RTRU_CSR_CTRL,
 					   val)) {
-		DRV_LOG(ERR, "CSR write write failed!");
+		DRV_LOG(ERR, "CSR write failed!");
 		return -1;
 	}
 
-- 
1.8.3.1


  parent reply	other threads:[~2020-11-18 17:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 17:00 [dpdk-dev] [PATCH 1/7] regex/mlx5: fix jump to the wrong label Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 2/7] regex/mlx5: fix iterator type in RXP engines management Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 3/7] regex/mlx5: fix unnecessary init in RXP handle Michael Baum
2020-11-18 17:00 ` [dpdk-dev] [PATCH 4/7] regex/mlx5: fix unchecked return value " Michael Baum
2020-11-18 17:00 ` Michael Baum [this message]
2020-11-18 17:00 ` [dpdk-dev] [PATCH 6/7] regex/mlx5: improve constants type in QP buffers creation Michael Baum
2020-11-22 13:58   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2020-11-18 17:00 ` [dpdk-dev] [PATCH 7/7] regex/mlx5: fix QP setuping error flow Michael Baum
2020-11-22 14:06 ` [dpdk-dev] [dpdk-stable] [PATCH 1/7] regex/mlx5: fix jump to the wrong label Thomas Monjalon

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=1605718811-18652-5-git-send-email-michaelba@nvidia.com \
    --to=michaelba@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.