From: Michael Baum Date: Sun, 13 Sep 2020 19:05:22 +0000 (+0000) Subject: net/mlx5: fix hairpin dependency on destination DevX TIR X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b00f760354db0fd09f58bf6fb59972d50e772676;p=dpdk.git net/mlx5: fix hairpin dependency on destination DevX TIR The PMD supports hairpin only if DevX is supported and DV flow is enabled. When destination DevX TIR is not supported, the PMD tries to create TIR action, and fails. Avoid supporting hairpin when destination DevX TIR is not supported. Fixes: b6b3bf86bd1a ("net/mlx5: get hairpin capabilities") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index cefb45064e..a7924b103c 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -569,12 +569,12 @@ mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev) * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_hairpin_cap_get(struct rte_eth_dev *dev, - struct rte_eth_hairpin_cap *cap) +mlx5_hairpin_cap_get(struct rte_eth_dev *dev, struct rte_eth_hairpin_cap *cap) { struct mlx5_priv *priv = dev->data->dev_private; + struct mlx5_dev_config *config = &priv->config; - if (priv->sh->devx == 0) { + if (!priv->sh->devx || !config->dest_tir || !config->dv_flow_en) { rte_errno = ENOTSUP; return -rte_errno; }