DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: query hardware capability for max lro size
@ 2026-04-20 18:48 Rayane Boussanni
  2026-04-24  8:52 ` Dariusz Sosnowski
  0 siblings, 1 reply; 4+ messages in thread
From: Rayane Boussanni @ 2026-04-20 18:48 UTC (permalink / raw)
  To: dev; +Cc: rasland, Rayane Boussanni

Resolve a FIXME in mlx5_dev_infos_get() by dynamically checking the
hardware lro_cap flag instead of unconditionally advertising
MLX5_MAX_LRO_SIZE. Retains the standard 32-byte fallback for
min_rx_bufsize.

Signed-off-by: Rayane Boussanni <rboussanni@gmail.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index a29cdeeb50..fb51de031b 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -363,9 +363,9 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->min_mtu = priv->min_mtu;
 	info->max_mtu = priv->max_mtu;
 	info->max_rx_pktlen = info->max_mtu + MLX5_ETH_OVERHEAD;
-	/* FIXME: we should ask the device for these values. */
 	info->min_rx_bufsize = 32;
-	info->max_lro_pkt_size = MLX5_MAX_LRO_SIZE;
+	info->max_lro_pkt_size = priv->sh->cdev->config.hca_attr.lro_cap ?
+				 MLX5_MAX_LRO_SIZE : 0;
 	/*
 	 * Since we need one CQ per QP, the limit is the minimum number
 	 * between the two values.
-- 
2.34.1


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

* Re: [PATCH] net/mlx5: query hardware capability for max lro size
  2026-04-20 18:48 [PATCH] net/mlx5: query hardware capability for max lro size Rayane Boussanni
@ 2026-04-24  8:52 ` Dariusz Sosnowski
  2026-04-24 14:27   ` [PATCH v2] " Rayane Boussanni
  0 siblings, 1 reply; 4+ messages in thread
From: Dariusz Sosnowski @ 2026-04-24  8:52 UTC (permalink / raw)
  To: Rayane Boussanni
  Cc: dev, rasland, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
	Suanming Mou, Matan Azrad

Thank you for the contribution.

+cc mlx5 maintainers

On Mon, Apr 20, 2026 at 02:48:08PM -0400, Rayane Boussanni wrote:
> Resolve a FIXME in mlx5_dev_infos_get() by dynamically checking the
> hardware lro_cap flag instead of unconditionally advertising
> MLX5_MAX_LRO_SIZE. Retains the standard 32-byte fallback for
> min_rx_bufsize.
> 
> Signed-off-by: Rayane Boussanni <rboussanni@gmail.com>
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index a29cdeeb50..fb51de031b 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -363,9 +363,9 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
>  	info->min_mtu = priv->min_mtu;
>  	info->max_mtu = priv->max_mtu;
>  	info->max_rx_pktlen = info->max_mtu + MLX5_ETH_OVERHEAD;
> -	/* FIXME: we should ask the device for these values. */
>  	info->min_rx_bufsize = 32;
> -	info->max_lro_pkt_size = MLX5_MAX_LRO_SIZE;
> +	info->max_lro_pkt_size = priv->sh->cdev->config.hca_attr.lro_cap ?
> +				 MLX5_MAX_LRO_SIZE : 0;

Could you please change the condition to use priv->sh->config.lro_allowed?
This field is used in other cases where LRO capability is checked,
since it covers both hca_attr and DevX support checks.

>  	/*
>  	 * Since we need one CQ per QP, the limit is the minimum number
>  	 * between the two values.

Best regards,
Dariusz Sosnowski

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

* [PATCH v2] net/mlx5: query hardware capability for max lro size
  2026-04-24  8:52 ` Dariusz Sosnowski
@ 2026-04-24 14:27   ` Rayane Boussanni
  2026-04-24 16:55     ` Dariusz Sosnowski
  0 siblings, 1 reply; 4+ messages in thread
From: Rayane Boussanni @ 2026-04-24 14:27 UTC (permalink / raw)
  To: dsosnowski
  Cc: bingz, dev, matan, orika, rasland, suanmingm, viacheslavo,
	Rayane Boussanni

Resolve a FIXME in mlx5_dev_infos_get() by dynamically checking the
lro_allowed flag instead of unconditionally advertising
MLX5_MAX_LRO_SIZE.

Signed-off-by: Rayane Boussanni <rboussanni@gmail.com>
---

Thank you Dariusz for the review!

 drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index a29cdeeb50..734ce0e60d 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -363,9 +363,9 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->min_mtu = priv->min_mtu;
 	info->max_mtu = priv->max_mtu;
 	info->max_rx_pktlen = info->max_mtu + MLX5_ETH_OVERHEAD;
-	/* FIXME: we should ask the device for these values. */
 	info->min_rx_bufsize = 32;
-	info->max_lro_pkt_size = MLX5_MAX_LRO_SIZE;
+	info->max_lro_pkt_size = priv->sh->config.lro_allowed ?
+				 MLX5_MAX_LRO_SIZE : 0;
 	/*
 	 * Since we need one CQ per QP, the limit is the minimum number
 	 * between the two values.
-- 
2.43.0.windows.1


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

* Re: [PATCH v2] net/mlx5: query hardware capability for max lro size
  2026-04-24 14:27   ` [PATCH v2] " Rayane Boussanni
@ 2026-04-24 16:55     ` Dariusz Sosnowski
  0 siblings, 0 replies; 4+ messages in thread
From: Dariusz Sosnowski @ 2026-04-24 16:55 UTC (permalink / raw)
  To: Rayane Boussanni
  Cc: bingz, dev, matan, orika, rasland, suanmingm, viacheslavo

On Fri, Apr 24, 2026 at 10:27:32AM -0400, Rayane Boussanni wrote:
> Resolve a FIXME in mlx5_dev_infos_get() by dynamically checking the
> lro_allowed flag instead of unconditionally advertising
> MLX5_MAX_LRO_SIZE.
> 
> Signed-off-by: Rayane Boussanni <rboussanni@gmail.com>

Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

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

end of thread, other threads:[~2026-04-24 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 18:48 [PATCH] net/mlx5: query hardware capability for max lro size Rayane Boussanni
2026-04-24  8:52 ` Dariusz Sosnowski
2026-04-24 14:27   ` [PATCH v2] " Rayane Boussanni
2026-04-24 16:55     ` Dariusz Sosnowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox