From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: <a.schollmeyer@syseleven.de>
Cc: <dev@dpdk.org>, Michael Rossberg <michael.rossberg@tu-ilmenau.de>,
"Erez Ferber" <erezf@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Subject: Re: [PATCH] net/mlx5: store rxq MTU at allocation time
Date: Tue, 28 Oct 2025 11:40:39 +0100 [thread overview]
Message-ID: <20251028104039.7lz53rweay3i4c5c@ds-vm-debian.local> (raw)
In-Reply-To: <20251028100144.36284-1-a.schollmeyer@syseleven.de>
Hi,
Thank you very much for your contribution.
Code looks good to me. Please see a small comment below.
On Tue, Oct 28, 2025 at 11:01:44AM +0100, a.schollmeyer@syseleven.de wrote:
> From: Adrian Schollmeyer <a.schollmeyer@syseleven.de>
>
> For shared Rx queues, equal MTU for all ports sharing queues is enforced
> using mlx5_shared_rxq_match() to make sure, the memory allocated in the
> Rx buffer is large enough. The check uses the MTU as reported by the
> ports' private dev_data structs, which contain the MTU currently set for
> the device. In case one port's MTU is altered after Rx queues are
> allocated and then a second port joins the shared Rx queue with the old,
> yet correct MTU, the check fails despite the fact that the Rx buffer
> size is correct for both ports.
>
> This patch adds a new entry to the Rx queue control structure that
> captures the MTU at the time the Rx buffer was allocated, since this is
> the relevant information that needs to be checked when a port joins a
> shared Rx queue.
>
> Fixes: 09c2555303be ("net/mlx5: support shared Rx queue")
The offending patch was part of 21.11,
so this fix is a candidate for backporting to previously released LTS versions.
Could you send a v2 patch with "Cc: stable@dpdk.org" added after "Fixes" tag?
When sending this change, could you also please send the patch directly to mlx5 maintainers as well?
There's a script in DPDK repository which would add relevant people
based on the changed files - devtools/get-maintainer.sh
It's usage is described in here: https://doc.dpdk.org/guides/contributing/patches.html#sending-patches
>
> Signed-off-by: Adrian Schollmeyer <a.schollmeyer@syseleven.de>
> ---
> drivers/net/mlx5/mlx5_rx.h | 1 +
> drivers/net/mlx5/mlx5_rxq.c | 6 +++++-
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
> index 6380895502..58bc2c9f21 100644
> --- a/drivers/net/mlx5/mlx5_rx.h
> +++ b/drivers/net/mlx5/mlx5_rx.h
> @@ -169,6 +169,7 @@ struct __rte_cache_aligned mlx5_rxq_data {
> /* RX queue control descriptor. */
> struct mlx5_rxq_ctrl {
> struct mlx5_rxq_data rxq; /* Data path structure. */
> + uint16_t mtu; /* Original MTU that the queue was allocated with. */
> LIST_ENTRY(mlx5_rxq_ctrl) next; /* Pointer to the next element. */
> LIST_HEAD(priv, mlx5_rxq_priv) owners; /* Owner rxq list. */
> struct mlx5_rxq_obj *obj; /* Verbs/DevX elements. */
> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
> index 5cf7d4971b..c652204ea8 100644
> --- a/drivers/net/mlx5/mlx5_rxq.c
> +++ b/drivers/net/mlx5/mlx5_rxq.c
> @@ -773,7 +773,7 @@ mlx5_shared_rxq_match(struct mlx5_rxq_ctrl *rxq_ctrl, struct rte_eth_dev *dev,
> dev->data->port_id, idx);
> return false;
> }
> - if (priv->mtu != spriv->mtu) {
> + if (priv->mtu != rxq_ctrl->mtu) {
> DRV_LOG(ERR, "port %u queue index %u failed to join shared group: mtu mismatch",
> dev->data->port_id, idx);
> return false;
> @@ -1799,6 +1799,10 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
> }
> LIST_INIT(&tmpl->owners);
> MLX5_ASSERT(n_seg && n_seg <= MLX5_MAX_RXQ_NSEG);
> + /*
> + * Save the original MTU to check against for shared rx queues.
> + */
> + tmpl->mtu = dev->data->mtu;
> /*
> * Save the original segment configuration in the shared queue
> * descriptor for the later check on the sibling queue creation.
> --
> 2.34.1
>
Best regards,
Dariusz Sosnowski
next prev parent reply other threads:[~2025-10-28 10:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251028095502.1CFB21261CB@dpdk.org>
2025-10-28 10:01 ` a.schollmeyer
2025-10-28 10:40 ` Dariusz Sosnowski [this message]
2025-10-28 9:52 a.schollmeyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251028104039.7lz53rweay3i4c5c@ds-vm-debian.local \
--to=dsosnowski@nvidia.com \
--cc=a.schollmeyer@syseleven.de \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=erezf@nvidia.com \
--cc=matan@nvidia.com \
--cc=michael.rossberg@tu-ilmenau.de \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).