Skip to contentSkip to conversation

net/mlx5: fix flow dump for modify field

PATCH In review Sean Zhang 2 participants 2 messages Jun 29, 2023 – Jul 3, 2023 Network drivers

lore
Share & tools
lore

Sean Zhang

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/mlx5/mlx5_flow.c | 58 +++++++++++++++++++++++++-----------
 1 file changed, 41 insertions(+), 17 deletions(-)
drivers/net/mlx5/mlx5_flow.c +41 -17
index cf83db7b60..abb86241fc 100644
@@ -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);
+				}
 			}
 		}
 
Signature · 1 line
2.34.1
#1 lore raw

Hi,

Quoted 14 lines

-----Original Message-----
From: Sean Zhang <[email protected]>
Sent: Thursday, June 29, 2023 1:01 PM
To: NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Haifei Luo <[email protected]>
Cc: [email protected]; [email protected]
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.

Quoted 5 lines
Fixes a7ac7fae4919 ("net/mlx5: enhance flow dump")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh