From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.47 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== 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== 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 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 ; Fri, 4 Dec 2026 16:52:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2CC1606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4a5177d78c7so11596525e9.2 for ; Fri, 04 Dec 2026 08:52:51 -0800 (PST) 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+rtOxE9ZAoRzyB2ThF0Oi2cVVbiEQDNv8qY+M ZBdAG+CsDYogIEQ67n6TBVt+MMO9AsxqIykAX1fwYXna9k+eOgDFAaksxfzIDTlmCibW czThG2nF8InLOyZ254E+m8omnRRNun1L/vDHVSxbD5wKsYFPjwrKo5rEq3reXMuBx8+h s4TrG1Hus/DY1yAy8paEGND+9yAr8M6EwkewvsbziAiVVM2z9kY18ynLgj3NARMQbOez SS1g== X-Forwarded-Encrypted: i=1; AL+hErElgIW0fwZXnmS2k/GzFIyzts6Fn/CxQGnecpQ96LfYeDU6js2VYFHYUN5KxQgdlGAmEmKsGwE=@vger.kernel.org X-Gm-Message-State: APuU4Z+Jo4taJ0HVFOTzWXljx4C7x0y/LKGUrHReRRNz/to5Ae7ziU4p gVW0oeigav0YRx3qgzyBVJX7EbSRmQTvejbvrjJGtg1HEc9OQ62/5y9P X-Gm-Gg: AZFdTZfG+in6WdZlDHz+R1aSKjqasI3EF1ZUgrAO0OTs1S3/Tv+CSNuvc4Tq5UsaWS7 VJe8xTKCSIV5kLcS9M2zyGYwGr1cIFQyi/sgFMKiQ+v+oCh+L3ACPKMCYlRopg8Env8h+8Xw9GY qadexkHJk8iqgsMrCsfusMnwFc0/fZZCwCyPvC4ci1FsV6L/oqb1nkyLg/B+petFtMarZfrqOJ8 sFewh3B7yEE5wpJRz9SFAOInuA61FF7wAKcTa8fheBmoul9UKeJH8dvEuHviCZWfICfSGD7uizZ kskZnsOQuKidYu5dVfrnk8F2TLYFvVwwcoI+n3mTcr06MW0NxoA1+2ktKIlthZaPuLr2FdBBInz ZBE5suL7XAZLwt7c9SMzpd5ZrX2ZAXXarbEAkNDEqpSi1x2Amqbn3/gubfcjC/w2twBq7d+TeM0 u9NkaDf9BdG2FFb5SYnwk4MQLgrsU9qfsdNzTGH7ZE6NgKFZ5EAtdIh9LwvfdlHHhs+BZlz59Ad tgnlyhQIyuqcCWkts/7XZ6E77x1Ipt1EsfBWJWDWXhhhERKMtp/h0X8aRzWHVSEZXUGUBjiWKKU /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) 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) From: Felipe Cruz To: Mika Westerberg , Yehezkel Bernat Cc: Andreas Noever , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: thunderbolt-net: no traffic with an M5 Mac, per-frame CRC32C is little-endian Date: Fri, 4 Dec 2026 17:52:48 +0100 Message-ID: <20261204165248.479627-1-felipecruz@gmail.com> X-Mailer: git-send-email 2.56.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 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