* [PATCH] net/mlx5: update stored Rx queue MTU when port MTU changes
@ 2025-11-17 7:39 Shani Peretz
2025-11-18 9:52 ` Adrian Schollmeyer
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [PATCH] net/mlx5: update stored Rx queue MTU when port MTU changes
2025-11-17 7:39 [PATCH] net/mlx5: update stored Rx queue MTU when port MTU changes Shani Peretz
@ 2025-11-18 9:52 ` Adrian Schollmeyer
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Schollmeyer @ 2025-11-18 9:52 UTC (permalink / raw)
To: Shani Peretz, dev
Cc: rasland, Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao,
Ori Kam, Suanming Mou, Matan Azrad
[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]
Hi,
Am Montag, dem 17.11.2025 um 09:39 +0200 schrieb Shani Peretz:
> 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.
If you read the commit message of the offending patch, this was in fact
intentional. The MTU at allocation time is relevant when joining a Rx
share group, as it is (to the best of my knowledge) the only MTU
setting that actually has an influence on the size of the packet
buffers. Therefore, it is the value which is relevant for sharing
packet buffers.
I've tested your patch again with the prototype I used to discover the
original bug and unfortunately it reappears.
Best regards,
Adrian
--
Adrian Schollmeyer
SysEleven GmbH
Boxhagener Straße 80
10245 Berlin
T +49 30 / 23 32 012-0
F +49 30 / 61 67 55 5-0
https://www.syseleven.de
https://www.linkedin.com/company/syseleven-gmbh
Current system status always at:
https://www.syseleven-status.net/
Company headquarters: Berlin
Registered court: AG Berlin Charlottenburg, HRB 108571 Berlin
Managing directors: Andreas Hermann, Jens Ihlenfeld, Jens Plogsties,
Andreas Rückriegel
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-18 9:52 UTC | newest]
Thread overview: 2+ messages (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
2025-11-18 9:52 ` Adrian Schollmeyer
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).