🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27039

thunderbolt-net: no traffic with an M5 Mac, per-frame CRC32C is little-endian

#27039
From: Felipe Cruz
Date: Fri, 04 Dec 2026 16:52
116 lines
16504 bytes
Hi Mika, Yehezkel,

Before I send patches I would like to check my understanding of a
ThunderboltIP interoperability problem, and ask how you would like it
handled.

Setup:

  Linux:  AMD Rembrandt USB4 host, NHI 1022:162e, kernel 7.2 (also
          built against net-next)
  Mac:    MacBook Pro M5 (Mac17,2), macOS 27.0.1, XDomain vendor 0x0a27
          device 0x000a, link 2 x 20 Gb/s

Symptom: the XDomain handshake and ThunderboltIP login complete and
thunderbolt0 comes up, but no data gets through in either direction.
Every frame from the Mac completes with RING_DESC_CRC_ERROR, and the
Mac silently drops every frame Linux sends.

What I found by putting the Rx ring in raw mode (no RING_FLAG_FRAME)
and capturing what the Mac sends:

 - Each frame arrives as Thunderbolt packets of up to 256 bytes with
   PDF 1 (start), 0 (middle) and 2 (end). A frame that fits into one
   packet has PDF 2 only.
 - After the payload comes one CRC32C per frame (init ~0, reflected,
   xorout ~0), the same CRC the control channel uses, but stored
   little-endian. ctl.c writes it big-endian. All 17 captured frames
   match the little-endian CRC and none match the big-endian one.

So the frame mode CRC on this AMD host and the Mac disagree on byte
order. What I cannot tell from here is which side is the odd one:

 1. Is the frame mode CRC byte order fixed by the USB4 spec, and do
    you know whether Intel hosts behave the same as this AMD one? I
    only have this one Linux machine and this one Mac. If Linux to
    Apple silicon networking works on Intel hosts, the problem is
    AMD-specific (and maybe a missing NHI setting) rather than an
    Apple quirk.

 2. Is there a way to make the host router use the other byte order
    in frame mode? I found nothing in nhi_regs.h, and I do not have
    the AMD documentation.

 3. If neither works, would a software path be acceptable upstream?
    I have a working prototype: both rings raw, and the driver splits
    frames into 256-byte packets, appends the little-endian CRC on
    Tx, and reassembles and checks the CRC on Rx. It is opt-in and
    the default path is unchanged. How should it be enabled? I would
    rather not add a module parameter. Would keying on the XDomain
    vendor/device (and maybe the host NHI) be the right approach?

Prototype status, so you know what to expect: pings of 56 to 16000
bytes and transfers of up to 512 MiB in both directions with matching
SHA-256. Linux to Mac reaches about 3.7 Gbit/s. Mac to Linux is only
about 45 Mbit/s, with some frames lost, because each 256-byte raw
packet takes a full Rx ring slot and the ring only holds 64 KiB. I
have not yet looked at how Rx E2E behaves with raw rings, which may
be related given the recent Tx E2E revert (1881f2efbf7f).

A separate, smaller issue with the same Mac: after thunderbolt_net is
reloaded, macOS answers the old instance's logout with a logout of its
own once the new instance is up. The driver then waits for the remote
host to log in again, macOS waits for us, and the link stays down
until the cable is replugged. Restarting login from
tbnet_disconnect_work() while the interface is up fixes it. I will
send that as its own patch.

Unrelated to the CRC, but in case it matters: once logged in, the Mac
sends an XDomain properties changed request about every 1.5 seconds,
and we re-read its properties each time, for as long as the link is
up.

Below is an excerpt of a log from the stock 7.2 driver (thunderbolt and
thunderbolt_net with dyndbg=+p) after replugging the cable, followed
by the counters after 8 failed pings. I can send the full log, the raw
captures, the CRC check script and the prototype if they are useful.

I searched the archives and found no earlier report of this. The
closest is a CachyOS report of no traffic between an ASM4242 host and
macOS, which may or may not be the same problem.

Thanks,
Felipe


Log excerpt:

