From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B380FCD4851 for ; Tue, 12 May 2026 09:31:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5E6E5821C8; Tue, 12 May 2026 09:31:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iobk2B6EfgoI; Tue, 12 May 2026 09:31:18 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 963BC821C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1778578278; bh=nJNFDvZFBJ7P+hqVHSmi4aLU4K5xxrWDjYJKTC+xBtw=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WCiAQSzRnmNtmBETkhjjPeVrlWqb6cmmVGLuU1pYoCFmt4nOViKrzGvMk9vvs8IdR 68kcQQWEm1p3WFlP7U81LHNfuWJrRy0HLAHhQCKdFDSUEHLeKBNWmx3XPB8q9ivLYJ uOnXFKsGEH//10mFLfH+sXjwL+T/dqK55J8rE/j/9Mqe93MDswkLbkxq5FaI6U1WeI jMJwUpwbjBA8EPrSqgcpPckF6SyMSmQb1knv3tdkSti/nGsYk2MoV0RRO5h/1Z2/In v59f1QImJWjL/ngC2WWF6PzlMA/zwR7dk+9WYTf5v3WVXcQgSrcgQYpBl8NZCL2FrZ YQ7PAkfnSaoYA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 963BC821C1; Tue, 12 May 2026 09:31:18 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id 350DE223 for ; Tue, 12 May 2026 09:31:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C563160C0F for ; Tue, 12 May 2026 09:31:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id u4L_lLtt4rLf for ; Tue, 12 May 2026 09:31:15 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.16; helo=mgamail.intel.com; envelope-from=michal.swiatkowski@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 12A7860C0E DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 12A7860C0E Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by smtp3.osuosl.org (Postfix) with ESMTPS id 12A7860C0E for ; Tue, 12 May 2026 09:31:14 +0000 (UTC) X-CSE-ConnectionGUID: ZJU2jfmoQ2+G1zNRl80cnw== X-CSE-MsgGUID: bQiZE9ZOSEet8phvVDlElA== X-IronPort-AV: E=McAfee;i="6800,10657,11783"; a="79663244" X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="79663244" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 02:31:14 -0700 X-CSE-ConnectionGUID: jq6YEiKESjq1jKu3tOnIGg== X-CSE-MsgGUID: T/U1A9PrSNSwhI0TjeGXWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="231323212" Received: from os-delivery.igk.intel.com ([10.102.21.165]) by fmviesa009.fm.intel.com with ESMTP; 12 May 2026 02:31:13 -0700 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Michal Swiatkowski , Aleksandr Loktionov Date: Tue, 12 May 2026 10:47:26 +0200 Message-ID: <20260512084729.1338557-2-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260512084729.1338557-1-michal.swiatkowski@linux.intel.com> References: <20260512084729.1338557-1-michal.swiatkowski@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778578275; x=1810114275; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tz2+aBfguTWb6mMviRrhzIeZvuvfpFVmax6haPLT2S8=; b=FAsrWcAJ33U/t/cDCskrLibLhEq7mqGmM2QhQoJxI8EOlUgRyB1YRfb2 c+F7zTjflSnLfzLSbRlCD62vhR0NPnYD+DjUYXqgp+UVmcTr0eHYrslo5 qC9XD94yheFHn8cAQi3PgAu27G8jmXDFZgLfYPHzWX4eAWNvLSCW6iJLE Zx7hlml21fb3ARyP/C0o4yV0vLKBLM5oiblT6NYEnPOptXvAF6syEgOkb jDcE26LedwhFgm4PeO1sk/5R+HRdKy7HPndxPaWejU8Kqy+Q5teMAhRiz 5Zn3BIt0Wq6X0NX72g37oWAPiQWoPGD0yWtkp3lyXXLVqkTim5ljiOrZ9 A==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FAsrWcAJ Subject: [Intel-wired-lan] [PATCH iwl-next v2 1/4] ice: pass the return value of skb_checksum_help() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" skb_checksum_help() can fail. Pass its return value back to the caller. Commonize this software path in goto. Instead of just returning error try calculating software checksum first. There is a check for TSO in checksum_sw_fb. Reviewed-by: Aleksandr Loktionov Signed-off-by: Michal Swiatkowski --- drivers/net/ethernet/intel/ice/ice_txrx.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index 94129a7a9e12..f52a4af36eb0 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -1673,7 +1673,7 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off) ret = ipv6_skip_exthdr(skb, exthdr - skb->data, &l4_proto, &frag_off); if (ret < 0) - return -1; + goto checksum_sw_fb; } /* define outer transport */ @@ -1692,11 +1692,7 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off) l4.hdr = skb_inner_network_header(skb); break; default: - if (first->tx_flags & ICE_TX_FLAGS_TSO) - return -1; - - skb_checksum_help(skb); - return 0; + goto checksum_sw_fb; } /* compute outer L3 header size */ @@ -1755,7 +1751,7 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off) ipv6_skip_exthdr(skb, exthdr - skb->data, &l4_proto, &frag_off); } else { - return -1; + goto checksum_sw_fb; } /* compute inner L3 header size */ @@ -1808,15 +1804,17 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off) break; default: - if (first->tx_flags & ICE_TX_FLAGS_TSO) - return -1; - skb_checksum_help(skb); - return 0; + goto checksum_sw_fb; } off->td_cmd |= cmd; off->td_offset |= offset; return 1; + +checksum_sw_fb: + if (first->tx_flags & ICE_TX_FLAGS_TSO) + return -1; + return skb_checksum_help(skb); } /** -- 2.49.0