public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel•org>
To: "David S. Miller" <davem@davemloft•net>,
	Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
	Eric Dumazet <edumazet@google•com>
Cc: netdev@vger•kernel.org, Feras Daoud <ferasda@nvidia•com>,
	Roy Novich <royno@nvidia•com>, Moshe Shemesh <moshe@nvidia•com>,
	Saeed Mahameed <saeedm@nvidia•com>
Subject: [net 5/6] net/mlx5: Rearm the FW tracer after each tracer event
Date: Wed,  8 Jun 2022 11:58:54 -0700	[thread overview]
Message-ID: <20220608185855.19818-6-saeed@kernel.org> (raw)
In-Reply-To: <20220608185855.19818-1-saeed@kernel.org>

From: Feras Daoud <ferasda@nvidia•com>

The current design does not arm the tracer if traces are available before
the tracer string database is fully loaded, leading to an unfunctional tracer.
This fix will rearm the tracer every time the FW triggers tracer event
regardless of the tracer strings database status.

Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling")
Signed-off-by: Feras Daoud <ferasda@nvidia•com>
Signed-off-by: Roy Novich <royno@nvidia•com>
Reviewed-by: Moshe Shemesh <moshe@nvidia•com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia•com>
---
 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
index eae9aa9c0811..978a2bb8e122 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
@@ -675,6 +675,9 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
 	if (!tracer->owner)
 		return;
 
+	if (unlikely(!tracer->str_db.loaded))
+		goto arm;
+
 	block_count = tracer->buff.size / TRACER_BLOCK_SIZE_BYTE;
 	start_offset = tracer->buff.consumer_index * TRACER_BLOCK_SIZE_BYTE;
 
@@ -732,6 +735,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
 						      &tmp_trace_block[TRACES_PER_BLOCK - 1]);
 	}
 
+arm:
 	mlx5_fw_tracer_arm(dev);
 }
 
@@ -1136,8 +1140,7 @@ static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void
 		queue_work(tracer->work_queue, &tracer->ownership_change_work);
 		break;
 	case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE:
-		if (likely(tracer->str_db.loaded))
-			queue_work(tracer->work_queue, &tracer->handle_traces_work);
+		queue_work(tracer->work_queue, &tracer->handle_traces_work);
 		break;
 	default:
 		mlx5_core_dbg(dev, "FWTracer: Event with unrecognized subtype: sub_type %d\n",
-- 
2.36.1


  parent reply	other threads:[~2022-06-08 18:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 18:58 [pull request][net 0/6] mlx5 fixes 2022-06-08 Saeed Mahameed
2022-06-08 18:58 ` [net 1/6] MAINTAINERS: adjust MELLANOX ETHERNET INNOVA DRIVERS to TLS support removal Saeed Mahameed
2022-06-08 18:58 ` [net 2/6] Revert "net/mlx5e: Allow relaxed ordering over VFs" Saeed Mahameed
2022-06-08 18:58 ` [net 3/6] net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules Saeed Mahameed
2022-06-08 18:58 ` [net 4/6] net/mlx5: E-Switch, pair only capable devices Saeed Mahameed
2022-06-08 18:58 ` Saeed Mahameed [this message]
2022-06-08 18:58 ` [net 6/6] net/mlx5: fs, fail conflicting actions Saeed Mahameed

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=20220608185855.19818-6-saeed@kernel.org \
    --to=saeed@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=ferasda@nvidia$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=moshe@nvidia$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=royno@nvidia$(echo .)com \
    --cc=saeedm@nvidia$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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