Skip to contentSkip to conversation

net/mlx5: fix rss reta is reset when device is started

PATCH In review Maxime Leroy 3 participants 4 messages Jul 16, 2020 – Sep 15, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix rss reta is reset when device is started

The following sequences was working fine on mlx5:
rte_eth_dev_configure(portid, ...);

   for (queueid = 0; queueid < nb_txq; queueid++)
      rte_eth_tx_queue_setup(portid, queueid, ...);

   for (queueid = 0; queueid < nb_rxq; queueid++)
      rte_eth_rx_queue_setup(portid, queueid, ...);
  // use a custom reta configuration
  rte_eth_dev_rss_reta_update(portid, reta_conf, reta_size);
  rte_eth_dev_start(portid);

We were able to configure a custom reta before starting the port.

The commit "net/mlx5: support RSS on hairpin" breaks this logic by moving the code initializing the RSS reta from rte_eth_dev_configure into rte_eth_dev_start.

To fix the issue, the skip_default_rss_reta is always set to 1 in rte_eth_dev_rss_reta to avoid reconfigure the rss reta when the device is started.

Fixes 63bd16292c3a ("net/mlx5: support RSS on hairpin")
---
 drivers/net/mlx5/mlx5_rss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_rss.c +3 -1
index 653b0691..6f75ece2 100644
@@ -220,9 +220,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,
 		MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n);
 		(*priv->reta_idx)[i] = reta_conf[idx].reta[pos];
 	}
+
+	priv->skip_default_rss_reta = 1;
+
 	if (dev->data->dev_started) {
 		mlx5_dev_stop(dev);
-		priv->skip_default_rss_reta = 1;
 		return mlx5_dev_start(dev);
 	}
 	return 0;
Signature · 1 line
2.27.0
#1 lore raw

Hi Raslan,

Any comment/review on the fix ?

Regards,

Maxime

Quoted 50 lines · Maxime Leroy

The following sequences was working fine on mlx5:

   rte_eth_dev_configure(portid, ...);

   for (queueid = 0; queueid < nb_txq; queueid++)
      rte_eth_tx_queue_setup(portid, queueid, ...);

   for (queueid = 0; queueid < nb_rxq; queueid++)
      rte_eth_rx_queue_setup(portid, queueid, ...);
  // use a custom reta configuration
  rte_eth_dev_rss_reta_update(portid, reta_conf, reta_size);
  rte_eth_dev_start(portid);

We were able to configure a custom reta before starting the port.

The commit "net/mlx5: support RSS on hairpin" breaks this logic by moving the code initializing the RSS reta from rte_eth_dev_configure into rte_eth_dev_start.

To fix the issue, the skip_default_rss_reta is always set to 1 in rte_eth_dev_rss_reta to avoid reconfigure the rss reta when the device is started.

Fixes 63bd16292c3a ("net/mlx5: support RSS on hairpin")
---
 drivers/net/mlx5/mlx5_rss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_rss.c +3 -2
index 653b0691..6f75ece2 100644
@@ -220,9 +220,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,
                MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n);
                (*priv->reta_idx)[i] = reta_conf[idx].reta[pos];
        }
+
+       priv->skip_default_rss_reta = 1;
+
        if (dev->data->dev_started) {
                mlx5_dev_stop(dev);
-               priv->skip_default_rss_reta = 1;
                return mlx5_dev_start(dev);
        }
        return 0;
--

2.27.0

Acked-by
#2 lore raw
Quoted 7 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Maxime Leroy

Hi Raslan,

Quoted 35 lines

Any comment/review on the fix ?

Regards,

Maxime

Quoted 27 lines · Maxime Leroy

The following sequences was working fine on mlx5:

   rte_eth_dev_configure(portid, ...);

   for (queueid = 0; queueid < nb_txq; queueid++)
      rte_eth_tx_queue_setup(portid, queueid, ...);

   for (queueid = 0; queueid < nb_rxq; queueid++)
      rte_eth_rx_queue_setup(portid, queueid, ...);
  // use a custom reta configuration
  rte_eth_dev_rss_reta_update(portid, reta_conf, reta_size);
  rte_eth_dev_start(portid);

We were able to configure a custom reta before starting the port.

The commit "net/mlx5: support RSS on hairpin" breaks this logic by moving the code initializing the RSS reta from rte_eth_dev_configure into rte_eth_dev_start.

To fix the issue, the skip_default_rss_reta is always set to 1 in rte_eth_dev_rss_reta to avoid reconfigure the rss reta when the device is started.

Fixes 63bd16292c3a ("net/mlx5: support RSS on hairpin")

---

Thanks,
Ori

#3 lore raw
In reply to Maxime Leroy

Hi,

Quoted 53 lines

-----Original Message-----
From: Maxime Leroy <[email protected]>
Sent: Thursday, July 16, 2020 1:43 PM
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH] net/mlx5: fix rss reta is reset when device is started

The following sequences was working fine on mlx5:

   rte_eth_dev_configure(portid, ...);

   for (queueid = 0; queueid < nb_txq; queueid++)
      rte_eth_tx_queue_setup(portid, queueid, ...);

   for (queueid = 0; queueid < nb_rxq; queueid++)
      rte_eth_rx_queue_setup(portid, queueid, ...);
  // use a custom reta configuration
  rte_eth_dev_rss_reta_update(portid, reta_conf, reta_size);
  rte_eth_dev_start(portid);

We were able to configure a custom reta before starting the port.

The commit "net/mlx5: support RSS on hairpin" breaks this logic by moving the code initializing the RSS reta from rte_eth_dev_configure into rte_eth_dev_start.

To fix the issue, the skip_default_rss_reta is always set to 1 in rte_eth_dev_rss_reta to avoid reconfigure the rss reta when the device is started.

Fixes 63bd16292c3a ("net/mlx5: support RSS on hairpin")
---
 drivers/net/mlx5/mlx5_rss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_rss.c +3 -1
index 653b0691..6f75ece2 100644
@@ -220,9 +220,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev
 *dev,
 		MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n);
 		(*priv->reta_idx)[i] = reta_conf[idx].reta[pos];
 	}
+
+	priv->skip_default_rss_reta = 1;
+
 	if (dev->data->dev_started) {
 		mlx5_dev_stop(dev);
-		priv->skip_default_rss_reta = 1;
 		return mlx5_dev_start(dev);
 	}
Quoted 3 lines

return 0;
--
2.27.0

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh