From 657df3ca0aa632b028aedeb45a2a5bf66c973125 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Thu, 10 Sep 2020 04:24:57 +0000 Subject: [PATCH] net/mlx5: disable dump of Verbs flows MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There was a segment fault when dump flows with device argument of dv_flow_en=0. In such case, Verbs flow engine was enabled and fdb resources were not initialized. It's suggested to use mlx_fs_dump for Verbs flow dump. This patch adds verbs engine check, prints warning message and return gracefully. Fixes: f6d7202402c9 ("net/mlx5: support flow dump API") Cc: stable@dpdk.org Reported-by: Jørgen Østergaard Sloth Signed-off-by: Xueming Li Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 136c6ed0eb..691eb9a3cd 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -6590,6 +6590,11 @@ mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_dev_ctx_shared *sh = priv->sh; + if (!priv->config.dv_flow_en) { + if (fputs("device dv flow disabled\n", file) <= 0) + return -errno; + return -ENOTSUP; + } return mlx5_devx_cmd_flow_dump(sh->fdb_domain, sh->rx_domain, sh->tx_domain, file); } -- 2.20.1