patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 21.11 0/2] net/mlx5: LRO fixes
@ 2022-05-15 13:18 Michael Baum
  2022-05-15 13:18 ` [PATCH 21.11 1/2] net/mlx5: fix LRO validation in Rx setup Michael Baum
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Baum @ 2022-05-15 13:18 UTC (permalink / raw)
  To: stable; +Cc: Matan Azrad, Viacheslav Ovsiienko, Kevin Traynor

Independent fixes about LRO.

Michael Baum (2):
  net/mlx5: fix LRO validation in Rx setup
  net/mlx5: fix LRO configuration in drop Rx queue

 drivers/net/mlx5/mlx5_devx.c | 4 +++-
 drivers/net/mlx5/mlx5_rxq.c  | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.25.1


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

* [PATCH 21.11 1/2] net/mlx5: fix LRO validation in Rx setup
  2022-05-15 13:18 [PATCH 21.11 0/2] net/mlx5: LRO fixes Michael Baum
@ 2022-05-15 13:18 ` Michael Baum
  2022-05-15 13:18 ` [PATCH 21.11 2/2] net/mlx5: fix LRO configuration in drop Rx queue Michael Baum
  2022-05-19 13:59 ` [PATCH 21.11 0/2] net/mlx5: LRO fixes Kevin Traynor
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Baum @ 2022-05-15 13:18 UTC (permalink / raw)
  To: stable; +Cc: Matan Azrad, Viacheslav Ovsiienko, Kevin Traynor

[ upstream commit a213b8682117711c8e92475c5bbb321a3d8428dd ]

The mlx5_rx_queue_setup() get LRO offload from user.

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")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@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 a5a96c9a60..4f32ae3b8d 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -841,6 +841,14 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 	uint64_t offloads = conf->offloads |
 			    dev->data->dev_conf.rxmode.offloads;
 
+	if ((offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO) &&
+	    !priv->config.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


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

* [PATCH 21.11 2/2] net/mlx5: fix LRO configuration in drop Rx queue
  2022-05-15 13:18 [PATCH 21.11 0/2] net/mlx5: LRO fixes Michael Baum
  2022-05-15 13:18 ` [PATCH 21.11 1/2] net/mlx5: fix LRO validation in Rx setup Michael Baum
@ 2022-05-15 13:18 ` Michael Baum
  2022-05-19 13:59 ` [PATCH 21.11 0/2] net/mlx5: LRO fixes Kevin Traynor
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Baum @ 2022-05-15 13:18 UTC (permalink / raw)
  To: stable; +Cc: Matan Azrad, Viacheslav Ovsiienko, Kevin Traynor

[ upstream commit 7a9933686574f33ec3444abbc800ac50286510f8 ]

The driver wrongly set the LRO configurations to the TIR of the DevX
drop queue even when LRO is not supported.
Actually, the LRO configuration is not relevant to the drop queue at
all.

This causes failure in the initialization of the device, which doesn't
support LRO where the drop queue is created.

Probably, the drop queue creation by DevX missed the fact that LRO is
set by default in the TIR creation function and didn't unset it in the
drop queue case like other cases that unset LRO.

Move the default LRO configuration to unset it and set it only in the
case of all the TIR queues configured with LRO.

Fixes: bc5bee028ebc ("net/mlx5: create drop queue using DevX")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_devx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index abf6a48086..44c439bb55 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -706,7 +706,7 @@ mlx5_devx_tir_attr_set(struct rte_eth_dev *dev, const uint8_t *rss_key,
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	enum mlx5_rxq_type rxq_obj_type;
-	bool lro = true;
+	bool lro = false;
 	uint32_t i;
 
 	/* NULL queues designate drop queue. */
@@ -715,6 +715,7 @@ mlx5_devx_tir_attr_set(struct rte_eth_dev *dev, const uint8_t *rss_key,
 				mlx5_rxq_ctrl_get(dev, ind_tbl->queues[0]);
 		rxq_obj_type = rxq_ctrl != NULL ? rxq_ctrl->type :
 						  MLX5_RXQ_TYPE_STANDARD;
+		lro = true;
 
 		/* Enable TIR LRO only if all the queues were configured for. */
 		for (i = 0; i < ind_tbl->queues_n; ++i) {
@@ -768,6 +769,7 @@ mlx5_devx_tir_attr_set(struct rte_eth_dev *dev, const uint8_t *rss_key,
 		tir_attr->self_lb_block =
 					MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST;
 	if (lro) {
+		MLX5_ASSERT(priv->config.lro.supported);
 		tir_attr->lro_timeout_period_usecs = priv->config.lro.timeout;
 		tir_attr->lro_max_msg_sz = priv->max_lro_msg_size;
 		tir_attr->lro_enable_mask =
-- 
2.25.1


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

* Re: [PATCH 21.11 0/2] net/mlx5: LRO fixes
  2022-05-15 13:18 [PATCH 21.11 0/2] net/mlx5: LRO fixes Michael Baum
  2022-05-15 13:18 ` [PATCH 21.11 1/2] net/mlx5: fix LRO validation in Rx setup Michael Baum
  2022-05-15 13:18 ` [PATCH 21.11 2/2] net/mlx5: fix LRO configuration in drop Rx queue Michael Baum
@ 2022-05-19 13:59 ` Kevin Traynor
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Traynor @ 2022-05-19 13:59 UTC (permalink / raw)
  To: Michael Baum, stable; +Cc: Matan Azrad, Viacheslav Ovsiienko

On 15/05/2022 14:18, Michael Baum wrote:
> Independent fixes about LRO.
> 
> Michael Baum (2):
>    net/mlx5: fix LRO validation in Rx setup
>    net/mlx5: fix LRO configuration in drop Rx queue
> 
>   drivers/net/mlx5/mlx5_devx.c | 4 +++-
>   drivers/net/mlx5/mlx5_rxq.c  | 8 ++++++++
>   2 files changed, 11 insertions(+), 1 deletion(-)
> 

Thanks Michael, applied.


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

end of thread, other threads:[~2022-05-19 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-15 13:18 [PATCH 21.11 0/2] net/mlx5: LRO fixes Michael Baum
2022-05-15 13:18 ` [PATCH 21.11 1/2] net/mlx5: fix LRO validation in Rx setup Michael Baum
2022-05-15 13:18 ` [PATCH 21.11 2/2] net/mlx5: fix LRO configuration in drop Rx queue Michael Baum
2022-05-19 13:59 ` [PATCH 21.11 0/2] net/mlx5: LRO fixes Kevin Traynor

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).