patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix VLAN stripping on hairpin queues
@ 2025-04-25 19:49 Dariusz Sosnowski
  2025-05-27 16:09 ` Bing Zhao
  2025-06-02  6:46 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Dariusz Sosnowski @ 2025-04-25 19:49 UTC (permalink / raw)
  To: Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad
  Cc: dev, stable

Rx hairpin queues support VLAN stripping,
but if port was started and application attempted
to configure stripping on hairpin queue,
segfault was triggered because of NULL dereference.
Underlying function, which was updating the RQ was passing
wrong object handle for hairpin queues.
This patch fixes that.

Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")
Cc: stable@dpdk.org

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_devx.c | 2 ++
 drivers/net/mlx5/mlx5_vlan.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index a12891a983..ed1826a612 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -88,6 +88,8 @@ mlx5_rxq_obj_modify_rq_vlan_strip(struct mlx5_rxq_priv *rxq, int on)
 	rq_attr.state = MLX5_RQC_STATE_RDY;
 	rq_attr.vsd = (on ? 0 : 1);
 	rq_attr.modify_bitmask = MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD;
+	if (rxq->ctrl->is_hairpin)
+		return mlx5_devx_cmd_modify_rq(rxq->ctrl->obj->rq, &rq_attr);
 	return mlx5_devx_cmd_modify_rq(rxq->devx_rq.rq, &rq_attr);
 }
 
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 43a314a679..7c7ac78dfe 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -107,7 +107,7 @@ mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
 			dev->data->port_id, queue);
 		return;
 	}
-	DRV_LOG(DEBUG, "port %u set VLAN stripping offloads %d for port %uqueue %d",
+	DRV_LOG(DEBUG, "port %u set VLAN stripping offloads %d for port %u queue %d",
 		dev->data->port_id, on, rxq_data->port_id, queue);
 	if (rxq->ctrl->obj == NULL) {
 		/* Update related bits in RX queue. */
-- 
2.39.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/mlx5: fix VLAN stripping on hairpin queues
  2025-04-25 19:49 [PATCH] net/mlx5: fix VLAN stripping on hairpin queues Dariusz Sosnowski
@ 2025-05-27 16:09 ` Bing Zhao
  2025-06-02  6:46 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Bing Zhao @ 2025-05-27 16:09 UTC (permalink / raw)
  To: Dariusz Sosnowski, Slava Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad
  Cc: dev, stable

Hi,

> -----Original Message-----
> From: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Sent: Saturday, April 26, 2025 3:49 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Bing Zhao
> <bingz@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix VLAN stripping on hairpin queues
> 
> Rx hairpin queues support VLAN stripping, but if port was started and
> application attempted to configure stripping on hairpin queue, segfault
> was triggered because of NULL dereference.
> Underlying function, which was updating the RQ was passing wrong object
> handle for hairpin queues.
> This patch fixes that.
> 
> Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_devx.c | 2 ++
>  drivers/net/mlx5/mlx5_vlan.c | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
> index a12891a983..ed1826a612 100644
> --- a/drivers/net/mlx5/mlx5_devx.c
> +++ b/drivers/net/mlx5/mlx5_devx.c
> @@ -88,6 +88,8 @@ mlx5_rxq_obj_modify_rq_vlan_strip(struct mlx5_rxq_priv
> *rxq, int on)
>  	rq_attr.state = MLX5_RQC_STATE_RDY;
>  	rq_attr.vsd = (on ? 0 : 1);
>  	rq_attr.modify_bitmask = MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD;
> +	if (rxq->ctrl->is_hairpin)
> +		return mlx5_devx_cmd_modify_rq(rxq->ctrl->obj->rq, &rq_attr);
>  	return mlx5_devx_cmd_modify_rq(rxq->devx_rq.rq, &rq_attr);  }
> 
> diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
> index 43a314a679..7c7ac78dfe 100644
> --- a/drivers/net/mlx5/mlx5_vlan.c
> +++ b/drivers/net/mlx5/mlx5_vlan.c
> @@ -107,7 +107,7 @@ mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev,
> uint16_t queue, int on)
>  			dev->data->port_id, queue);
>  		return;
>  	}
> -	DRV_LOG(DEBUG, "port %u set VLAN stripping offloads %d for
> port %uqueue %d",
> +	DRV_LOG(DEBUG, "port %u set VLAN stripping offloads %d for port %u
> +queue %d",
>  		dev->data->port_id, on, rxq_data->port_id, queue);
>  	if (rxq->ctrl->obj == NULL) {
>  		/* Update related bits in RX queue. */
> --
> 2.39.5

Acked-by: Bing Zhao <bingz@nvidia.com>

Thanks


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/mlx5: fix VLAN stripping on hairpin queues
  2025-04-25 19:49 [PATCH] net/mlx5: fix VLAN stripping on hairpin queues Dariusz Sosnowski
  2025-05-27 16:09 ` Bing Zhao
@ 2025-06-02  6:46 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2025-06-02  6:46 UTC (permalink / raw)
  To: Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
	Suanming Mou, Matan Azrad
  Cc: dev, stable

Hi,

On 25/04/2025 10:49 PM, Dariusz Sosnowski wrote:
> Rx hairpin queues support VLAN stripping,
> but if port was started and application attempted
> to configure stripping on hairpin queue,
> segfault was triggered because of NULL dereference.
> Underlying function, which was updating the RQ was passing
> wrong object handle for hairpin queues.
> This patch fixes that.
> 
> Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> ---

Patch applied to next-net-mlx,


-- 
Kindest regards
Raslan Darawsheh


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-02  6:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-25 19:49 [PATCH] net/mlx5: fix VLAN stripping on hairpin queues Dariusz Sosnowski
2025-05-27 16:09 ` Bing Zhao
2025-06-02  6:46 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).