* [PATCH] net/mlx5: update stored Rx queue MTU when port MTU changes
@ 2025-11-17 7:39 Shani Peretz
0 siblings, 0 replies; only message in thread
From: Shani Peretz @ 2025-11-17 7:39 UTC (permalink / raw)
To: dev
Cc: rasland, Shani Peretz, Dariusz Sosnowski, Viacheslav Ovsiienko,
Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad,
Adrian Schollmeyer
Offending commit added rxq_ctrl->mtu to track MTU at queue
allocation time for validating shared RX queue compatibility.
When MTU changes via rte_eth_dev_set_mtu(), only priv->mtu was
updated, leaving rxq_ctrl->mtu with the old value. This caused
shared RX queue matching to fail with "mtu mismatch" errors when
ports reconfigured (e.g., enabling buffer_split offload), even
when all ports had identical MTU settings.
Update rxq_ctrl->mtu for all queues when port MTU changes to
keep metadata synchronized with actual port MTU.
Fixes: 4414eb800708 ("net/mlx5: store MTU at Rx queue allocation time")
Signed-off-by: Shani Peretz <shperetz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/mlx5_ethdev.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 7747b0c869..7bec64c847 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -676,6 +676,7 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
{
struct mlx5_priv *priv = dev->data->dev_private;
uint16_t kern_mtu = 0;
+ unsigned int i;
int ret;
ret = mlx5_get_mtu(dev, &kern_mtu);
@@ -684,6 +685,17 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
if (kern_mtu == mtu) {
priv->mtu = mtu;
+ /*
+ * Update the MTU stored in RX queue control structures.
+ * This is necessary for shared RX queues to correctly match
+ * the MTU when ports try to join the shared group.
+ */
+ for (i = 0; i < priv->rxqs_n; i++) {
+ struct mlx5_rxq_priv *rxq = mlx5_rxq_get(dev, i);
+
+ if (rxq != NULL && rxq->ctrl != NULL)
+ rxq->ctrl->mtu = mtu;
+ }
DRV_LOG(DEBUG, "port %u adapter MTU was already set to %u",
dev->data->port_id, mtu);
return 0;
@@ -698,6 +710,17 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
return ret;
if (kern_mtu == mtu) {
priv->mtu = mtu;
+ /*
+ * Update the MTU stored in RX queue control structures.
+ * This is necessary for shared RX queues to correctly match
+ * the MTU when ports try to join the shared group.
+ */
+ for (i = 0; i < priv->rxqs_n; i++) {
+ struct mlx5_rxq_priv *rxq = mlx5_rxq_get(dev, i);
+
+ if (rxq != NULL && rxq->ctrl != NULL)
+ rxq->ctrl->mtu = mtu;
+ }
DRV_LOG(DEBUG, "port %u adapter MTU set to %u",
dev->data->port_id, mtu);
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-17 7:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 7:39 [PATCH] net/mlx5: update stored Rx queue MTU when port MTU changes Shani Peretz
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).