From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D865C403E87 for ; Mon, 27 Jul 2026 12:30:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785155448; cv=none; b=nhLBwZ+5vCuZTFb+BqJx8ybTbyLexTLF9eg7g6T9Ci6zlsPvhMrQmfLsEjxXZxBBCNkdvL98lh7pCC+TI8zsW9EaxcY3Fq5Woun+oYOwp4sjZHcv/JYHAlmv2KNSCK+BQucg5sVhsmUvDIg3buH+7by4CgEE0Egt5ustBwoAiKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785155448; c=relaxed/simple; bh=+nkn2L3juBq5sEJdA5SDK+26iCLXITKuDjPDHVgLO7c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nrvu4QTX0ANQZxeej2RTr7u1myGRVPuesa8EtypRJUUQ+YCz9dUXFHDjAdUH7g8tvA+ujg0bdbxuX0AOIl38HyaTBcO7MSrPXsV+zqgMT/V1NcOPlxCsUVoG4MbFWLCAaqrAh+AA8M9Uu1HqnjnRPPgZ7GworFbA3T0TiHWOdTE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PhFGLU9S; arc=none smtp.client-ip=209.85.214.181 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.b="PhFGLU9S" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2caf228a910so19574925ad.2 for ; Mon, 27 Jul 2026 05:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785155446; x=1785760246; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=RXLp1w9y313rtvVEolOnByVGZO9J02FYO9mn2TCWDxg=; b=PhFGLU9SFinrv8JaO6Du1qXDqk/xxVkJ6bhzca+HBsG5brg+vwqm/qU1D0/2k9SbQg wKUF9DxbjtP/jZUnwLLhLJc4rCS1vJmRqpXCLNE94qVhkFRb4CdpLB/7oVRrEHuTT7oR t0yXtATARaWu9ov2Dq3eNvM8PZ+N5PynrZV5+T0P80JvPRrMlqVinjkf4d+3gMmZ60bl KrM50gLlO/C8jDEeHAw/wGSmPzuPerayUhxRpJ4AmN6QKf1H/r6+EIXeMNxzCPLgyEtB 4L5gUTiR4RGj3CJQi7BHOd9Au7P4F5HwEGzjnCZI5djl3Sk/g+gMq/2+ds0KztriGwpf 4jXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785155446; x=1785760246; h=content-transfer-encoding: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=RXLp1w9y313rtvVEolOnByVGZO9J02FYO9mn2TCWDxg=; b=k2CqTZe7L0fTB/wKA5jgq9H17nSKmbg/ZxjhHamz1/9Fr3xNjRwrLa1J2Y7trdhOz3 cyMSLaCvMg3FcObPQ/ivQv9ZohtpxfJYkOwoQyRzxy01QwEJefdcJQ/9GJPrIJ/RrckQ pacHDk1hMJYWr1M2v3evCnSmRJxvKS+8Pbn2BYnvJEvqwThKznPdWwffp/MsnZY8Dx88 vCPBjqkmKfzE1+c0kbebtQyTjfzsg915il/aK1KevKAhkFXksWN0S/aju430lhCAHZRE tBg46Z2kRxu7CWJFgW8KVstuyc8umqn7tZqW3g9ZQcBMSfyCA05fGWrn6dng0eWSbeF+ T8Ww== X-Forwarded-Encrypted: i=1; AHgh+RoWow2ntq3OQiQ1VI6e5wAXZ63bI5QntCvTuR5WSk03ObiEpxgRB4vNyugtNPAs7w38saj9XVcDV5N0beI=@vger.kernel.org X-Gm-Message-State: AOJu0Yx88jDkBcq0phDnFxE4Hk8EiyJG/xraMgmFNjxo1kSGH8E/pDfX NNZSkhrsc6e7jAyS/JQKupik+YXSTNIhHkXM2EXX2kdCqZofRSr2Hgc= X-Gm-Gg: AR+sD13GcoyOSEGPyEH/0NetxeHLWWKN0mxP3GYvwfDJYloxQy4dx/UKl+ac23L5Ztg lBYwTBMYp44/D+HwUFU4LlOf/YlxoMwIVEx4EdxDUa8OrbMjO8Bo52RN20pU/Q59d8oxLRfW/Oc EiwqYRb17FzdkcPxoRBNsYynGT7CmMwqumxSt1f8Fyt4g7Mhaij/cT0F0+GNrLU1hsV1zTpLeK9 Mm6hvLKPhRvZ11CZxH4iWaTKn3W5nPds5B9nZenXBpReYk14n5CNrfC05+I05silhPSN3CBVL1Q VylQW2Ltnu79p0GJkXYUNMLtA/OjfAbPXDS0er8hNjTM5hgSu0gxfDu6l1lzz3df1rih+BM3hJB ktedTz6S/FhEiaIlWE3Doz1hUe9vCFvP0Vq611ycvY/Yx2BCAoG2TAx3nkWuoV4czhjLu/PXzWf 39tpjmU7c= X-Received: by 2002:a17:902:ce06:b0:2cc:6018:f030 with SMTP id d9443c01a7336-2cfde7ae1c6mr76726365ad.14.1785155445857; Mon, 27 Jul 2026 05:30:45 -0700 (PDT) Received: from jplife-black.. ([171.2.207.88]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cfde5e28easm34644985ad.24.2026.07.27.05.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 05:30:43 -0700 (PDT) From: Fan Ye To: Mika Westerberg , Yehezkel Bernat , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fan Ye , zhangjianrong Subject: [PATCH net v2] Revert "net: thunderbolt: Enable end-to-end flow control also in transmit" Date: Mon, 27 Jul 2026 12:29:48 +0000 Message-ID: <20260727123002.25225-1-fy15309206903@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This reverts commit a8065af3346ebd7c76ebc113451fb3ba94cf7769. Per the USB4 spec, a Transmit Descriptor Ring with E2E flow control disabled does not require any credits to be available before the Host Interface Adapter Layer transmits a tunneled packet from it. Once E2E is enabled on that ring the controller must first obtain end-to-end credits. The ASMedia ASM4242 USB4 host router (PCI 1b21:2425) never delivers those credits. The controller does accept the configuration: reading the ring OPTIONS register back right after tb_ring_start() returns exactly what was written, including RING_FLAG_E2E_FLOW_CONTROL (bit 28) and the E2E HopID field. No credit ever arrives though, so the Tx ring's hardware consumer index never advances and the link carries no traffic at all. Measured on two hosts connected point to point, onboard ASM4242 on MSI X870E and X870, v6.17, stock drivers/net/thunderbolt/main.c with only this revert applied on top: before: 100% packet loss to the peer; thunderbolt0 is up and the XDomain handshake completes ("new host found"), but iperf3 fails with "No route to host" once the neighbour entry expires after: 0% packet loss, 0.28 ms RTT; iperf3 4.21 Gb/s one way and 5.17 Gb/s the other (5 runs each, stddev <= 0.02), 1 retransmit in 10 s An instrumented build additionally showed a frozen-Tx-consumer watchdog firing ~30k times in a 10 s window before this change. Rx-side E2E is not touched by this revert, so peers that do return credits keep receive-side flow control. ASMedia does not look like an isolated case. The out-of-tree thunderbolt-ibverbs project disables native E2E on AMD NHI by default, noting that "Strix Halo has reproduced TX completion wedges with multiple native E2E rings active" -- the same failure mode, on a different vendor. Since the driver has no way to tell in advance which host router returns the credits, going back to the previous behaviour looks safer than adding a quirk per affected part; Tx-side E2E can be reintroduced as an opt-in for controllers that are known to implement the credit return. Note that the reverted commit was not fixing a reported problem, it was derived from the spec wording alone, so this revert is not expected to regress a known workload. Cc'ing the original author in case there was one. Fixes: a8065af3346e ("net: thunderbolt: Enable end-to-end flow control also in transmit") Cc: zhangjianrong Signed-off-by: Fan Ye --- v2: Send as a plain revert of a8065af3346e instead of a separate change that disables Tx-side E2E, as suggested by Mika. Functionally identical to v1; the ASM4242 measurements are kept in the changelog. v1: https://lore.kernel.org/all/20260723025649.7112-1-faliye@ymail.ne.jp/ drivers/net/thunderbolt/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c index 02a916505..c5670d618 100644 --- a/drivers/net/thunderbolt/main.c +++ b/drivers/net/thunderbolt/main.c @@ -925,12 +925,8 @@ static int tbnet_open(struct net_device *dev) netif_carrier_off(dev); - flags = RING_FLAG_FRAME; - /* Only enable full E2E if the other end supports it too */ - if (tbnet_e2e && net->svc->prtcstns & TBNET_E2E) - flags |= RING_FLAG_E2E; - - ring = tb_ring_alloc_tx(xd->tb->nhi, -1, TBNET_RING_SIZE, flags); + ring = tb_ring_alloc_tx(xd->tb->nhi, -1, TBNET_RING_SIZE, + RING_FLAG_FRAME); if (!ring) { netdev_err(dev, "failed to allocate Tx ring\n"); return -ENOMEM; @@ -949,6 +945,11 @@ static int tbnet_open(struct net_device *dev) sof_mask = BIT(TBIP_PDF_FRAME_START); eof_mask = BIT(TBIP_PDF_FRAME_END); + flags = RING_FLAG_FRAME; + /* Only enable full E2E if the other end supports it too */ + if (tbnet_e2e && net->svc->prtcstns & TBNET_E2E) + flags |= RING_FLAG_E2E; + ring = tb_ring_alloc_rx(xd->tb->nhi, -1, TBNET_RING_SIZE, flags, net->tx_ring.ring->hop, sof_mask, eof_mask, tbnet_start_poll, net); -- 2.43.0