netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <tom@herbertland.com>
To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com,
	anthony.l.nguyen@intel.com, cai.huoqing@linux.dev,
	netdev@vger.kernel.org, felipe@sipanda.io
Cc: Tom Herbert <tom@herbertland.com>
Subject: [RFC net-next 03/10] sctp: Call skb_csum_crc32_unnecessary
Date: Wed,  3 Jul 2024 15:48:43 -0700	[thread overview]
Message-ID: <20240703224850.1226697-4-tom@herbertland.com> (raw)
In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com>

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 --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));
 
-- 
2.34.1


  parent reply	other threads:[~2024-07-03 22:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 22:48 [RFC net-next 00/10] crc-offload: Split RX CRC offload from csum offload Tom Herbert
2024-07-03 22:48 ` [RFC net-next 01/10] skbuff: Rename csum_not_inet to csum_is_crc32 Tom Herbert
2024-07-23 16:23   ` Mina Almasry
2024-07-03 22:48 ` [RFC net-next 02/10] skbuff: Add csum_valid_crc32 flag Tom Herbert
2024-07-03 22:48 ` Tom Herbert [this message]
2024-07-03 22:48 ` [RFC net-next 04/10] fcoe: Call skb_csum_crc32_unnecessary Tom Herbert
2024-07-03 22:48 ` [RFC net-next 05/10] cavium_thunder: Call skb_set_csum_crc32_unnecessary Tom Herbert
2024-07-03 22:48 ` [RFC net-next 06/10] gve: " Tom Herbert
2024-07-03 22:48 ` [RFC net-next 07/10] hisilicon: " Tom Herbert
2024-07-03 22:48 ` [RFC net-next 08/10] idpf: " Tom Herbert
2024-07-03 22:48 ` [RFC net-next 09/10] ixgbe: " Tom Herbert
2024-07-03 22:48 ` [RFC net-next 10/10] wangxun: " Tom Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240703224850.1226697-4-tom@herbertland.com \
    --to=tom@herbertland.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=cai.huoqing@linux.dev \
    --cc=davem@davemloft.net \
    --cc=felipe@sipanda.io \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).