From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BF866A04B5 for ; Sun, 10 Jan 2021 18:32:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84B7F140CD3; Sun, 10 Jan 2021 18:32:45 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id C619A140CD3 for ; Sun, 10 Jan 2021 18:32:44 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 10 Jan 2021 19:32:43 +0200 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.228.136.74]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10AHWha3029788; Sun, 10 Jan 2021 19:32:43 +0200 From: Dekel Peled To: matan@nvidia.com, shahafs@nvidia.com, viacheslavo@nvidia.com Cc: stable@dpdk.org Date: Sun, 10 Jan 2021 19:32:40 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: <670e2f1c1644f8722b707d5f4d69eb460868317e.1609682638.git.dekelp@nvidia.com> References: <670e2f1c1644f8722b707d5f4d69eb460868317e.1609682638.git.dekelp@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] net/mlx5: fix flow check hairpin split X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Previously, the identification of hairpin queue was done using mlx5_rxq_get_type() function. Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(), and check of the return value conf != NULL. The case of return value is NULL (queue is not hairpin) was not handled. As result, non-hairpin flows were wrongly handled. This patch adds the required check for return value is NULL. Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- v2: update conditions according to coding standards. --- --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 2a4073c126..37502067d4 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3548,7 +3548,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev, if (queue == NULL) return 0; conf = mlx5_rxq_get_hairpin_conf(dev, queue->index); - if (conf != NULL && !!conf->tx_explicit) + if (conf == NULL || conf->tx_explicit != 0) return 0; queue_action = 1; action_n++; @@ -3558,7 +3558,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev, if (rss == NULL || rss->queue_num == 0) return 0; conf = mlx5_rxq_get_hairpin_conf(dev, rss->queue[0]); - if (conf != NULL && !!conf->tx_explicit) + if (conf == NULL || conf->tx_explicit != 0) return 0; queue_action = 1; action_n++; -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5CFE8A09EF for ; Sun, 10 Jan 2021 18:38:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40848140CDB; Sun, 10 Jan 2021 18:38:08 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 9C51D140CD4 for ; Sun, 10 Jan 2021 18:38:05 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 10 Jan 2021 19:38:00 +0200 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.228.136.74]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10AHc00t031942; Sun, 10 Jan 2021 19:38:00 +0200 From: Dekel Peled To: matan@nvidia.com, shahafs@nvidia.com, viacheslavo@nvidia.com Cc: dev@dpdk.org, stable@dpdk.org Date: Sun, 10 Jan 2021 19:37:56 +0200 Message-ID: X-Mailer: git-send-email 2.21.0 In-Reply-To: <670e2f1c1644f8722b707d5f4d69eb460868317e.1609682638.git.dekelp@nvidia.com> References: <670e2f1c1644f8722b707d5f4d69eb460868317e.1609682638.git.dekelp@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] net/mlx5: fix flow check hairpin split X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Message-ID: <20210110173756.fHgTh3XlcTEw6jq8tiPfgbbCNiRQKstuun041rQdI0M@z> Previously, the identification of hairpin queue was done using mlx5_rxq_get_type() function. Recent patch replaced it with use of mlx5_rxq_get_hairpin_conf(), and check of the return value conf != NULL. The case of return value is NULL (queue is not hairpin) was not handled. As result, non-hairpin flows were wrongly handled. This patch adds the required check for return value is NULL. Fixes: 509f8470de55 ("net/mlx5: do not split hairpin flow in explicit mode") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- v2: update conditions according to coding standards. --- --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 2a4073c126..37502067d4 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3548,7 +3548,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev, if (queue == NULL) return 0; conf = mlx5_rxq_get_hairpin_conf(dev, queue->index); - if (conf != NULL && !!conf->tx_explicit) + if (conf == NULL || conf->tx_explicit != 0) return 0; queue_action = 1; action_n++; @@ -3558,7 +3558,7 @@ flow_check_hairpin_split(struct rte_eth_dev *dev, if (rss == NULL || rss->queue_num == 0) return 0; conf = mlx5_rxq_get_hairpin_conf(dev, rss->queue[0]); - if (conf != NULL && !!conf->tx_explicit) + if (conf == NULL || conf->tx_explicit != 0) return 0; queue_action = 1; action_n++; -- 2.25.1