[5/5] net/mlx5: support HW steering debug dump

Message ID 20230126160309.584967-5-hamdani@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series [1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Hamdan Igbaria Jan. 26, 2023, 4:03 p.m. UTC
  Add the ability for the DPDK apps to call
HW steering relevant debug data dump function.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f5e2831480..8e3da63299 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -9857,10 +9857,13 @@  mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
 		if (mlx5_flow_dev_dump_sh_all(dev, file, error))
 			return -EINVAL;
+
+		if (sh->config.dv_flow_en == 2)
+			return mlx5dr_debug_dump(priv->dr_ctx, file);
 #endif
 		return mlx5_devx_cmd_flow_dump(sh->fdb_domain,
-					sh->rx_domain,
-					sh->tx_domain, file);
+					       sh->rx_domain,
+					       sh->tx_domain, file);
 	}
 	/* dump one */
 	flow = mlx5_ipool_get(priv->flows[MLX5_FLOW_TYPE_GEN],
@@ -9878,10 +9881,14 @@  mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 		if (!dh)
 			return -ENOENT;
 		if (dh->drv_flow) {
-			ret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,
-					file);
-			if (ret)
-				return -ENOENT;
+			if (sh->config.dv_flow_en == 2) {
+				return -ENOTSUP;
+			} else {
+				ret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,
+								     file);
+				if (ret)
+					return -ENOENT;
+			}
 		}
 		handle_idx = dh->next.next;
 	}