netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
@ 2023-09-13  5:26 Mika Westerberg
  2023-09-13  5:55 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mika Westerberg @ 2023-09-13  5:26 UTC (permalink / raw)
  To: Michael Jamet, Yehezkel Bernat
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alex Balcanquall, Mika Westerberg, netdev

Alex reported that running ssh over IPv6 does not work with
Thunderbolt/USB4 networking driver. The reason for that is that driver
should call skb_is_gso() before calling skb_is_gso_v6(), and it should
not return false after calculates the checksum successfully. This probably
was a copy paste error from the original driver where it was done properly.

Reported-by: Alex Balcanquall <alex@alexbal.com>
Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
Previous version of the patch:

https://lore.kernel.org/netdev/20230911095039.3611113-1-mika.westerberg@linux.intel.com/

Changes from v1:

  * Drop UDP v6 GSO checksum
  * Add Fixes tag

 drivers/net/thunderbolt/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
index 0c1e8970ee58..0a53ec293d04 100644
--- a/drivers/net/thunderbolt/main.c
+++ b/drivers/net/thunderbolt/main.c
@@ -1049,12 +1049,11 @@ static bool tbnet_xmit_csum_and_map(struct tbnet *net, struct sk_buff *skb,
 		*tucso = ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
 					    ip_hdr(skb)->daddr, 0,
 					    ip_hdr(skb)->protocol, 0);
-	} else if (skb_is_gso_v6(skb)) {
+	} else if (skb_is_gso(skb) && skb_is_gso_v6(skb)) {
 		tucso = dest + ((void *)&(tcp_hdr(skb)->check) - data);
 		*tucso = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
 					  &ipv6_hdr(skb)->daddr, 0,
 					  IPPROTO_TCP, 0);
-		return false;
 	} else if (protocol == htons(ETH_P_IPV6)) {
 		tucso = dest + skb_checksum_start_offset(skb) + skb->csum_offset;
 		*tucso = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
-- 
2.40.1


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

* Re: [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
  2023-09-13  5:26 [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation Mika Westerberg
@ 2023-09-13  5:55 ` Eric Dumazet
  2023-09-13  7:51 ` Jiri Pirko
  2023-09-15 12:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2023-09-13  5:55 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Michael Jamet, Yehezkel Bernat, David S . Miller, Jakub Kicinski,
	Paolo Abeni, Alex Balcanquall, netdev

On Wed, Sep 13, 2023 at 7:26 AM Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
>
> Alex reported that running ssh over IPv6 does not work with
> Thunderbolt/USB4 networking driver. The reason for that is that driver
> should call skb_is_gso() before calling skb_is_gso_v6(), and it should
> not return false after calculates the checksum successfully. This probably
> was a copy paste error from the original driver where it was done properly.
>
> Reported-by: Alex Balcanquall <alex@alexbal.com>
> Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-by: Eric Dumazet <edumazet@google.com>

Thanks !

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

* Re: [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
  2023-09-13  5:26 [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation Mika Westerberg
  2023-09-13  5:55 ` Eric Dumazet
@ 2023-09-13  7:51 ` Jiri Pirko
  2023-09-14  1:20   ` Alex Balcanquall
  2023-09-15 12:50 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2023-09-13  7:51 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Michael Jamet, Yehezkel Bernat, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Alex Balcanquall, netdev

Wed, Sep 13, 2023 at 07:26:47AM CEST, mika.westerberg@linux.intel.com wrote:
>Alex reported that running ssh over IPv6 does not work with
>Thunderbolt/USB4 networking driver. The reason for that is that driver
>should call skb_is_gso() before calling skb_is_gso_v6(), and it should
>not return false after calculates the checksum successfully. This probably
>was a copy paste error from the original driver where it was done properly.
>
>Reported-by: Alex Balcanquall <alex@alexbal.com>
>Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
>Cc: stable@vger.kernel.org

Interesting, it is not actually cced. No need to do it anyway.


>Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>

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

* Re: [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
  2023-09-13  7:51 ` Jiri Pirko
@ 2023-09-14  1:20   ` Alex Balcanquall
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Balcanquall @ 2023-09-14  1:20 UTC (permalink / raw)
  To: Jiri Pirko, Mika Westerberg
  Cc: Michael Jamet, Yehezkel Bernat, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev@vger.kernel.org

Thanks, the v2 patch worked perfectly on my 3 test machines.




From: Jiri Pirko <jiri@resnulli.us>
Sent: Wednesday, September 13, 2023 12:51 AM
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Michael Jamet <michael.jamet@intel.com>; Yehezkel Bernat <YehezkelShB@gmail.com>; David S . Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Alex Balcanquall <alex@alexbal.com>; netdev@vger.kernel.org <netdev@vger.kernel.org>
Subject: Re: [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation 
 
Wed, Sep 13, 2023 at 07:26:47AM CEST, mika.westerberg@linux.intel.com wrote:
>Alex reported that running ssh over IPv6 does not work with
>Thunderbolt/USB4 networking driver. The reason for that is that driver
>should call skb_is_gso() before calling skb_is_gso_v6(), and it should
>not return false after calculates the checksum successfully. This probably
>was a copy paste error from the original driver where it was done properly.
>
>Reported-by: Alex Balcanquall <alex@alexbal.com>
>Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
>Cc: stable@vger.kernel.org

Interesting, it is not actually cced. No need to do it anyway.


>Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>

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

* Re: [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
  2023-09-13  5:26 [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation Mika Westerberg
  2023-09-13  5:55 ` Eric Dumazet
  2023-09-13  7:51 ` Jiri Pirko
@ 2023-09-15 12:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-09-15 12:50 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: michael.jamet, YehezkelShB, davem, edumazet, kuba, pabeni, alex,
	netdev

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 13 Sep 2023 08:26:47 +0300 you wrote:
> Alex reported that running ssh over IPv6 does not work with
> Thunderbolt/USB4 networking driver. The reason for that is that driver
> should call skb_is_gso() before calling skb_is_gso_v6(), and it should
> not return false after calculates the checksum successfully. This probably
> was a copy paste error from the original driver where it was done properly.
> 
> Reported-by: Alex Balcanquall <alex@alexbal.com>
> Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> [...]

Here is the summary with links:
  - [v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
    https://git.kernel.org/netdev/net/c/e0b65f9b81fe

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] 5+ messages in thread

end of thread, other threads:[~2023-09-15 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13  5:26 [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation Mika Westerberg
2023-09-13  5:55 ` Eric Dumazet
2023-09-13  7:51 ` Jiri Pirko
2023-09-14  1:20   ` Alex Balcanquall
2023-09-15 12:50 ` 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).