Netdev List
 help / color / mirror / Atom feed
From: Dragos Tatulea <dtatulea@nvidia.com>
To: jiabin deng <dengjiabin2023@gmail.com>
Cc: netdev@vger.kernel.org, saeedm@nvidia.com, tariqt@nvidia.com,
	 mbloch@nvidia.com, linux-kernel@vger.kernel.org
Subject: Re: mlx5e:zero-prefix corruption during TCP DMA-BUF RX - help requested
Date: Tue, 20 Oct 2026 13:56:13 +0300	[thread overview]
Message-ID: <atZKOtjrb9HKSNHF@dtatulea-c5.nvidia.com> (raw)
In-Reply-To: <CAFxp=AbmdmTsj4ugjxdKhRR=LJuuC1yr7DFnLCSgOpC2g9470g@mail.gmail.com>

Hi Jiabin,

On Thu, Oct 08, 2026 at 02:48:53PM +0800, jiabin deng wrote:
> Hi Dragos,
> 
> Thank you for following up and suggesting the CPU-buffer comparison. We have
> now completed both ordinary CPU TCP and CPU-backed DMA-BUF receive controls,
> with no payload corruption in either 400-iteration run.
> 
> Please find attached a standalone GPU-memory reproducer with a README covering
> the required environment, build instructions, two-host execution, and result
> collection. It includes a Python TCP sender, a C++ receiver using the CUDA
> Driver API and Linux device-memory TCP interfaces, and scripts for SHAMPO
> header tracing and offline byte comparisons.
>
Thank you for the reproducer. Unfortunately I didn't get the right HW to
reproduce this.

Pasting from your previous email:
> One possible lead is an interaction between SHAMPO end eadding and
> Relaxed Ordering writes. In this version, rq_end_pad_mode() disables
> end padding only when LRO is enabled and write RO is supported.
> SHAMPO therefore selects ALIGN; at the same time, write RO is enabled
> on the payload MKey when the device advertises write RO support.
> 
> Commit e2351e517068 ("net/mlx5e: RX, Avoid possible data corruption
> when relaxed ordering and LRO combined") describes a related issue
> with consecutively placed LRO payloads. We would like to understand
> whether SHAMPO might also need to account for a similar situation.
> We do not yet have results from padding/RO diagnostic experiments.
Initially I dismissed this commit because it seemed unrelated. But now
I see that you analysis was probably spot on.

So disabling alignment padding mode is definetly a very useful experiment.
It would go in the lines of:

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
index 70a855c6d19c..794d8be88f0c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -911,10 +911,11 @@ static void mlx5e_build_rx_cq_param(struct mlx5_core_dev *mdev,
 
 static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
 {
-       bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO;
+       bool no_pad = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO ||
+                     params->packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO;
        bool ro = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
 
-       return ro && lro_en ?
+       return ro && no_pad ?
                MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN;
 }

Could you try this please and let us know if you still encounter the
issue? In the meantime I am checking about this with other people.

Thanks,
Dragos

      reply	other threads:[~2026-10-20 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  1:49 mlx5e:zero-prefix corruption during TCP DMA-BUF RX - help requested jiabin deng
2026-09-15 12:21 ` Dragos Tatulea
2026-09-18  6:06   ` jiabin deng
2026-09-29  9:49     ` Dragos Tatulea
2026-10-08  6:48       ` jiabin deng
2026-10-20 10:56         ` Dragos Tatulea [this message]

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=atZKOtjrb9HKSNHF@dtatulea-c5.nvidia.com \
    --to=dtatulea@nvidia.com \
    --cc=dengjiabin2023@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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