|SUCCESS| net/mlx5: query hardware capability for max lro size
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Apr 20 21:28:46 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/163219
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-04-20
I have reviewed the patch and identified several concerns that require attention.
commit fb51de031b
Author: Rayane Boussanni <rboussanni at gmail.com>
net/mlx5: query hardware capability for max lro size
This patch resolves a FIXME by checking the hardware lro_cap flag before
advertising MLX5_MAX_LRO_SIZE.
> 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;
Does this code conform to the coding style? The ternary operator should
have the '?' and ':' aligned with the condition on separate lines per the
style guide Section 8.2. The correct formatting would be:
info->max_lro_pkt_size = priv->sh->cdev->config.hca_attr.lro_cap
? MLX5_MAX_LRO_SIZE
: 0;
Does the lro_cap field simply indicate LRO support, or does it contain
the actual maximum size value? If lro_cap encodes the maximum size rather
than just a boolean flag, should the code be querying that specific value
instead of using the hardcoded MLX5_MAX_LRO_SIZE constant?
Can priv->sh or priv->sh->cdev ever be NULL when mlx5_dev_infos_get() is
called? If so, does this code dereference a NULL pointer?
> /*
> * Since we need one CQ per QP, the limit is the minimum number
> * between the two values.
More information about the test-report
mailing list