[PATCH 1/2] net/mlx5: fix miss LRO validation in RxQ setup
Michael Baum
michaelba at nvidia.com
Mon Apr 25 11:30:19 CEST 2022
The mlx5_rx_queue_setup() gets from user the LRO offload.
When LRO is configured, the LRO flag in rxq_data is set to 1.
This patch adds validation to make sure the LRO is supported.
Fixes: 17ed314 ("net/mlx5: allow LRO per Rx queue")
Cc: matan at mellanox.com
Cc: stable at dpdk.org
Signed-off-by: Michael Baum <michaelba at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
drivers/net/mlx5/mlx5_rxq.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 981c296f29..a2d03f9f67 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -842,6 +842,14 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
dev->data->dev_conf.rxmode.offloads;
bool is_extmem = false;
+ if ((offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO) &&
+ !priv->sh->dev_cap.lro_supported) {
+ DRV_LOG(ERR,
+ "Port %u queue %u LRO is configured but not supported.",
+ dev->data->port_id, idx);
+ rte_errno = EINVAL;
+ return -rte_errno;
+ }
if (mp) {
/*
* The parameters should be checked on rte_eth_dev layer.
--
2.25.1
More information about the stable
mailing list