[20798.483382] thunderbolt 0-2: new host found, vendor=0xa27 device=0xa
[20798.483596] thunderbolt 0-2: Apple Inc. Mac17,2
[20798.504624] thunderbolt-net 0-2.0 thunderbolt0: login started
[20798.581037] thunderbolt-net 0-2.0 thunderbolt0: remote login request received
[20799.506134] thunderbolt-net 0-2.0 thunderbolt0: sending login request, retries=0
[20799.690033] thunderbolt-net 0-2.0 thunderbolt0: received login reply
[20799.690519] thunderbolt-net 0-2.0 thunderbolt0: login successful, enabling paths
[20799.691317] thunderbolt 0000:e6:00.5: enabling E2E for RX ring 1 with TX HopID 1
[20799.694029] thunderbolt-net 0-2.0 thunderbolt0: network traffic started
[...]
[20800.338054] thunderbolt 0-2: running state PROPERTIES
[20800.675074] thunderbolt 0000:e6:00.5: 2: received XDomain properties changed request
[20800.778054] thunderbolt 0-2: running state ENUMERATED
[20801.810123] thunderbolt 0-2: running state PROPERTIES
[20802.177047] thunderbolt 0000:e6:00.5: 2: received XDomain properties changed request
[20802.282046] thunderbolt 0-2: running state ENUMERATED
[... repeats every ~1.5 s]

21: thunderbolt0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 02:76:86:8a:82:8f brd ff:ff:ff:ff:ff:ff
    RX:  bytes packets errors dropped  missed   mcast
             0       0     79       0       0       0
    RX errors:  length    crc   frame    fifo overrun
                     0     79       0       0       0
    TX:  bytes packets errors dropped carrier collsns
          4403      39      0      17       0       0
    TX errors: aborted   fifo  window heartbt transns
                     0      0       0       0       2
Technical Details
Message-ID: <20261204165248.479627-1-felipecruz@gmail.com>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377503-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377503-linux-kernel-netdev=dewy.ru
From: felipecruz@gmail.com (Felipe Cruz)
Newsgroups: linux.kernel.netdev
Subject: thunderbolt-net: no traffic with an M5 Mac, per-frame CRC32C is little-endian
Date: Fri,  4 Dec 2026 17:52:48 +0100
Organization: Usenet Network
Message-ID: <20261204165248.479627-1-felipecruz@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2811815"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eaV5R+rsyUgN3s3SYUzzxz+hGa0= sha256:DNY7RMHNNC1YLtMbk2srkzPkV7tCA+vHrnWgQEeYjXA=
	sha1:sdZ994SN8Pm7FxW4+lF/cHtcVV0= sha256:/D9loqhuPIYl4fqIX1g0tg1loCdevP7Ytv9gVdQzwkA=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 14498117C76; Fri,  4 Dec 2026 19:53:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.297
X-Spam-Status: No, score=-2.297 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id bvzXpR3hHrWg;
	Fri,  4 Dec 2026 19:53:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377503-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 9BE7C117C75; Fri,  4 Dec 2026 19:52:57 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id D2BC427871; Fri,  4 Dec 2026 16:52:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796403173;
	b=yurGX6gtSrW/rkpHaNJvpY41QNmX1/lU1+CSMSWGyTu5m+XessQFBBVrPtXbYGPYCKC/
	 HkgQDSqZpToJ69eBXOkg2I+Kdf7QBXt629gyEf8lpJYRcNW5+TTiX8AToVK5uMQGwjECa
	 xf0PorAGca4gbVJahmEOsJZoNdHOnCQJMv0G0HWZEsOyGbcKNlNZrPrFMbN1sJ0wjEWQ+
	 ABCBFHNhybQmFst9ci3atqLDLx7kRVgNohjWvcUO/zFeVedcNhryBJpn871fOQb97j20C
	 CPFkIBjVR8lo9m9bL47CCEt2UYJuDxnUwBotxPhKMhQEWvimb8j5jy/BuUy+wrr9YKQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796403173;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=84gXdYZRfs4kMFANCd6YbVIWGHbl26U1NlSgKm0lg60=;
	b=ZLw6j5jFMGZNlmCLNafPvQkD7F3TuEHviGkzXOvfWvCv6nmrg2lCBOy6h4l4KuAokhLY
	 9DhhkYrzOhcSMQnSd5hC+WWd9L1jFSHPiyyTWJrHVEaPWl4p2seSzw7a8DZtMhlDD5UmK
	 OcEHaHJNsjyfvQet43UDftUDDaHcXME0v7P4kwEhpOknOyK/JQZcJHuMUhqiG5L9k+7Yq
	 ofOdAYYyZDjOqzl0qwp0R1mm2L2l1K5jlCvDGe4+PUQ0tij1umHKSJCsroo48X23yTVrn
	 7ZzJhQCBxhdYNyntAjtbjAvt0mzYuX5bZ8nitnPgwRkynSh8IxIlvXUFjWMmuXn+1Iw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=mujWGqw7;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BF4C606A33E;
	Fri,  4 Dec 2026 16:52:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=mujWGqw7
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796403172;
	b=hPYIjOS2uRollT31PcoLwTgWN1ZsG4YULMFjUhbLc1CV48RHwOHB6RDuM11O8Mm4HFLm
	 T1Tx/tUY6zFdjDFzgcAx/Z+pxKuhnlUw+hf96u4tGdtjGHOJaV+l2UiPEAiroT9fnRY/Z
	 0cJqvNAdAKb8f5kOlGowKLcujqjChjQy8ZMqLHJrYA8kn8gPc0lc3uxYDyWMOBjZe6eIf
	 Ez8G4Ts93OZlWffHiXqAvdmvsKYDqaw1Cjud81vzk8AEhcX9yY0Ow/ZpwguqDHjrlJZ3r
	 q8FHON8+Bhw9Vf3dyZAvvxFP3YNfmCRnDKsDWz6dox2/H7fYLEa4gJu7ZHBTILR4fFA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796403172;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=84gXdYZRfs4kMFANCd6YbVIWGHbl26U1NlSgKm0lg60=;
	b=DTfkVaYpWy8FzojCm2Sw2MZ9PcyL2LxXjLHLlduAMQGLgMAcqEoAQdeK1RyCblfgM77r
	 k1Buj+jxcsPdq308swDtQOzoDLB+rSQ5UDBLJ7AvTb8eFBhQ6LHnbAcy3oS8jXEZ8B4er
	 BJlLHD8GVvFW/85J/1AbdKReJO/QgTNa2+va6ml0e8ctrvUcVxxu+pe6N7ycolDpot3jy
	 ja5OCocOk6YoNVzyHc3ZrKf0vv5ZLSlguXF76jhyjKY6ZtV5wLDDlnMPS0Nt8F/Q1XfOp
	 JqVUbU+qY1pmf8RDo0O54hUGfrUYB8ED2p+4GnSEsILu8xgGrXr8rg71jcX9ZnpcMPw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=mujWGqw7;
	arc=none smtp.remote-ip=209.85.128.47
