Skip to content

Commit

Permalink
net/mlx5: fix flow dump for modify field
Browse files Browse the repository at this point in the history
[ upstream commit faecafc16f69c559323ec46ef110a771ce0bd7fb ]

When using other process to dump flow information, the modify field
information cannot be dumpped due to incorrect lcore value. Add loop
to get modify field information from all lcore to fix the issue.

Fixes: a7ac7fa ("net/mlx5: enhance flow dump")

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
seanzhangseu authored and kevintraynor committed Jul 18, 2023
1 parent 9eda05b commit 0c6a5ca
Showing 1 changed file with 41 additions and 17 deletions.
58 changes: 41 additions & 17 deletions drivers/net/mlx5/mlx5_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -8638,23 +8638,47 @@ mlx5_flow_dev_dump_sh_all(struct rte_eth_dev *dev,
}
i = lcore_index;

for (j = 0; j <= h->mask; j++) {
l_inconst = &h->buckets[j].l;
if (!l_inconst || !l_inconst->cache[i])
continue;

e = LIST_FIRST(&l_inconst->cache[i]->h);
while (e) {
modify_hdr =
(struct mlx5_flow_dv_modify_hdr_resource *)e;
data = (const uint8_t *)modify_hdr->actions;
size = (size_t)(modify_hdr->actions_num) * 8;
actions_num = modify_hdr->actions_num;
id = (uint64_t)(uintptr_t)modify_hdr->action;
type = DR_DUMP_REC_TYPE_PMD_MODIFY_HDR;
save_dump_file(data, size, type, id,
(void *)(&actions_num), file);
e = LIST_NEXT(e, next);
if (lcore_index == MLX5_LIST_NLCORE) {
for (i = 0; i <= (uint32_t)lcore_index; i++) {
for (j = 0; j <= h->mask; j++) {
l_inconst = &h->buckets[j].l;
if (!l_inconst || !l_inconst->cache[i])
continue;

e = LIST_FIRST(&l_inconst->cache[i]->h);
while (e) {
modify_hdr =
(struct mlx5_flow_dv_modify_hdr_resource *)e;
data = (const uint8_t *)modify_hdr->actions;
size = (size_t)(modify_hdr->actions_num) * 8;
actions_num = modify_hdr->actions_num;
id = (uint64_t)(uintptr_t)modify_hdr->action;
type = DR_DUMP_REC_TYPE_PMD_MODIFY_HDR;
save_dump_file(data, size, type, id,
(void *)(&actions_num), file);
e = LIST_NEXT(e, next);
}
}
}
} else {
for (j = 0; j <= h->mask; j++) {
l_inconst = &h->buckets[j].l;
if (!l_inconst || !l_inconst->cache[i])
continue;

e = LIST_FIRST(&l_inconst->cache[i]->h);
while (e) {
modify_hdr =
(struct mlx5_flow_dv_modify_hdr_resource *)e;
data = (const uint8_t *)modify_hdr->actions;
size = (size_t)(modify_hdr->actions_num) * 8;
actions_num = modify_hdr->actions_num;
id = (uint64_t)(uintptr_t)modify_hdr->action;
type = DR_DUMP_REC_TYPE_PMD_MODIFY_HDR;
save_dump_file(data, size, type, id,
(void *)(&actions_num), file);
e = LIST_NEXT(e, next);
}
}
}

Expand Down

0 comments on commit 0c6a5ca

Please sign in to comment.