linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] udp: not remove the CRC flag from dev features when need_csum is false
@ 2021-01-16  5:59 Xin Long
  2021-01-21  6:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Xin Long @ 2021-01-16  5:59 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Neil Horman, davem, Jakub Kicinski,
	Alexander Duyck

In __skb_udp_tunnel_segment(), when it's a SCTP over VxLAN/GENEVE
packet and need_csum is false, which means the outer udp checksum
doesn't need to be computed, csum_start and csum_offset could be
used by the inner SCTP CRC CSUM for SCTP HW CRC offload.

So this patch is to not remove the CRC flag from dev features when
need_csum is false.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/ipv4/udp_offload.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index ff39e94..1168d18 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -68,8 +68,8 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
 				      (NETIF_F_HW_CSUM | NETIF_F_IP_CSUM))));
 
 	features &= skb->dev->hw_enc_features;
-	/* CRC checksum can't be handled by HW when it's a UDP tunneling packet. */
-	features &= ~NETIF_F_SCTP_CRC;
+	if (need_csum)
+		features &= ~NETIF_F_SCTP_CRC;
 
 	/* The only checksum offload we care about from here on out is the
 	 * outer one so strip the existing checksum feature flags and
-- 
2.1.0


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

* Re: [PATCH net-next] udp: not remove the CRC flag from dev features when need_csum is false
  2021-01-16  5:59 [PATCH net-next] udp: not remove the CRC flag from dev features when need_csum is false Xin Long
@ 2021-01-21  6:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-21  6:20 UTC (permalink / raw)
  To: Xin Long
  Cc: netdev, linux-sctp, marcelo.leitner, nhorman, davem, kuba,
	alexander.duyck

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sat, 16 Jan 2021 13:59:17 +0800 you wrote:
> In __skb_udp_tunnel_segment(), when it's a SCTP over VxLAN/GENEVE
> packet and need_csum is false, which means the outer udp checksum
> doesn't need to be computed, csum_start and csum_offset could be
> used by the inner SCTP CRC CSUM for SCTP HW CRC offload.
> 
> So this patch is to not remove the CRC flag from dev features when
> need_csum is false.
> 
> [...]

Here is the summary with links:
  - [net-next] udp: not remove the CRC flag from dev features when need_csum is false
    https://git.kernel.org/netdev/net-next/c/4eb5d4a5b4d6

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:[~2021-01-21  6:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-16  5:59 [PATCH net-next] udp: not remove the CRC flag from dev features when need_csum is false Xin Long
2021-01-21  6:20 ` 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).