linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: thunderbolt: Enable end-to-end flow control also in transmit
@ 2025-06-28  9:38 zhangjianrong
  2025-07-02 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: zhangjianrong @ 2025-06-28  9:38 UTC (permalink / raw)
  To: michael.jamet, mika.westerberg, YehezkelShB, andrew+netdev, davem,
	edumazet, kuba, pabeni, netdev, linux-kernel
  Cc: guhengsheng, caiyadong, xuetao09, lixinghang1

According to USB4 specification, if E2E flow control is disabled for
the Transmit Descriptor Ring, the Host Interface Adapter Layer shall
not require any credits to be available before transmitting a Tunneled
Packet from this Transmit Descriptor Ring, so e2e flow control should
be enabled in both directions.

Signed-off-by: zhangjianrong <zhangjianrong5@huawei.com>
---
v2: update subject and commit message
v1: initial submission

 drivers/net/thunderbolt/main.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
index 0a53ec293d04..643cf67840b5 100644
--- a/drivers/net/thunderbolt/main.c
+++ b/drivers/net/thunderbolt/main.c
@@ -924,8 +924,12 @@ static int tbnet_open(struct net_device *dev)
 
 	netif_carrier_off(dev);
 
-	ring = tb_ring_alloc_tx(xd->tb->nhi, -1, TBNET_RING_SIZE,
-				RING_FLAG_FRAME);
+	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);
 	if (!ring) {
 		netdev_err(dev, "failed to allocate Tx ring\n");
 		return -ENOMEM;
@@ -944,11 +948,6 @@ 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.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] net: thunderbolt: Enable end-to-end flow control also in transmit
  2025-06-28  9:38 [PATCH v2] net: thunderbolt: Enable end-to-end flow control also in transmit zhangjianrong
@ 2025-07-02 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-02 21:30 UTC (permalink / raw)
  To: zhangjianrong
  Cc: michael.jamet, mika.westerberg, YehezkelShB, andrew+netdev, davem,
	edumazet, kuba, pabeni, netdev, linux-kernel, guhengsheng,
	caiyadong, xuetao09, lixinghang1

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 28 Jun 2025 17:38:13 +0800 you wrote:
> According to USB4 specification, if E2E flow control is disabled for
> the Transmit Descriptor Ring, the Host Interface Adapter Layer shall
> not require any credits to be available before transmitting a Tunneled
> Packet from this Transmit Descriptor Ring, so e2e flow control should
> be enabled in both directions.
> 
> Signed-off-by: zhangjianrong <zhangjianrong5@huawei.com>
> 
> [...]

Here is the summary with links:
  - [v2] net: thunderbolt: Enable end-to-end flow control also in transmit
    https://git.kernel.org/netdev/net-next/c/a8065af3346e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-02 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28  9:38 [PATCH v2] net: thunderbolt: Enable end-to-end flow control also in transmit zhangjianrong
2025-07-02 21:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).