[Jetson Thor / T264] MGBE RX data corruption with "dma-coherent" - is MGBE really IO-coherent?

Hi,

We see silent RX data corruption on the Thor MGBE (25G) and traced it to cache coherency.
Could you help confirm the expected coherency configuration of MGBE on T264?

== Setup ==

  • Module: Jetson Thor T5000 (p3834-0008) on our carrier board
  • BSP: R39.2.1 nvethernet (OOT) on a Linux 6.6 kernel; DT based on the SDK tegra264.dtsi
  • MGBE0-3 at 25G fixed-link, FEC off, MTU 1466 (MACsec enabled), rx-checksumming on
  • EMC/MCF/SCF locked at max clock (bwmgr halted)
  • dmesg (smmu0, MGBE is behind it): “IDR0.COHACC overridden by FW configuration (false)”

== Test ==

  • Ubuntu host (bnxt_en 25G) mounts an SMB share on the Thor, runs fio randrw, bs=512K,
    iodepth=128, direct=1, verify=crc32c.
  • Fails in 4 min to 2h15m: verify error in the written data.

== Symptom ==

  • One contiguous 56-62 byte run of wrong data per failure, always inside one 64-byte cache line
    (62 B = second cache line of a page-aligned RX buffer after 66 B of eth/ip/tcp headers).
  • Wrong bytes are older data from the same flow, not bit errors. mmc_rx_crc_error does not
    increase, and the MAC’s RX checksum check passes.
  • The same test over a PCIe 25G NIC (bnxt_en) and a local fio run on the Thor: 0 errors in 4h.

== What we found ==

  1. With rx-checksumming off: 0 verify errors, but TcpInCsumErrors increases (+58 in 2h) while
    mmc_rx_tcp_err stays 0. The frame is good at the MAC and goes bad after DMA, when the CPU reads it.
  2. Adding dma_rmb() after the RX descriptor OWN check did not help (fails in 4 min), so CPU load
    reordering is ruled out.
  3. A debug hook in osd_receive_packet() compared the CPU-copied data against a re-read after
    “dc ivac”: the CPU read a stale cache line while memory held the correct data
    (162 stale hits in 2h). Invalidating the buffer before the CPU reads it: 0 errors in 2h.
  4. Workaround: removing “dma-coherent” from mgbe0-3 in our board DTS, so that
    dma_sync_single_for_cpu() invalidates. Result: 6h+ with no errors.

== Questions ==

  1. Is MGBE on T264 designed to be IO-coherent? If yes, what FW/MB1/BPMP configuration is
    required, and why does smmu0 report COHACC = false?
  2. Is “dma-coherent” on mgbe0-3 in the SDK tegra264.dtsi correct for R39.2.1? Is there a
    known issue or a fix in a later release?
  3. Is removing “dma-coherent” (non-coherent DMA with cache maintenance) the recommended
    workaround? Are there any side effects we should be aware of (performance, MACsec, PTP)?
  4. Do other DMA masters behind smmu0 have the same concern?

The attached package contains the test logs and the test method. It is fairly large, so I
suggest feeding it to an AI agent for analysis; start with ANALYSIS.md.

Thanks,

nvidia_fae_attach.tar.gz (5.0 MB)

Yes, it expects to have IO-coherent. Please check if your issue is able to reproduce with devkit to devkit connection and how to reproduce the issue for us to do analysis.

Hi,

Any feedback for this?

Hi,
All my resources are busy. i will check devkit behavior next week. Then, update the result here.
Thanks

Hi @WayneWWW and @kasfenlee,

We observed a similar stale-data symptom on two Thor T5000 systems. This is a different BSP/kernel from the original report:

  • L4T R39.2.0; kernel 6.8.12-1021-tegra; nvethernet OOT driver.
  • Four MGBE links at 25 Gb/s, MTU 8932; all four running DT nodes declare dma-coherent.
  • Actual carrier-board PCB revisions have not been independently verified, so we are not claiming a stock NVIDIA devkit-to-devkit reproduction.

Our confirmed failing workload is still a two-node GPU/model workload, with RX checksum offload enabled on all eight MGBE interfaces. The copper-cable retest failed after 48 min 47 s:

  1. A 32-byte TCP payload captured at the receiving endpoint differed from the corresponding sending-endpoint payload.
  2. All 32 incorrect bytes matched older data from the same flow, received 565,891 microseconds earlier.
  3. The received payload failed an independently calculated TCP checksum. Its TCP checksum field matched the checksum required by the correct sender payload.
  4. None of the eight interfaces’ recorded MAC RX CRC error counters increased during the observation window.
  5. The application reported a frame/sequence/shape mismatch, then peer closure; four concurrent API requests failed.

