diff mbox series

[net-next,7/7] fm10k: Don't do TX csum offload with routing header present

Message ID 20240701012101.182784-8-tom@herbertland.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series drivers: Fix drivers doing TX csum offload with EH | 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 3 maintainers not CCed: edumazet@google.com intel-wired-lan@lists.osuosl.org pabeni@redhat.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: 846 this patch: 846
netdev/checkpatch warning WARNING: From:/Signed-off-by: email address mismatch: 'From: Tom Herbert <tom@sipanda.io>' != 'Signed-off-by: Tom Herbert <tom@herbertland.com>'
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 14 this patch: 14
netdev/source_inline success Was 0 now: 0

Commit Message

Tom Herbert July 1, 2024, 1:21 a.m. UTC
From: Tom Herbert <tom@sipanda.io>

When determining if the L4 checksum in an IPv6 packet can be offloaded
on transmit, call ipv6_skip_exthdr_no_rthdr to check for the presence
of a routing header. If a routing header is present, that is the
function return less than zero, then don't offload checksum and call
skb_checksum_help instead.

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index fc373472e4e1..b422fe7be427 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -832,9 +832,11 @@  static void fm10k_tx_csum(struct fm10k_ring *tx_ring,
 		if (likely((transport_hdr - network_hdr.raw) ==
 			   sizeof(struct ipv6hdr)))
 			break;
-		ipv6_skip_exthdr(skb, network_hdr.raw - skb->data +
-				      sizeof(struct ipv6hdr),
-				 &l4_hdr, &frag_off);
+		if (ipv6_skip_exthdr_no_rthdr(skb, network_hdr.raw - skb->data +
+					      sizeof(struct ipv6hdr),
+					      &l4_hdr, &frag_off) < 0)
+			goto no_csum_offload;
+
 		if (unlikely(frag_off))
 			l4_hdr = NEXTHDR_FRAGMENT;
 		break;
@@ -851,6 +853,7 @@  static void fm10k_tx_csum(struct fm10k_ring *tx_ring,
 			break;
 		fallthrough;
 	default:
+no_csum_offload:
 		if (unlikely(net_ratelimit())) {
 			dev_warn(tx_ring->dev,
 				 "partial checksum, version=%d l4 proto=%x\n",