From: Dekel Peled Date: Sun, 10 Jan 2021 17:37:56 +0000 (+0200) Subject: net/mlx5: fix hairpin flow split decision X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=19e13263ed2fc47a32e9ec3ddcfdbf44168d72ac;p=dpdk.git net/mlx5: fix hairpin flow split decision 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 --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 9c2e0900b6..1790e774ba 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3543,7 +3543,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++; @@ -3553,7 +3553,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++;