These are endpoint captures, with offload and capture drops, not an external wire capture. They do not yet establish whether the cause is cache coherency, DMA ordering, or RX-bufferreuse. Disassembly of our loaded driver confirms dma_sync_single_for_cpu() before the RX copy; we have not verified whether the active DMA implementation performs cache maintenance on that path.

For a model-free reduction, I have attached mgbe_http_verify.py, a single-file Python 3 standard-library HTTP/SHA-256 integrity test. It rotates random files over persistent concurrent TCP connections, binds both ends to explicit data-rail IPs, and stops on the first mismatch. IMPORTANT: this reduced script is a candidate, not a confirmed Thor reproducer. Its normal and corruption-detection paths have only been validated locally on loopback. Earlier standalone TCP controls did not reproduce the corruption either.

With the two data-rail addresses already configured and reachable, for example:

On the sending peer:

python3 mgbe_http_verify.py serve \
  --bind 10.254.23.2 --port 31080 \
  --directory /tmp/mgbe-http-data-A

On the receiving Thor, record the original RX setting, enable it for an isolated test, and verify that it stays enabled:

ethtool -k mgbe3_0 > rx-before.txt
ethtool -S mgbe3_0 > nic-before.txt
nstat -az > nstat-before.txt
sudo ethtool -K mgbe3_0 rx on
ethtool -k mgbe3_0

python3 mgbe_http_verify.py check \
  --host 10.254.23.2 --bind 10.254.23.1 --port 31080 \
  --workers 8 --seconds 43200 --out /tmp/mgbe-http-rxon-A

The addresses above are examples; use the actual data-rail addresses, not the management interface. Results include events.jsonl and summary.json; on a hash/length mismatch, received-bad.bin is retained. A transport/HTTP failure is reported separately from an integrity mismatch. The server’s original files and manifest must also be preserved.

After the test, collect the same counters and restore the recorded RX setting. An RX-off comparison should use the same server files, a new output directory, and otherwise unchangedsettings. Reverse the direction and repeat on other rails as needed. A no-mismatch result does not establish that the issue is fixed, since this reduction differs from the confirmedGPU workload.

Could NVIDIA suggest a diagnostic to distinguish stale CPU cache data from descriptor/data ordering or page-pool reuse on this BSP? Also, is there a validated coherency configuration or firmware/driver fix that retains hardware RX checksum offload without adding per-packet software cache maintenance?

mgbe-http-candidate.tar.gz (8.1 KB)

Hi @luhua.ei

Thanks for the info. Could you also check if removing dma-coherent from the device tree of MGBE node would make issue gone on your side?

Disabling RX checksum offload currently works as a temporary workaround on our systems. The kernel then verifies TCP/UDP checksums in software instead of relying on hardware
checksum validation.

for nic in mgbe0_0 mgbe1_0 mgbe2_0 mgbe3_0; do
    sudo ethtool -K "$nic" rx off || break
  done

I will also test removing dma-coherent from the MGBE device tree nodes and report the results.

Any news on stripping the dma-coherent?

Hi,

We can confirm that removing dma-coherent from the MGBE device tree nodes resolves the RX data corruption and packet reordering issues on our Jetson Thor systems.

However, this workaround comes with a noticeable performance penalty, particularly for single-stream TCP throughput, as shown by our iperf3 measurements:

With dma-coherent:

[ ID] Interval       Transfer     Bitrate        Retr
[  5] 0.00-10.00 sec  8.79 GBytes   7.55 Gbits/sec  50  sender
[  5] 0.00-10.00 sec  8.78 GBytes   7.54 Gbits/sec      receiver

Without dma-coherent:

[ ID] Interval       Transfer     Bitrate        Retr
[  5] 0.00-10.00 sec  3.79 GBytes   3.25 Gbits/sec  20  sender
[  5] 0.00-10.00 sec  3.77 GBytes   3.24 Gbits/sec      receiver

This represents approximately a 57% reduction in single-stream TCP throughput.

While removing dma-coherent appears to be an effective workaround for the data integrity issues, the performance impact is significant.

Since MGBE on T264 is expected to be I/O-coherent, is there a firmware or driver fix that would allow us to keep dma-coherent enabled without experiencing RX data corruption or packet reordering?

Hi @nazaraa

We are still checking this internally.

Hi,

Please try with this patch.

mgbe-rx.patch (21.1 KB)

Thank you for providing the patch!

The patch applies cleanly to L4T 38.4.0, but it does not apply to L4T 39.2.1, which is the version we used for our testing.

Could you please provide an updated version of the patch that applies cleanly to the kernel sources included in L4T 39.2.1?

please try this for 39.2.1.

5c54eca.diff.zip (7.1 KB)

Hi Wayne,

Your patch looks like it may fix the issue. The original problem could be reproduced within about 3 hours, and so far we have not seen any
verify failures. We will keep monitoring for 2 more days and will update you with the status and results then.

Thanks!