* [PATCH] net/mlx5: fix flow dump for modify field
@ 2023-06-29 10:00 Sean Zhang
2023-07-03 8:38 ` Raslan Darawsheh
0 siblings, 1 reply; 2+ messages in thread
From: Sean Zhang @ 2023-06-29 10:00 UTC (permalink / raw)
To: thomas, Matan Azrad, Viacheslav Ovsiienko, Ori Kam, Suanming Mou,
Haifei Luo
Cc: dev, stable
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: a7ac7fae4919 ("net/mlx5: enhance flow dump")
Cc: stable@dpdk.org
Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 58 +++++++++++++++++++++++++-----------
1 file changed, 41 insertions(+), 17 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cf83db7b60..abb86241fc 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -10390,23 +10390,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);
+ }
}
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] net/mlx5: fix flow dump for modify field
2023-06-29 10:00 [PATCH] net/mlx5: fix flow dump for modify field Sean Zhang
@ 2023-07-03 8:38 ` Raslan Darawsheh
0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2023-07-03 8:38 UTC (permalink / raw)
To: Sean Zhang (Networking SW),
NBU-Contact-Thomas Monjalon (EXTERNAL),
Matan Azrad, Slava Ovsiienko, Ori Kam, Suanming Mou, Haifei Luo
Cc: dev, stable
Hi,
> -----Original Message-----
> From: Sean Zhang <xiazhang@nvidia.com>
> Sent: Thursday, June 29, 2023 1:01 PM
> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Haifei Luo <haifeil@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix flow dump for modify field
>
> 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: a7ac7fae4919 ("net/mlx5: enhance flow dump")
> Cc: stable@dpdk.org
>
> Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-03 8:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 10:00 [PATCH] net/mlx5: fix flow dump for modify field Sean Zhang
2023-07-03 8:38 ` Raslan Darawsheh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).