From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F78DA04C9; Sun, 13 Sep 2020 21:05:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E0193FFA; Sun, 13 Sep 2020 21:05:49 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 15357160 for ; Sun, 13 Sep 2020 21:05:49 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from michaelba@nvidia.com) with SMTP; 13 Sep 2020 22:05:46 +0300 Received: from nvidia.com (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 08DJ5S1n018345; Sun, 13 Sep 2020 22:05:46 +0300 From: Michael Baum To: dev@dpdk.org Cc: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , stable@dpdk.org Date: Sun, 13 Sep 2020 19:05:22 +0000 Message-Id: <1600023922-14738-2-git-send-email-michaelba@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600023922-14738-1-git-send-email-michaelba@nvidia.com> References: <1600023922-14738-1-git-send-email-michaelba@nvidia.com> Subject: [dpdk-dev] [PATCH v1 2/2] net/mlx5: fix using hairpin without dest DevX TIR support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The PMD supports hairpin only if DevX is supported and DV flow is enable. 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 --- drivers/net/mlx5/mlx5_ethdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index cefb450..a7924b1 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -569,12 +569,12 @@ struct mlx5_priv * * 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; } -- 1.8.3.1