Skip to content

Commit 0750560

Browse files
kliteynSaeed Mahameed
authored andcommitted
net/mlx5: DR, Fix dumping of legacy modify_hdr in debug dump
The steering dump parser expects to see 0 as rewrite num of actions in case pattern/args aren't supported - parsing of legacy modify header is based on this assumption. Fix this to align to parser's expectation. Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent e315e7b commit 0750560

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core/steering

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,15 @@ dr_dump_rule_action_mem(struct seq_file *file, const u64 rule_id,
153153
DR_DUMP_REC_TYPE_ACTION_MODIFY_HDR, action_id,
154154
rule_id, action->rewrite->index,
155155
action->rewrite->single_action_opt,
156-
action->rewrite->num_of_actions,
156+
ptrn_arg ? action->rewrite->num_of_actions : 0,
157157
ptrn_arg ? ptrn->index : 0,
158158
ptrn_arg ? mlx5dr_arg_get_obj_id(arg) : 0);
159159

160-
for (i = 0; i < action->rewrite->num_of_actions; i++) {
161-
seq_printf(file, ",0x%016llx",
162-
be64_to_cpu(((__be64 *)rewrite_data)[i]));
160+
if (ptrn_arg) {
161+
for (i = 0; i < action->rewrite->num_of_actions; i++) {
162+
seq_printf(file, ",0x%016llx",
163+
be64_to_cpu(((__be64 *)rewrite_data)[i]));
164+
}
163165
}
164166

165167
seq_puts(file, "\n");

0 commit comments

Comments
 (0)