Skip to contentSkip to conversation

net/mlx5: query hardware capability for max lro size

PATCH Superseded Rayane Boussanni 3 participants 5 messages Apr 20 – Jun 4 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: query hardware capability for max lro size

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.

---
 drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_ethdev.c +2 -2
index a29cdeeb50..fb51de031b 100644
@@ -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.
Signature · 1 line
2.34.1
#1 lore raw

Thank you for the contribution.

+cc mlx5 maintainers

Quoted 15 lines · 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.

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

drivers/net/mlx5/mlx5_ethdev.c mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) · line 368

Quoted 8 lines
drivers/net/mlx5/mlx5_ethdev.c +2 -2
@@ -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.

drivers/net/mlx5/mlx5_ethdev.c mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) · line 371

Quoted 3 lines
drivers/net/mlx5/mlx5_ethdev.c +0 -0
 	/*
 	 * Since we need one CQ per QP, the limit is the minimum number
 	 * between the two values.

Best regards,
Dariusz Sosnowski

#2 lore raw

PATCH v2 1/1 net/mlx5: query hardware capability for max lro size

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

---

Thank you Dariusz for the review!

 drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_ethdev.c +2 -2
index a29cdeeb50..734ce0e60d 100644
@@ -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.
Signature · 1 line
2.43.0.windows.1