Commit f7133135 authored by Shay Drory's avatar Shay Drory Committed by Saeed Mahameed

net/mlx5: fw_tracer, Add support for unrecognized string

In case FW is publishing a string which isn't found in the driver's
string DBs, keep the string as raw data.
Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 7dfcd110
......@@ -465,6 +465,7 @@ static void poll_trace(struct mlx5_fw_tracer *tracer,
tracer_event->event_id = MLX5_GET(tracer_event, trace, event_id);
tracer_event->lost_event = MLX5_GET(tracer_event, trace, lost);
tracer_event->out = trace;
switch (tracer_event->event_id) {
case TRACER_EVENT_TYPE_TIMESTAMP:
......@@ -587,6 +588,26 @@ void mlx5_tracer_print_trace(struct tracer_string_format *str_frmt,
mlx5_tracer_clean_message(str_frmt);
}
static int mlx5_tracer_handle_raw_string(struct mlx5_fw_tracer *tracer,
struct tracer_event *tracer_event)
{
struct tracer_string_format *cur_string;
cur_string = mlx5_tracer_message_insert(tracer, tracer_event);
if (!cur_string)
return -1;
cur_string->event_id = tracer_event->event_id;
cur_string->timestamp = tracer_event->string_event.timestamp;
cur_string->lost = tracer_event->lost_event;
cur_string->string = "0x%08x%08x";
cur_string->num_of_params = 2;
cur_string->params[0] = upper_32_bits(*tracer_event->out);
cur_string->params[1] = lower_32_bits(*tracer_event->out);
list_add_tail(&cur_string->list, &tracer->ready_strings_list);
return 0;
}
static int mlx5_tracer_handle_string_trace(struct mlx5_fw_tracer *tracer,
struct tracer_event *tracer_event)
{
......@@ -595,7 +616,7 @@ static int mlx5_tracer_handle_string_trace(struct mlx5_fw_tracer *tracer,
if (tracer_event->string_event.tdsn == 0) {
cur_string = mlx5_tracer_get_string(tracer, tracer_event);
if (!cur_string)
return -1;
return mlx5_tracer_handle_raw_string(tracer, tracer_event);
cur_string->num_of_params = mlx5_tracer_get_num_of_params(cur_string->string);
cur_string->last_param_num = 0;
......@@ -610,7 +631,7 @@ static int mlx5_tracer_handle_string_trace(struct mlx5_fw_tracer *tracer,
if (!cur_string) {
pr_debug("%s Got string event for unknown string tmsn: %d\n",
__func__, tracer_event->string_event.tmsn);
return -1;
return mlx5_tracer_handle_raw_string(tracer, tracer_event);
}
cur_string->last_param_num += 1;
if (cur_string->last_param_num > TRACER_MAX_PARAMS) {
......
......@@ -166,6 +166,7 @@ struct tracer_event {
struct tracer_string_event string_event;
struct tracer_timestamp_event timestamp_event;
};
u64 *out;
};
struct mlx5_ifc_tracer_event_bits {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment