net: thunderbolt: Fix TCPv6 GSO checksum calculation
Subsystems (3)
PATCH v2 1/1 net: thunderbolt: Fix TCPv6 GSO checksum calculation
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.
---
Previous version of the patch:
https://lore.kernel.org/netdev/[email protected]/
Changes from v1:
* Drop UDP v6 GSO checksum
* Add Fixes tag
drivers/net/thunderbolt/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/thunderbolt/main.c +1 -2
@@ -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,
Signature · 1 line
2.40.1
Quoted 11 lines · Mika Westerberg
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 callingskb_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 <[email protected]>Fixes e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")Signed-off-by Mika Westerberg <[email protected]>
Thanks !
Quoted 9 lines · Wed, Sep 13, 2023 at 07:26:47AM CEST, [email protected] 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 callingskb_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 <[email protected]>Fixes e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
Interesting, it is not actually cced. No need to do it anyway.
Quoted 1 line
Signed-off-by Mika Westerberg <[email protected]>
Alex Balcanquall
Reviewed-by Jiri PirkoThanks, the v2 patch worked perfectly on my 3 test machines.
From: Jiri Pirko <[email protected]>
Sent: Wednesday, September 13, 2023 12:51 AM
To: Mika Westerberg <[email protected]>
Cc: Michael Jamet <[email protected]>; Yehezkel Bernat <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Alex Balcanquall <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH v2] net: thunderbolt: Fix TCPv6 GSO checksum calculation
Quoted 9 lines · Wed, Sep 13, 2023 at 07:26:47AM CEST, [email protected] 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 callingskb_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 <[email protected]>Fixes e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
Interesting, it is not actually cced. No need to do it anyway.
Quoted 1 line
Signed-off-by Mika Westerberg <[email protected]>
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 6 lines · 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 callingskb_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.
Quoted 6 lines
Reported-by Alex Balcanquall <[email protected]>Fixes e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")Signed-off-by Mika Westerberg <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html