diff mbox series

[RFC,net-next,04/10] fcoe: Call skb_csum_crc32_unnecessary

Message ID 20240703224850.1226697-5-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 fail 4 maintainers not CCed: linux-scsi@vger.kernel.org martin.petersen@oracle.com James.Bottomley@HansenPartnership.com hare@suse.de
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: 848 this patch: 848
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 5 this patch: 5
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 FCOE 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>
---
 drivers/scsi/fcoe/fcoe.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index f1429f270170..9444bf973234 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1612,10 +1612,12 @@  static inline int fcoe_filter_frames(struct fc_lport *lport,
 	 * it's solicited data, in which case, the FCP layer would
 	 * check it during the copy.
 	 */
-	if (lport->crc_offload && skb->ip_summed == CHECKSUM_UNNECESSARY)
+	if (lport->crc_offload && skb_csum_crc32_unnecessary(skb)) {
 		fr_flags(fp) &= ~FCPHF_CRC_UNCHECKED;
-	else
+		skb_reset_csum_crc32_unnecessary(skb);
+	} else {
 		fr_flags(fp) |= FCPHF_CRC_UNCHECKED;
+	}
 
 	fh = fc_frame_header_get(fp);
 	if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && fh->fh_type == FC_TYPE_FCP)