From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org,
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Subject: [Intel-wired-lan] [PATCH iwl-next v2 2/4] i40e: pass the return value of skb_checksum_help()
Date: Tue, 12 May 2026 10:47:27 +0200 [thread overview]
Message-ID: <20260512084729.1338557-3-michal.swiatkowski@linux.intel.com> (raw)
In-Reply-To: <20260512084729.1338557-1-michal.swiatkowski@linux.intel.com>
skb_checksum_help() can fail. Pass its return value back to the caller.
Commonize this software path in goto.
Try calculating in software instead of returning error.
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index cfaf724ee7ff..6e336696276f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -3306,7 +3306,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
ret = ipv6_skip_exthdr(skb, exthdr - skb->data,
&l4_proto, &frag_off);
if (ret < 0)
- return -1;
+ goto checksum_sw_fb;
}
/* define outer transport */
@@ -3325,11 +3325,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
l4.hdr = skb_inner_network_header(skb);
break;
default:
- if (*tx_flags & I40E_TX_FLAGS_TSO)
- return -1;
-
- skb_checksum_help(skb);
- return 0;
+ goto checksum_sw_fb;
}
/* compute outer L3 header size */
@@ -3406,16 +3402,18 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
break;
default:
- if (*tx_flags & I40E_TX_FLAGS_TSO)
- return -1;
- skb_checksum_help(skb);
- return 0;
+ goto checksum_sw_fb;
}
*td_cmd |= cmd;
*td_offset |= offset;
return 1;
+
+checksum_sw_fb:
+ if (*tx_flags & I40E_TX_FLAGS_TSO)
+ return -1;
+ return skb_checksum_help(skb);
}
/**
--
2.49.0
next prev parent reply other threads:[~2026-05-12 9:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 8:47 [Intel-wired-lan] [PATCH iwl-next v2 0/4] return value of skb_checksum_help() Michal Swiatkowski
2026-05-12 8:47 ` [Intel-wired-lan] [PATCH iwl-next v2 1/4] ice: pass the " Michal Swiatkowski
2026-05-12 8:47 ` Michal Swiatkowski [this message]
2026-05-12 8:47 ` [Intel-wired-lan] [PATCH iwl-next v2 3/4] iavf: " Michal Swiatkowski
2026-05-12 8:47 ` [Intel-wired-lan] [PATCH iwl-next v2 4/4] idpf: " Michal Swiatkowski
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=20260512084729.1338557-3-michal.swiatkowski@linux.intel.com \
--to=michal.swiatkowski@linux.intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=intel-wired-lan@lists.osuosl.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