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

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

Checks

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

Commit Message

Hamdan Igbaria Feb. 2, 2023, 4:02 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 | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f5e2831480..a34fcccd2c 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,8 +9881,11 @@  mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 		if (!dh)
 			return -ENOENT;
 		if (dh->drv_flow) {
+			if (sh->config.dv_flow_en == 2)
+				return -ENOTSUP;
+
 			ret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,
-					file);
+							     file);
 			if (ret)
 				return -ENOENT;
 		}