Skip to content

Commit d79af93

Browse files
Feras DaoudSaeed Mirzamohammadi
authored andcommitted
net/mlx5: Rearm the FW tracer after each tracer event
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: c71ad41 ("net/mlx5: FW tracer, events handling") Signed-off-by: Feras Daoud <[email protected]> Signed-off-by: Roy Novich <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Orabug: 34387281 (cherry picked from commit 8bf94e6) cherry-pick-repo=kernel/git/torvalds/linux.git unmodified-from-upstream: 8bf94e6 Signed-off-by: Qing Huang <[email protected]> Signed-off-by: Saeed Mirzamohammadi <[email protected]>
1 parent 9033c0a commit d79af93

File tree

1 file changed

+5
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/diag

1 file changed

+5
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,9 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
637637
if (!tracer->owner)
638638
return;
639639

640+
if (unlikely(!tracer->str_db.loaded))
641+
goto arm;
642+
640643
block_count = tracer->buff.size / TRACER_BLOCK_SIZE_BYTE;
641644
start_offset = tracer->buff.consumer_index * TRACER_BLOCK_SIZE_BYTE;
642645

@@ -694,6 +697,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
694697
&tmp_trace_block[TRACES_PER_BLOCK - 1]);
695698
}
696699

700+
arm:
697701
mlx5_fw_tracer_arm(dev);
698702
}
699703

@@ -935,8 +939,7 @@ void mlx5_fw_tracer_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe)
935939
queue_work(tracer->work_queue, &tracer->ownership_change_work);
936940
break;
937941
case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE:
938-
if (likely(tracer->str_db.loaded))
939-
queue_work(tracer->work_queue, &tracer->handle_traces_work);
942+
queue_work(tracer->work_queue, &tracer->handle_traces_work);
940943
break;
941944
default:
942945
mlx5_core_dbg(dev, "FWTracer: Event with unrecognized subtype: sub_type %d\n",

0 commit comments

Comments
 (0)