diff mbox series

[RFC,net-next,01/10] skbuff: Rename csum_not_inet to csum_is_crc32

Message ID 20240703224850.1226697-2-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: 892 this patch: 892
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 9 maintainers not CCed: lucien.xin@gmail.com jiri@resnulli.us pabeni@redhat.com marcelo.leitner@gmail.com almasrymina@google.com linux-sctp@vger.kernel.org edumazet@google.com xiyou.wangcong@gmail.com jhs@mojatatu.com
netdev/build_clang success Errors and warnings before: 958 this patch: 958
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: 5927 this patch: 5927
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 91 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 139 this patch: 139
netdev/source_inline success Was 0 now: 0

Commit Message

Tom Herbert July 3, 2024, 10:48 p.m. UTC
csum_not_inet really refers to SCTP or FCOE CRC. Rename
to be more precise

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 include/linux/skbuff.h | 18 +++++++++---------
 net/core/dev.c         |  2 +-
 net/sched/act_csum.c   |  2 +-
 net/sctp/offload.c     |  2 +-
 net/sctp/output.c      |  2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

Comments

Mina Almasry July 23, 2024, 4:23 p.m. UTC | #1
On Wed, Jul 03, 2024 at 03:48:41PM -0700, Tom Herbert wrote:
> csum_not_inet really refers to SCTP or FCOE CRC. Rename
> to be more precise
>
> Signed-off-by: Tom Herbert <tom@herbertland.com>

I checked that you haven't missed any instances of csum_not_inet unmodified.

The rename seems straightforward and unobjectionable given that the description
of the csum_not_inet field said that it was a crc32 anway.

The previous name also contained an awkward negation. Removing that seems like
an improvement.

FWIW,

Reviewed-by: Mina Almasry <almasrymina@google.com>
diff mbox series

Patch

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f4cda3fbdb75..7fd6ce4df0ec 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -185,7 +185,7 @@ 
  *   skb_csum_hwoffload_help() can be called to resolve %CHECKSUM_PARTIAL based
  *   on network device checksumming capabilities: if a packet does not match
  *   them, skb_checksum_help() or skb_crc32c_help() (depending on the value of
- *   &sk_buff.csum_not_inet, see :ref:`crc`)
+ *   &sk_buff.csum_is_crc32, see :ref:`crc`)
  *   is called to resolve the checksum.
  *
  * - %CHECKSUM_NONE
@@ -215,12 +215,12 @@ 
  *     - This feature indicates that a device is capable of
  *	 offloading the SCTP CRC in a packet. To perform this offload the stack
  *	 will set csum_start and csum_offset accordingly, set ip_summed to
- *	 %CHECKSUM_PARTIAL and set csum_not_inet to 1, to provide an indication
+ *	 %CHECKSUM_PARTIAL and set csum_is_crc32 to 1, to provide an indication
  *	 in the skbuff that the %CHECKSUM_PARTIAL refers to CRC32c.
  *	 A driver that supports both IP checksum offload and SCTP CRC32c offload
  *	 must verify which offload is configured for a packet by testing the
- *	 value of &sk_buff.csum_not_inet; skb_crc32c_csum_help() is provided to
- *	 resolve %CHECKSUM_PARTIAL on skbs where csum_not_inet is set to 1.
+ *	 value of &sk_buff.csum_is_crc32; skb_crc32c_csum_help() is provided to
+ *	 resolve %CHECKSUM_PARTIAL on skbs where csum_is_crc32 is set to 1.
  *
  *   * - %NETIF_F_FCOE_CRC
  *     - This feature indicates that a device is capable of offloading the FCOE
@@ -822,7 +822,7 @@  enum skb_tstamp_type {
  *	@encapsulation: indicates the inner headers in the skbuff are valid
  *	@encap_hdr_csum: software checksum is needed
  *	@csum_valid: checksum is already valid
- *	@csum_not_inet: use CRC32c to resolve CHECKSUM_PARTIAL
+ *	@csum_is_crc32: use CRC32c to resolve CHECKSUM_PARTIAL
  *	@csum_complete_sw: checksum was completed by software
  *	@csum_level: indicates the number of consecutive checksums found in
  *		the packet minus one that have been verified as
@@ -1006,7 +1006,7 @@  struct sk_buff {
 #endif
 	__u8			slow_gro:1;
 #if IS_ENABLED(CONFIG_IP_SCTP)
-	__u8			csum_not_inet:1;
+	__u8			csum_is_crc32:1;
 #endif
 
 #if defined(CONFIG_NET_SCHED) || defined(CONFIG_NET_XGRESS)
@@ -5098,17 +5098,17 @@  static inline void skb_set_redirected_noclear(struct sk_buff *skb,
 static inline bool skb_csum_is_sctp(struct sk_buff *skb)
 {
 #if IS_ENABLED(CONFIG_IP_SCTP)
-	return skb->csum_not_inet;
+	return skb->csum_is_crc32;
 #else
 	return 0;
 #endif
 }
 
-static inline void skb_reset_csum_not_inet(struct sk_buff *skb)
+static inline void skb_reset_csum_is_crc32(struct sk_buff *skb)
 {
 	skb->ip_summed = CHECKSUM_NONE;
 #if IS_ENABLED(CONFIG_IP_SCTP)
-	skb->csum_not_inet = 0;
+	skb->csum_is_crc32 = 0;
 #endif
 }
 
diff --git a/net/core/dev.c b/net/core/dev.c
index 385c4091aa77..f6a2b868e561 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3382,7 +3382,7 @@  int skb_crc32c_csum_help(struct sk_buff *skb)
 						  skb->len - start, ~(__u32)0,
 						  crc32c_csum_stub));
 	*(__le32 *)(skb->data + offset) = crc32c_csum;
-	skb_reset_csum_not_inet(skb);
+	skb_reset_csum_is_crc32(skb);
 out:
 	return ret;
 }
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index 5cc8e407e791..347622e690be 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -376,7 +376,7 @@  static int tcf_csum_sctp(struct sk_buff *skb, unsigned int ihl,
 
 	sctph->checksum = sctp_compute_cksum(skb,
 					     skb_network_offset(skb) + ihl);
-	skb_reset_csum_not_inet(skb);
+	skb_reset_csum_is_crc32(skb);
 
 	return 1;
 }
diff --git a/net/sctp/offload.c b/net/sctp/offload.c
index 502095173d88..b1a68f43b327 100644
--- a/net/sctp/offload.c
+++ b/net/sctp/offload.c
@@ -27,7 +27,7 @@ 
 static __le32 sctp_gso_make_checksum(struct sk_buff *skb)
 {
 	skb->ip_summed = CHECKSUM_NONE;
-	skb->csum_not_inet = 0;
+	skb->csum_is_crc32 = 0;
 	/* csum and csum_start in GSO CB may be needed to do the UDP
 	 * checksum when it's a UDP tunneling packet.
 	 */
diff --git a/net/sctp/output.c b/net/sctp/output.c
index a63df055ac57..1d81451cc654 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -553,7 +553,7 @@  static int sctp_packet_pack(struct sctp_packet *packet,
 	} else {
 chksum:
 		head->ip_summed = CHECKSUM_PARTIAL;
-		head->csum_not_inet = 1;
+		head->csum_is_crc32 = 1;
 		head->csum_start = skb_transport_header(head) - head->head;
 		head->csum_offset = offsetof(struct sctphdr, checksum);
 	}