diff mbox series

[RFC,net-next,03/10] sctp: Call skb_csum_crc32_unnecessary

Message ID 20240703224850.1226697-4-tom@herbertland.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series crc-offload: Split RX CRC offload from csum offload | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 839 this patch: 839
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 5 maintainers not CCed: lucien.xin@gmail.com pabeni@redhat.com marcelo.leitner@gmail.com linux-sctp@vger.kernel.org edumazet@google.com
netdev/build_clang success Errors and warnings before: 846 this patch: 846
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 849 this patch: 849
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tom Herbert July 3, 2024, 10:48 p.m. UTC
Instead of checking for CHECKSUM_UNNECESSARY, call
skb_csum_crc32_unnecessary to see if the SCTP CRC has been
validated. If it is then call skb_reset_csum_crc32_unnecessary
to clear the flag

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 net/sctp/input.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 17fcaa9b0df9..aefcc3497d27 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -124,14 +124,12 @@  int sctp_rcv(struct sk_buff *skb)
 	/* Pull up the IP header. */
 	__skb_pull(skb, skb_transport_offset(skb));
 
-	skb->csum_valid = 0; /* Previous value not applicable */
-	if (skb_csum_unnecessary(skb))
-		__skb_decr_checksum_unnecessary(skb);
+	if (skb_csum_crc32_unnecessary(skb))
+		skb_reset_csum_crc32_unnecessary(skb);
 	else if (!sctp_checksum_disable &&
 		 !is_gso &&
 		 sctp_rcv_checksum(net, skb) < 0)
 		goto discard_it;
-	skb->csum_valid = 1;
 
 	__skb_pull(skb, sizeof(struct sctphdr));