X-Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2CC1606A332
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 16:52:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2CC1606A332
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4a5177d78c7so11596525e9.2
        for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 08:52:51 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796403170; x=1797007970; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=84gXdYZRfs4kMFANCd6YbVIWGHbl26U1NlSgKm0lg60=;
        b=mujWGqw7JBRN8cchXTWEyA1aW73D9nlBR8Uv6OyilZq3RcBu7MDMH73P6p9Nwvwg/l
         8RGLqE4cUUsWpU3dLL1R7AZJAtX6ZBw6hrp7qTnSk87CBoBt3dgPw6cKW6HGuCuNeMZK
         l9VQH8YrvnqXnsaMl2kkrH+E5a7dniw9HfBkv0zJTYmuHREv7CZIwiIs43H34G54nUQY
         Y91r/RrqSv+PHymaZaIaadpb7+U2CEeWUXTOX4NM3CT6w0zJIPq4VnYLhdQglJMsP5aB
         eHSr8GP6//CgPvVVkm2wo895l4SnVXemlT3XLEo9aoMRIthbmVnCuyaPJ+8iEyDaM6Io
         uebg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796403170; x=1797007970;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=84gXdYZRfs4kMFANCd6YbVIWGHbl26U1NlSgKm0lg60=;
        b=2ILVmW0Can9Iu2tRccTNEaYWkXwSxM0sXLXsi2SAHOAatMr0JnABQ/zZQI6X4bLcXa
         /WaTnm2kIGCHGm4nB2ONiT7pYiLxB8z+rtOxE9ZAoRzyB2ThF0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aRzWHVSEZXUGUBjiWKKU
	/L82RzHl6+0V6hYWCsRpd+t1omVyI+rvyNHWqs3rT9qE8LekBsZpdXXMuFYG6vfdzV2as/xGWBW
	WaI5woF4FRiA/IQA2mlDPMLliQBKA86nrWIkglqT6NrxinfxA7/ykNEIoZv3vrXOlaINRH64x4O
	4VbK4Slqa7liQ=
X-Received: by 2002:a05:600c:4743:b0:4bb:5f95:c014 with SMTP id 5b1f17b1804b1-4bbeb8ac513mr46083865e9.19.1796403170277;
        Fri, 04 Dec 2026 08:52:50 -0800 (PST)
X-Received: from omarchy.speedport.ip (p200300d2670142870ab9d54580dd8aef.dip0.t-ipconnect.de. [2003:d2:6701:4287:ab9:d545:80dd:8aef])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbea25ce51sm67079935e9.5.2026.12.04.08.52.49
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 04 Dec 2026 08:52:49 -0800 (PST)
X-Cc: Andreas Noever <andreas.noever@gmail.com>,
	netdev@vger.kernel.org,
	linux-usb@vger.kernel.org
X-Mailer: git-send-email 2.56.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list