From patchwork Wed Jul 3 22:48:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723016 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78DD3191F6D for ; Wed, 3 Jul 2024 22:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047022; cv=none; b=QA4XZhEjED0A8Oc3UQO4SNceyLL674zNvjZ4yN41TycbenJJZPYsFzTx0K4y87YEQ+CaqMV+2+yqFuzzVKdGhq8/SGRDCI0CepyYyBl5ZIr8pNjd2jQxmHMNZHe5GPUwVT9D/5J2fgR8rdoSdS9MRHxbqVrxGVJVEiLf/vPCbwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047022; c=relaxed/simple; bh=Pi2M3jyyS7o7QkY6N5zKyeeNZDaFBAI+E5PAbFSIK6w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ClJx6TYyfLGiSwrzvo+Qrd0tWnKo1mraNBB8d1mNDHGef2Zuz/RJlJLLsqnVOmbubnmQII6/CcUQa/Xl4ZHOO93XNbavOmhkXxwgTVr7tPWx4lbAx0dmSqtlBHKC662k6m2XDx3ZOAKB+QqcMA1fLAjEl9RqDK0uiTInTsciGqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=HzGoGiN1; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="HzGoGiN1" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1fb0d7e4ee9so12321765ad.3 for ; Wed, 03 Jul 2024 15:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047020; x=1720651820; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pvdCJzTzksqtvShuKB6xdSGKXwmoxW8vC/dJBFK0TWU=; b=HzGoGiN1CUm0iDKNiciFaEuWwXoSlQucU5ClFx5S7zlhp1O4c9UGyAkKRZM7sz5sGw vB0piNLzQnKtVE4I0NNBbSehN/Ko9adH1XjzrSvEbSzTZB6CkC+SPpw9utVlsUf02U06 algv6fB0RRLG9VAkf6f9Hl9VMiDJ4vhnQAk+jPbjEyKCFrvNrquXw54qXfzVFgHv8PtB 0lRVBxDWhreF+maMmjTuYVHzttyWWcm9Z59E7xIxGRu+IG7MVF9HiD017Gob6OKhVlas 81nacAp241QZhOGfewoCZ+44GZzPi6/lOw5+N/GgXyUNAuXdsq3kQm9DGDAie2ZN19jS 7IKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047020; x=1720651820; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pvdCJzTzksqtvShuKB6xdSGKXwmoxW8vC/dJBFK0TWU=; b=ln2CLTe6i6RzQs+oipD5kszHhEXeWjXkfxWxZD6MvCRkK+yNruYeHNnK0HIoyUT52X bHzxxzQgNH3PRfe4gEQHkWkAG9f6MRmCDQLwbubcQ36UfdoqQv9aQdNXrKt88UH9kLDG BKMNLoF9Ohf0Jt5PEO3f5jrugxsKAyt3QFcEQLSkbnqbDCMOvwuv6dQuIoazrcwpftun Q2HXPHy6ZjXnnD2N9edNLldudgYU+OHmGP3N6QVCpo39k1nmwSTZBm7OaxmRkS+wEDHt FN0HNqYWnG7dXMFZhqvM/XV57lXKQI4x3VZWph8vGm1nM1xakfRmSsAShOjYi2Hn7UAO RaeA== X-Forwarded-Encrypted: i=1; AJvYcCXQhfy16yOcRGyM7MikDvtfpFMzMz7qOPKkLV7VV4X4nMxp9AhA91hAhbuI7sQIA57fahA7OwW3GcypW6hE6YixE+qk8Eb/ X-Gm-Message-State: AOJu0Yw2PvcuPEpojkwUSUkLwKMzwIyZFOET9ecry9xxxYsiklWdFBZ8 cL//IdqXERxCpRA6yrkg++L3c9qQJYIh3AWLqgHi5rq87xIeZduv3u++1GlizQ== X-Google-Smtp-Source: AGHT+IFCx2FFSzv0hxvckbKGzVBuA95+7V1Bwz1r7Y2da2RNkT53VkHEe5DZvgdB39uPtazNeIfYkg== X-Received: by 2002:a17:903:24e:b0:1f8:6d9e:fa9c with SMTP id d9443c01a7336-1fb33e0543cmr228155ad.6.1720047019639; Wed, 03 Jul 2024 15:50:19 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:18 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 01/10] skbuff: Rename csum_not_inet to csum_is_crc32 Date: Wed, 3 Jul 2024 15:48:41 -0700 Message-Id: <20240703224850.1226697-2-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC csum_not_inet really refers to SCTP or FCOE CRC. Rename to be more precise Signed-off-by: Tom Herbert Reviewed-by: Mina Almasry --- 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(-) 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); } From patchwork Wed Jul 3 22:48:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723017 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC05A13C8EE for ; Wed, 3 Jul 2024 22:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047023; cv=none; b=arddzglhWpqJ5hd1a7s9jDLa/GJmEMkSPnDo310jidCbgNghR9gxdNvoEhwEhNjhSyjunUpcKcHrhhf59J1cY3NpTyOVqZmok3A+aAQYxJ9rUlcPPdMvaakvEHo1i8Yf6UIX420b/D2CIO/ltMiEQL8ViHdSbFSnALEnfxQfn0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047023; c=relaxed/simple; bh=vWqf0Ku/TZihcy3YsfNgD8uDJxw8f2hi3jOdZ1h10GY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RjTz4zuZ6mpPRsKN1tfxjoUyYQKV0namFnPrittB26PHQUcDhuAf5u7PY1cFj4inq+LYhCleoupIiIu+w1ZVtjj8bSuH7VsdpITKCb27+9fc4CjnRIgpkenWrme0QVfoBsi2yECuSpbjNuFoz7ui6dK+DxcVr7e8mPvL5yjd7Kw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=KbdUyR7U; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="KbdUyR7U" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-707040e3017so4296486a12.3 for ; Wed, 03 Jul 2024 15:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047021; x=1720651821; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4+4223rrxsI4aokhw13pQNiFvacvgaAEpuPuOjIrohQ=; b=KbdUyR7UauBUKG63z6BkN3/bYtpO4h2UTrByGOVcDbumBVs6BJtFPuAUmupDrdoKNb NUsCA78lOH5t2YpKouMsvFNnCgOSqQqhz5wOxNVX6n3G8m9elqmL92H/wPVcaDmNBfXm w+Hu4NCoLMpTgzYydylTIff8nwhwxbY89ts9ut1MzFg4G/UmoaG/Wg+/Fow6L7/IlLb3 DeKuOjofKQ1Rth0tT3Dl2c4sla1uDdS338yF6ABWoXdl810tJevMKTVGFHgY4kUuRdfw XtAiL9vpvDM5ogQ1U6LlJbGsI+CLxeFbGvGlA/5K5TYz6yHFPW3lgwVe58Wn27LlLbg6 YPRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047021; x=1720651821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4+4223rrxsI4aokhw13pQNiFvacvgaAEpuPuOjIrohQ=; b=Xqt3LvpIiHsA3tBdCj3rgIL1lkyUy9foqwsG8cxFhpbS9lNTQK6TlMnMlr2ZmO0+gt +3NyoG+qqgGVUl3ESpWXI2GN25eI0APWyGbiot16M43J3XXJst2Ogwh6hfBHN7ckwgUx SM/MJisr5DAENIDFwNtL9NM3FneNS0rNr/UMcoD74GYNLXswvjkpMMvabR1ClxL0wceo 2sr7sFMka2U9KYWyjZSa2Jrd5R5zD9OXKECQXhwSXe9jgL+GvZuHFWCD9KhibwFUv+VO dC7H856mjFcdd7PjHxxehlzjFM327+56s59AtTXJxibTDa0k1067BMB5F4l7B3tVpMKX wr5w== X-Forwarded-Encrypted: i=1; AJvYcCWqB7Iy5xeqZ8FL9rpoNzWzNYbOOi5NQIFpGF+4pZXd6IOLK2TP8vMl63kcjItWny6A5AfryOp+iAc1H6vdfRF7zowAGsy/ X-Gm-Message-State: AOJu0Yz02y6uG112Z+jEG5arVLp6RM+oTdFXej43AnN/BMgywzbatS+h u6AJpE9zbbmZWb37F+reF0NnTM0CfPAICNrZiaeFDrSARC7iQ0ngy42c+ObvgA== X-Google-Smtp-Source: AGHT+IHosrRUDkz8fvCnRyH6UzAXi6KAalZdOFs9yqUXqj5RAe1YOZdin8uEoC4yMDi0SosN7b8Sug== X-Received: by 2002:a05:6a20:c22:b0:1be:d7b1:2869 with SMTP id adf61e73a8af0-1bef624618fmr13517436637.56.1720047020994; Wed, 03 Jul 2024 15:50:20 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:20 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 02/10] skbuff: Add csum_valid_crc32 flag Date: Wed, 3 Jul 2024 15:48:42 -0700 Message-Id: <20240703224850.1226697-3-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a device gets notification of that a CRC has been validated (either for SCTP or FCOE) then this is treated as an instance of checksum-unnecessary. This creates a few problems: 1) It's incompatible with checksum-complete. We cannot do checksum- complete with a validate CRC at the same time 2) Checksum-unnecessary conversion may erase the indication of the offloaded CRC. For instance in a SCTP/UDP packet where the driver reports both the non-zero UDP checksum and the CRC have been validated (i.e. csum_level is set to 1), then checksum- complete conversion erases the indication and the host has to compute the CRC again 3) It just seems awkward in general to be mixing fundamentally different verifications, and wouldn't be surprising if there are bugs lurking in this area This patch introduces csum_valid_crc32 flag in the skbuff. This is used to inidicate an offloaded CRC. It's independent of the checksum fields. Additionally, some helper functions are added: - skb_csum_crc32_unnecessary - skb_set_csum_crc32_unnecessary - skb_reset_csum_crc32_unnecessary Add comment about new method for offloading SCTP and FCOE RX CRC Signed-off-by: Tom Herbert --- include/linux/skbuff.h | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7fd6ce4df0ec..8706984ea56e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -119,8 +119,6 @@ * zero UDP checksum for either IPv4 or IPv6, the networking stack * may perform further validation in this case. * - GRE: only if the checksum is present in the header. - * - SCTP: indicates the CRC in SCTP header has been validated. - * - FCOE: indicates the CRC in FC frame has been validated. * * &sk_buff.csum_level indicates the number of consecutive checksums found in * the packet minus one that have been verified as %CHECKSUM_UNNECESSARY. @@ -142,7 +140,6 @@ * * - Even if device supports only some protocols, but is able to produce * skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY. - * - CHECKSUM_COMPLETE is not applicable to SCTP and FCoE protocols. * * - %CHECKSUM_PARTIAL * @@ -156,6 +153,15 @@ * packet that are after the checksum being offloaded are not considered to * be verified. * + * SCTP or FCOE CRC in received packets verfied by device + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * An SCTP or FCOE CRC may be verified by device and reported as valid by a + * driver. This is done by setting skb->csum_valid_crc32 to 1. The helper + * function skb_set_csum_crc32_unnecessary should be called to do that. + * The CRC validation can be checked by calling skb_csum_crc32_unnecessary + * and cleared by calling skb_reset_csum_crc32_unnecessary + * * Checksumming on transmit for non-GSO * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * @@ -1008,6 +1014,9 @@ struct sk_buff { #if IS_ENABLED(CONFIG_IP_SCTP) __u8 csum_is_crc32:1; #endif +#if IS_ENABLED(CONFIG_IP_SCTP) || IS_ENABLED(CONFIG_FCOE) + __u8 csum_valid_crc32:1; +#endif #if defined(CONFIG_NET_SCHED) || defined(CONFIG_NET_XGRESS) __u16 tc_index; /* traffic control index */ @@ -4453,6 +4462,31 @@ static inline int skb_csum_unnecessary(const struct sk_buff *skb) skb_checksum_start_offset(skb) >= 0)); } +static inline int skb_csum_crc32_unnecessary(const struct sk_buff *skb) +{ +#if IS_ENABLED(CONFIG_IP_SCTP) || IS_ENABLED(CONFIG_FCOE) + return (skb->csum_valid_crc32 || + (skb->ip_summed == CHECKSUM_PARTIAL && + skb_checksum_start_offset(skb) >= 0)); +#else + return 0; +#endif +} + +static inline void skb_reset_csum_crc32_unnecessary(struct sk_buff *skb) +{ +#if IS_ENABLED(CONFIG_IP_SCTP) || IS_ENABLED(CONFIG_FCOE) + skb->csum_valid_crc32 = 0; +#endif +} + +static inline void skb_set_csum_crc32_unnecessary(struct sk_buff *skb) +{ +#if IS_ENABLED(CONFIG_IP_SCTP) || IS_ENABLED(CONFIG_FCOE) + skb->csum_valid_crc32 = 1; +#endif +} + /** * skb_checksum_complete - Calculate checksum of an entire packet * @skb: packet to process From patchwork Wed Jul 3 22:48:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723018 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 175E21946AD for ; Wed, 3 Jul 2024 22:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047024; cv=none; b=G9B7K/dASPOCPv/k0CNETHJphDQdMIgICy5wR2A0TN9RQoQbEr/eY9LZInQzXXmRzt7V7jncX0bbQFZ9Eqa2UnJeRNxd7qwXnlhFDLQn6kN9/LfPOAScHWJGNtLVp6Uk/ioYDEiGjAcDF1Z+qMnadONgGMcWWmzYJVYQTFZMsCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047024; c=relaxed/simple; bh=vHw3k/vnc0AvDY42UtMhOAkPoRPw+6C2GmDPX+qMpQk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tRuOFU4m7nglCBZckNR45dImzHHrhKAli5xYtVvQ4Ln0MbOEnJObATXmvcqJS8hbcOw2+O45mvlspCyyR0Gkr6zCKescpoi1C00JgmqLJJTNWojhNdpRC2PfzHVhQVWVZf4UHbFDXcN36I6CXfu36QniX6SunGLCuphkq9sVcvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=b39GvHbn; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="b39GvHbn" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7594c490b04so847886a12.3 for ; Wed, 03 Jul 2024 15:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047022; x=1720651822; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uVi8l9klyfMSdBgsqxGLAILZJt9Kry9cOTzZnzdmEuc=; b=b39GvHbnoYVbJYpaaRyr00zD90YiyML7kUaBZFtYD+w0Bd+/6KDCtqEzXfZlZsst4V Dmy2XJ4GwlKjxdY9PFbmyg2yNgo9qerhf75WaOr/qmvDXN7iO9BfsXKPlDomN17OfXIm cWCsywHNmaZZpbDAJzDc6ZXKuZoCkdmy4hws/lPpqrT64QYdvQ8xQzFBwJmIaec6MyDQ YorQTqdOxEnEpjwSM3RYB4xtKST54COnd9KZAmahULCUe0eopPmkt4ILDT7ggEEeDmpB x+1uaWfSre/ZRdVEm0EjHj7YvItMH7/ujMgKLDvMUI7KHjmn9cdofKvpdPCTQlLySeCT oM2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047022; x=1720651822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uVi8l9klyfMSdBgsqxGLAILZJt9Kry9cOTzZnzdmEuc=; b=rAcqC8cW5ZipAmR9CJvMme+WDVVAhsc0G4SDD6amNrh16bZtJ1Uw75+qC5AUpaPLIf b9oH9S1SU7PMzHm6c9oync0wSxeETyksTgGiJq3nUeNnOjMYYqC+KGy6CGKw3G8szS3s 0z+KH2gQP3u7Hj3rRAitol1qNALGvdaG2UisWKSwWbUFRGXM/tpZBxWq/IAba727H6cM FlbjVi9/lsN5JCGpLiYd7vk327YMoy9SGeb1XrCNco/UnoYm81AwVohkBb3e5XJbfv5J kIRrQQUXgAb4CSPlbyE+seT/fAyS5mlriSEtmZ4HcQWujoe+p3joE1qtLP3lhsrA0EnB S9JA== X-Forwarded-Encrypted: i=1; AJvYcCVJYtVc2CzsGvMFfusms4hnPhQPRE48pZkalePI1lipWOBxul8BuPtoeu6Lax+hzUYkZUWugl270Go+z24pb7loqVVgyeWc X-Gm-Message-State: AOJu0YztrQsSCGbwLLvYkouBzSTilQctHMe0meMRMxBtqgloxSkZNaBf ux9ASE2vgyB3UEBiO++6dGlxRAi5rh69sxf4tvrZAOZMjtpilykmCHlkv5Gh1w== X-Google-Smtp-Source: AGHT+IFht41aqWqSjVGLHDI9b0xQXkAqs9V2n3rCUh6l+b23xLlNxGl5rysxtTyVbIqkQCviw+yh7g== X-Received: by 2002:a05:6a20:a988:b0:1bd:27fd:ff56 with SMTP id adf61e73a8af0-1bef6243146mr13268444637.58.1720047022496; Wed, 03 Jul 2024 15:50:22 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:21 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 03/10] sctp: Call skb_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:43 -0700 Message-Id: <20240703224850.1226697-4-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Instead of checking for CHECKSUM_UNNECESSARY, call skb_csum_crc32_unnecessary to see if the SCTP CRC has been validated. If it is then call skb_reset_csum_crc32_unnecessary to clear the flag Signed-off-by: Tom Herbert --- net/sctp/input.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/sctp/input.c b/net/sctp/input.c index 17fcaa9b0df9..aefcc3497d27 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -124,14 +124,12 @@ int sctp_rcv(struct sk_buff *skb) /* Pull up the IP header. */ __skb_pull(skb, skb_transport_offset(skb)); - skb->csum_valid = 0; /* Previous value not applicable */ - if (skb_csum_unnecessary(skb)) - __skb_decr_checksum_unnecessary(skb); + if (skb_csum_crc32_unnecessary(skb)) + skb_reset_csum_crc32_unnecessary(skb); else if (!sctp_checksum_disable && !is_gso && sctp_rcv_checksum(net, skb) < 0) goto discard_it; - skb->csum_valid = 1; __skb_pull(skb, sizeof(struct sctphdr)); From patchwork Wed Jul 3 22:48:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723019 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94FE0194A54 for ; Wed, 3 Jul 2024 22:50:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047025; cv=none; b=NSDDiBSqkJOgV3vrD9kcsLuzvPeEDdPt+Rv0y5vangiFaK1N/DH3jBce7xsdsUKO7z4PMrZO5AEJPkPLOlipGF0qcsvyYA1T1e7n1FYT3xGryP5c2eRZ8QLQT8/enUuB0CIywHmzVrFcY9S6+e8Cn2JbL+nDcgZJP6a0BKvw8sM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047025; c=relaxed/simple; bh=Z1edd+LljZkJgJp6YW2lR15kGEgaERpfIlOgVunUs0k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hU1aThhM14JN1I7YtBrZPodMuxwtEuw2mSZX71GfGY9iKO7x0T9o+fEvCYVk70t9NfpQOK5QSpt2UIN4SOaL3gD5teOl32YQXp2hl4XYpYronUGEUz4IIBM7+7qL9KTRDk0huTYAMLl2eH8pPWtCRzLi1+hhBpOFz0ZtqbDbdcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=fb8EMmPb; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="fb8EMmPb" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1fb0d7e4ee9so12322105ad.3 for ; Wed, 03 Jul 2024 15:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047024; x=1720651824; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+4t3ndr+pFBvnapLOjw8+L3ToUWBxuomlkfDw+qPrq4=; b=fb8EMmPb/HC66m7qm7HoE3Nhqq2+dEIEJ5vvoKaIjjxC+dGi63KUHnO+Xg/U+vRQZc twdRav8jucJBPeSgREyBm+o/yaOlAEV/D4mxyDsLyYabjEYOzccq/3vmzlx647BKXGc7 PlMuHrTiZ7sQIZv8Nqo21eMkh0PedO2J6tFKCQ+4SaEf0wrLatJsYH0i6dFwTWqWQbE0 1n/mbGx6t4A7KTWW5XF5PTjstjUcweZiOakGEd2gxZhCWAPs6AHK9pxiVN5iZSFWOmF4 pezmioODV4wJM0A/XrK8KE/yF2s8IKKdzmyHCldBT9cF8Dv0tmRf0NCDbAaNLghfq9Ne pMiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047024; x=1720651824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+4t3ndr+pFBvnapLOjw8+L3ToUWBxuomlkfDw+qPrq4=; b=BiiwmnbdLAZSoH05fM2cjzXsAwRnLhZq3tkeD3uoYU2tP9r1HLszUJSiJ973jiB1q2 ApbBMmMd5iumZGcHq8nn+xYwuonGmUBj04Cdn4SM9Y5Y7R0eF4nu2wGkN9KSsm+6365y 1Et8iKNvKv+vOi9yWJIC+AXM3jKPUvidJk5y9kbE/5IrwmPtmr8tUkH5rZMqt62XD+07 1oM91Cik9GBLSrxDvZsI7aDJfeBW6dE2Q0TBISE6LpWpvQEOiK0kzas7Wj3mgqTbN8yX lNiuCHffxI/CN0m4zIgMnzC2SR3RYbczgbphNWTZ3fqQ5eSzjH2OxTqrn2xSq6QbJe9X 8PnQ== X-Forwarded-Encrypted: i=1; AJvYcCWIa67KFERvNT/8gjg6hQIkog5wwpgBMQoRovKzEL3yXBWoNOa7354zfq+DQMvkZ+2FJv8Q95xpn4fWOiGUkztk+UmixvH6 X-Gm-Message-State: AOJu0Yw6ULG1qllij5iF9OQrqEHOInYXHE4UFijKqeEwv+BKbRQRGiGV xeg+0FhGtvblDTYfA2kdig1KzY51ce+O7yeW4MKzj7cYUx75RNRA50S7bpJ+Ag== X-Google-Smtp-Source: AGHT+IHTwp+HIAJSYEPZvRxk8HsKBhCj5fqJEV/VWzeWBtx5I08EDKLYMmY1PJtG+2MiOg3WEUojPQ== X-Received: by 2002:a17:902:c945:b0:1fb:29e1:7635 with SMTP id d9443c01a7336-1fb33e053a4mr82525ad.13.1720047023849; Wed, 03 Jul 2024 15:50:23 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:23 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 04/10] fcoe: Call skb_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:44 -0700 Message-Id: <20240703224850.1226697-5-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 --- drivers/scsi/fcoe/fcoe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) From patchwork Wed Jul 3 22:48:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723020 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAC001946AD for ; Wed, 3 Jul 2024 22:50:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047027; cv=none; b=DBZWC1ClbEPiRCykzVtRkQkS1I3rjOzaTy+oyWkcNO7uewBwo8+1q4789qI624VcEUCJFpFlqhraYd6gQN9KSV5hSttdhE/MxVSbGOGTKmRxKu8L/XuzCRiKjhVrJ/sJ59VlrPcQlk8fsZlrHgJE0VCHVabOdM2WRQSh949ZHgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047027; c=relaxed/simple; bh=GK9+4fsw5mg3MTHQHZsEP8Nb3K40cBkZUobb4VT8edY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=W5ChA40eaVgvJuSdobBkbr2mK8n9mqZhGpTF7/yWOif6UKS0oBGKae9bIMbRW6XOYGU2K2UzjnK5sL7qGuhJSU4BwcwfpbK9VSjbcT6gkIALuqN4u1Glzod1oZ3t0BxicM2VkOphzbc1/AZiEnhbjtI8ZSJaVhy0DSljCVqd610= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=HQwTWfcW; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="HQwTWfcW" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1f9ffd24262so13245ad.0 for ; Wed, 03 Jul 2024 15:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047025; x=1720651825; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qgUwi2TajpGKplBiRXJeG7L0Ro59oIO9Uz5u0Fl3C4I=; b=HQwTWfcWAnkwvxNjxlrG/WP3iitdUDUWWvApiTpPZmjvzyFbVLFzTT8p+1U7GbMFoC kZAZnk2hGbjiEB4YNgIqyreDzRLpiQn6km0e/IIch0q1UYBm/DygjTsDh6XJYxZUcO3x VA7A+2TAS+LWXL+8RuyGjWrHRFlQmpiVGdgLC5hb4bN3P8jmA2+fg0gtmw46f8RpkBnN j+8V7khSoaYF3hS2dymvyaLQbfAxtFH1Uqa+VBtqkACo1hjLV1yOVvJ2FIIr4KWtDpAE r4LCIMkAxFGW5WsHQZoSd5dN48l3dg4Oa6wWJDioFA2lCXTjvl0GjkgOa2KUCG+xRSGK Zh0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047025; x=1720651825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qgUwi2TajpGKplBiRXJeG7L0Ro59oIO9Uz5u0Fl3C4I=; b=qNCyjnMufFMW8DLZLKROmpbnLHWQIPVFxuyNV9n8uh7TRRAjNoc6lDYJCjBJSvMVIE V/amyFItSt3fUJzO40A3DOhYdeyMm7g3i+HCpEChMekfpaf237MZYz3jXUjXNhd3in9/ lYN/kpeJGJaA1xNCxkLZ+du8+Dm62cVF2CdnfaXPkCye9hEx7nlEbknJ+asXGGyCMIKJ zLH380VuZSX/cQi+x/EaqCuviYau5FnBXOEksVXaLdvDSs8UYhHOBc5TXBt4DRBLLPx4 Z1T8mlzwtUnpRtO1lGehJm7uQkrPUaRxMDU5S3xSFjU/NDbDHqbR56mbfsp5JUhUOBLr ycKg== X-Forwarded-Encrypted: i=1; AJvYcCVVaWMSe7YagvDKEX2M9hclYZ/b6YtARm+mJvV1+GHOcNi2k+zf09EK2dBrrLQoYJ1yvA/k1KahEBCypNADmkOPHfUP0nJn X-Gm-Message-State: AOJu0YxIU/AX9iptxD0RDw2y0GOfNMq27eNsaAeIIXoRWUhkKQFt8VIS FpuXlwymnQMs5VSwD8XcXcb8uw4/pNtXEbVoa4VeTEm/xkPeawdy1CtOZZ7XXw== X-Google-Smtp-Source: AGHT+IEGx6Hc6SuyMDHoBdQypFFwS7PBiucaSyCsci3e/42za3IQqfSn6uhJ3zDm1omCYe9IUvqr7A== X-Received: by 2002:a17:903:2308:b0:1fb:2ba3:2f6c with SMTP id d9443c01a7336-1fb33ef9152mr24465ad.52.1720047025138; Wed, 03 Jul 2024 15:50:25 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:24 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 05/10] cavium_thunder: Call skb_set_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:45 -0700 Message-Id: <20240703224850.1226697-6-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a validated offload CRC for SCTP is detected call skb_set_csum_crc32_unnecessary instead of setting CHECKSUM_UNNECESSARY Signed-off-by: Tom Herbert --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index aebb9fef3f6e..72157f9542c5 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -824,7 +824,10 @@ static void nicvf_rcv_pkt_handler(struct net_device *netdev, skb_record_rx_queue(skb, rq_idx); if (netdev->hw_features & NETIF_F_RXCSUM) { /* HW by default verifies TCP/UDP/SCTP checksums */ - skb->ip_summed = CHECKSUM_UNNECESSARY; + if (cqe_rx->l4_type == L4TYPE_SCTP) + skb_set_csum_crc32_unnecessary(skb); + else + skb->ip_summed = CHECKSUM_UNNECESSARY; } else { skb_checksum_none_assert(skb); } From patchwork Wed Jul 3 22:48:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723021 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01799194A70 for ; Wed, 3 Jul 2024 22:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047028; cv=none; b=HLuypKInxznJIc071zt2W+z7D1hsyXMlClNaMv9cocg8uqxzIpBvVyz5B283eWgjy2cALqiWcS96kBxvAjC0v4yOEzSU0eNQpc86Tmv14vQXCXLhFVRA63pYaEQs2biUdHiQXqptT2Yyssen7291flNmM6qI8EuU5Mumyp6fpNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047028; c=relaxed/simple; bh=ODC+NLHO9+y5HvYJTWpPj/RQZYWNemYz2CDOr4dRepg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s8PH+1begir8r9SAecJLzS12UdLX/F5ijKCUY0S9IbQOPC0x/njsRC7en5DyZ77yYcHm5RBNx7CPwHwO2KeHhLzy3uv25n6ks4XEWMvGJzkOcVTKUyW5RBB8F+bn0i8jOqmRwjPK3gGSUE3jT7jf71aXtddgrlRHSKowg0/h8cw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=HKP11kKp; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="HKP11kKp" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1fb1c918860so7201665ad.1 for ; Wed, 03 Jul 2024 15:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047026; x=1720651826; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NG3PkBYfDw9CXlmfyI3No1z8oDJJz2o+0E4ZNJ+xuns=; b=HKP11kKpYi3YlYvMvuNg2IkdLa0+AtdPrA5oa7ZzP05yctTmqXxFtDZKT1IMRmh73w 3+ui10GKNunGfzfPNTk59Ukr0DM1VqDqT2hEKTTLVe5YoMOH5THAPYFWTHn8kLJzZ5qI +z5gWeDXQ6TFm75Us/5nccaAPIkfy0/dO0sFzJqNOIOE7jhkOB61yym0apl0G/mnvsk8 pdpMb4VHmkDLa7MvG5d1aa4vZud+magO6HMRTKTxsfa0UWnFCkU0exo+eg0AhXzCZjKE tT6TtJU9eJ1zQw6GRlOhgg60JmLVxUYNPuCqjm4ukZjzvr0Iwb7RyRchfE9ubFpzSsiG qInA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047026; x=1720651826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NG3PkBYfDw9CXlmfyI3No1z8oDJJz2o+0E4ZNJ+xuns=; b=fTKd76OLke4CPF+L4zXXuO6rACZgJ9RLc9IVAfrmb71pbOXWIfGKgJDgleGSNLv2ID m6JU0qSc6PhO0U620trD+iFtqC59F6xx/n0R7i80gh40TuljztbxDaGnHA5fJJfF2m7h 0B2YqbcMRCog784tIAe7p45xK8NPtyHW57gE7nIngXc5dQVncNcthCj1EnOMsZt/7KeE kktpEzIuUXZXfvDgty1bioCEEkq872LnKKu/WwL5iQYWDksRDmCJFV0Pb8tuhWsnGehw ZlKECNQGT9V0daEPuamngljlKDPH9RE4MaQ2adEI00QflSSnvdan6XjqiTIuEA2cePnP m96Q== X-Forwarded-Encrypted: i=1; AJvYcCXR9+wlgNzK5iotujB76Q8fmnlQLD86M7bD4yb0GX+HxMELwcqvQz8/jCgGlUdMOuXrFnPb49sP0bVPEVSOL7d1aoY7ApLE X-Gm-Message-State: AOJu0Yz3pNyT9Kr6pO3XPICIGSYPLRCaO2wXchv8Clp9tO2DAhAcaBdk Dco747ON9CSnE1JQAIffMpNIuVzSNg/gjoJO4GTloU/vG9cuSJR7EjDgy7c6jL1hcTD7Ju3w02c Urg== X-Google-Smtp-Source: AGHT+IHzSW7pMQq+b0QPnBGlwWl5gKhlOIoqlcec1vBprsh7VjFfAfQm2aHuLNZTwULfQ66+Rl6z5g== X-Received: by 2002:a17:903:2350:b0:1fb:3c1:cb1c with SMTP id d9443c01a7336-1fb1a040251mr47730175ad.10.1720047026395; Wed, 03 Jul 2024 15:50:26 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:26 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 06/10] gve: Call skb_set_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:46 -0700 Message-Id: <20240703224850.1226697-7-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a validated offload CRC for SCTP is detected call skb_set_csum_crc32_unnessary instead of setting CHECKSUM_UNNECESSARY Signed-off-by: Tom Herbert --- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/google/gve/gve_rx_dqo.c b/drivers/net/ethernet/google/gve/gve_rx_dqo.c index 1154c1d8f66f..d3d6d7c6f253 100644 --- a/drivers/net/ethernet/google/gve/gve_rx_dqo.c +++ b/drivers/net/ethernet/google/gve/gve_rx_dqo.c @@ -625,9 +625,11 @@ static void gve_rx_skb_csum(struct sk_buff *skb, case GVE_L4_TYPE_TCP: case GVE_L4_TYPE_UDP: case GVE_L4_TYPE_ICMP: - case GVE_L4_TYPE_SCTP: skb->ip_summed = CHECKSUM_UNNECESSARY; break; + case GVE_L4_TYPE_SCTP: + skb_set_csum_crc32_unnecessary(skb); + break; default: break; } From patchwork Wed Jul 3 22:48:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723022 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47255194AC5 for ; Wed, 3 Jul 2024 22:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047029; cv=none; b=UGKSX9jjhg7MvvFNnz8QB6oG+CK3ac7rNYOYX+iJ+rfXWBrGCySahnr50yDGKnqmnyxsnaVAXxt8/PLuJN6vTdkBWrxU+Z03DVri22TGPstzKRt4SsB9QV6+bZ2EHENVPMOK+j5D0bDgCwIGWQes5s7Ikf/Ilo34k1mLXh4rsBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047029; c=relaxed/simple; bh=y/5XBT2zGJLo4oaSgQhEzSNcfSeLqRTuzxUK43iShk4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jxv05Tui+XT2B+Hv6wNyxQt+IkSAh3Lo+YdhrGtri9Vcx4JO2bzJ2fksfjCNzNCnlzzQMYz1FFDcCgqWlMOzcueu70D/xE2oxAP1hIGfBgjZL1WQH+CvPzihVVQrYhVikh6vDQymzH/Ma+b1N5Gpd04bAnOT5rX/l/2o1ai8nBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=HwJUGHi+; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="HwJUGHi+" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1fa55dbf2e7so34927705ad.2 for ; Wed, 03 Jul 2024 15:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047028; x=1720651828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JQ1mn/CTHjHcc9W+sTHEOUlyKZEA9X33Luiw+Y6JViw=; b=HwJUGHi+OHYxiTMusrnwvYCrclq0cOdqZhFNHQaxIjEp6S5x9bsSPSrPkeJfAkoALP lhu5rW6fyi5Ucp2CF3QXDIRm8MD0YkJQZPPEagtREpaIp7lZ5w09Ce6o1UMa6T4KsPeX Qribz8JYDOHFJUOVFQZFkWeX+PjO1031gxBFwaKLUU1m0cYwudxJEERYy473fA1ltvmG HIVS8QQELQe+kcvshC2HhaCdpj0OYt7kwc3ARyFh4XfRrkUBnaDhSvRy0cy4m3sJDJqE rTTDJvOao09IZ4lWLjAJR4J66WAzGOdBZHJAX1nBIAFyKCu/9iY0tVNxIeuqkqvZBCf6 y28g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047028; x=1720651828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JQ1mn/CTHjHcc9W+sTHEOUlyKZEA9X33Luiw+Y6JViw=; b=oeGfSrDS4Ijn/TQgKaOnFRISqKYFQvltoaQzKq2W9z2ie5J+LYz2adblvaqX3MKt6o WBOmYGuNUebgeNiGGDWLpfV5O/dms1maNA8jgxD7ghnE99HONyNHatVTXuBo4YzTRIcH mbrAliv48RAiCFVge7kQf8V6oqzzWIs8Nq39f15A6jJv9pc+Y1NRxkxR5yT/IW2ulhZg LDp20cycZupaFa0chKWzI145ObhDgJKVEGFyqQ98PhPKj+wKxXo/xZmTysjNQBAQOMSm u66uJH2/r3afcg9RVQdW1Cu7kbQLYHrnLk230FIhKf3nvOm9USZQRUbi0QMsIt7o720w 0+Kg== X-Forwarded-Encrypted: i=1; AJvYcCWG/p44Vu9vuxrENjKWEP2Rvc5UhFV6aFTZ8UxteO6BSgN6YgXDLelaETWwc9K9PSX4kxDrwY3qvRAFfe2kF9Fkp+gUMTog X-Gm-Message-State: AOJu0YxUsDCeD6rnqxumuqikv9XJlAmkrPZlc1uxTWbovetxkwhBzX/M lJVxMPdDYeSPqEdVoHfPp2x9QXLDcSqcRKJSqCvKDnjxu9SvQ433d8WFaTHgUQ== X-Google-Smtp-Source: AGHT+IGa8vzfyd/pKoF9FzRFSbE9pKBdacGN4QEAVONB0O6p6w6GixEhWA5JMCkThFXi/HbAHnpJCg== X-Received: by 2002:a17:902:f78e:b0:1f7:2a3a:dd9b with SMTP id d9443c01a7336-1fb33e19b57mr121745ad.18.1720047027710; Wed, 03 Jul 2024 15:50:27 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:27 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 07/10] hisilicon: Call skb_set_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:47 -0700 Message-Id: <20240703224850.1226697-8-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a validated offload CRC for SCTP is detected call skb_set_csum_crc32_unnessary instead of setting CHECKSUM_UNNECESSARY Signed-off-by: Tom Herbert --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 5 ++++- .../net/ethernet/hisilicon/hns3/hns3_enet.c | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index fd32e15cadcb..f3e8b9cb3779 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -556,7 +556,10 @@ static void hns_nic_rx_checksum(struct hns_nic_ring_data *ring_data, return; /* now, this has to be a packet with valid RX checksum */ - skb->ip_summed = CHECKSUM_UNNECESSARY; + if (l4id == HNS_RX_FLAG_L4ID_SCTP) + skb_set_csum_crc32_unnecessary(skb); + else + skb->ip_summed = CHECKSUM_UNNECESSARY; } static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index a5fc0209d628..5fd98854f72d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3908,11 +3908,19 @@ static void hns3_rx_handle_csum(struct sk_buff *skb, u32 l234info, HNS3_RXD_L4ID_S); /* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */ if ((l3_type == HNS3_L3_TYPE_IPV4 || - l3_type == HNS3_L3_TYPE_IPV6) && - (l4_type == HNS3_L4_TYPE_UDP || - l4_type == HNS3_L4_TYPE_TCP || - l4_type == HNS3_L4_TYPE_SCTP)) - skb->ip_summed = CHECKSUM_UNNECESSARY; + l3_type == HNS3_L3_TYPE_IPV6)) { + switch (l4_type) { + case HNS3_L4_TYPE_UDP: + case HNS3_L4_TYPE_TCP: + skb->ip_summed = CHECKSUM_UNNECESSARY; + break; + case HNS3_L4_TYPE_SCTP: + skb_set_csum_crc32_unnecessary(skb); + break; + default: + break; + } + } break; default: break; From patchwork Wed Jul 3 22:48:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723023 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE15194AE4 for ; Wed, 3 Jul 2024 22:50:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047031; cv=none; b=WwJ5pAM8JaN+nSvXEEnUE/woK1fhZhI2gMQcsenViHOKB/iCMkVhRTjzQqRFkOxUF8bsK77DpACS2bdFgSSbCsdgV+jGkY7uQ/r1pZ/JNTh+sC+6TzYB58GGM28YTk+nw4dbBcuaInG4IMEsu3xY6mHVZP8UlCOW2JJoN45VoRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047031; c=relaxed/simple; bh=I01JCujZD1QdPv8eAGWz+U8ixUImkinN7MOWEG4qw1E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GgI3a8y+dQS61rPH8PkFdL8cgSkxRHMJGQ+VM3wXYICr+NGI7wXk+zwXdE/gEP8iXmZVjle85a6sEvgzF3mTHGMGLVZR2b1nChN23YcUvSJ6bhQamg8ggJdDYIszSXQb6h7rgWj6luAplMyVdOYr16dgDKeYeBJ6ZUsbcEHDdAQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=Osm/d23j; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="Osm/d23j" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-70af5c40f8aso55701b3a.1 for ; Wed, 03 Jul 2024 15:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047029; x=1720651829; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XTJo2+TT7Z/E9Sx4mrv8YBG7pTNZiSk0WbKEcv0vnsI=; b=Osm/d23j2ADi/HYVO/+zNd2vk3ryU48fpmBcgsy4MKEqdp5RVwkw+bR2XYoFj5e+jF eVUpDZTabP4TwhbXbgvYRpnfIuDi6XbLiQCCtyhWF5vYWv9sGuLtW9tA7lInfFKnWfVM XZve40pPzL3hvCa1luWw3bNwJKzewoCxW1plXp6aul9EKbkEKaAzLZsFxjV+8duPk3D/ /zbcHpIhBIRrnvTKA/FCV1ZxrokSLqRYIYzJ3c73DIlVvf1GuQQ9QxSIsiykozdXFfsp BGETFJLuahejHFH6HNHd/BIKRFB34kvpZZiwwTNBFtNmOvun/2NYs71aaUTC+r17M3FJ NlcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047029; x=1720651829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XTJo2+TT7Z/E9Sx4mrv8YBG7pTNZiSk0WbKEcv0vnsI=; b=dXXo80HySoDUPCbPAsaVFsRAmojPKcHMYgv7VblcLUMOVXFu97muuVZeo9wjvWSvmG VtFiRy94IsJDxK1MH0nBr8Yh1PUX7+053Y1Gy1X7RIfEv+Lhuf65d9/tBvQCW2ybnZy6 CAwcsYRfj3g5e3wf+ifbyLKsruaejZPE0Cd9VTaFlVMZky2B6+4ATKGE3eTw2ZJiughH Q1bRUuW+dOuWMylwgQuCl7o3GP9ipjdp2SjK0j8M1hvTOVvF2w2VKxLK6lxnxdKnflk2 B4lq4Al2RIi8l4FlAU4H3FhYmoLRQavy4SKGOxhPc/q7gUDNThIotgiD87exWejmwR7w AQDg== X-Forwarded-Encrypted: i=1; AJvYcCUrIapSxcyND9m1qoeStfwLHbAnbdOxPsNIKouHKPN/F+VJ0Awp5OkTFAQQ9XsEStS9FjUUGNIbaYVmQ4T48EjmyVZrJGGs X-Gm-Message-State: AOJu0YykaNUE4aobJcZyhzZ9YY0m9v2qlx2Ll8YV39XK0z7giLlBuy4F fvC8U7GMuB4RX4PaRXzZfETGtwgSgklQ0MYp7YOQbSbYN+saH63XEj+VzPis8g== X-Google-Smtp-Source: AGHT+IEpoxIlMPMkciQWHoIgF80I2G2SKnASFU6Q4wZeIQNRPbU26UlEjqw8rPc6IXvxIHYhOrU8AQ== X-Received: by 2002:a05:6a20:9143:b0:1bd:2358:8c94 with SMTP id adf61e73a8af0-1bef613f4a7mr12661149637.20.1720047029034; Wed, 03 Jul 2024 15:50:29 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:28 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 08/10] idpf: Call skb_set_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:48 -0700 Message-Id: <20240703224850.1226697-9-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a validated offload CRC for SCTP is detected call skb_set_csum_crc32_unnecessary instead of setting CHECKSUM_UNNECESSARY Signed-off-by: Tom Herbert --- drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c | 4 +++- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c index 27b93592c4ba..0ba7abd87d05 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c @@ -698,9 +698,11 @@ static void idpf_rx_singleq_csum(struct idpf_queue *rxq, struct sk_buff *skb, case IDPF_RX_PTYPE_INNER_PROT_ICMP: case IDPF_RX_PTYPE_INNER_PROT_TCP: case IDPF_RX_PTYPE_INNER_PROT_UDP: - case IDPF_RX_PTYPE_INNER_PROT_SCTP: skb->ip_summed = CHECKSUM_UNNECESSARY; return; + case IDPF_RX_PTYPE_INNER_PROT_SCTP: + skb_set_csum_crc32_unnecessary(skb); + return; default: return; } diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index b023704bbbda..3ff1d181534c 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -2804,7 +2804,7 @@ static void idpf_rx_csum(struct idpf_queue *rxq, struct sk_buff *skb, } break; case IDPF_RX_PTYPE_INNER_PROT_SCTP: - skb->ip_summed = CHECKSUM_UNNECESSARY; + skb_set_csum_crc32_unnecessary(skb); break; default: break; From patchwork Wed Jul 3 22:48:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723024 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39297194C71 for ; Wed, 3 Jul 2024 22:50:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047033; cv=none; b=TqufPLBPQoMQPXf3fNjWhWLOThsuETPfvpwYhif1g81gvmDLVkDv1L0nfht31zV4lAzKbd7HKxZRVU7mNP9LATFnFt9oTuOw7EviuNPzGNOO69u6KWkYc8Sp2Qgob8aQ1hvYzBS3FLbe9Zm2ndz4elcrbgsCb5UydZ+EsIA9Dws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047033; c=relaxed/simple; bh=HdhNc6puV5LHlIu/FJNDxQMKEPvfSVr2WnOn18/pX5M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uDhIBZhkqsCKJXK6Z4YwiqbHAQ+tbaRz6wT9cysZcYdpt2k5yUzKfU5IZ2oBvZbRXVZzV1fN222B74O0o1s0Xj5b+JUREiMF4kJojeFvN52spNp1lebXCrQ62WLGLDqJ1ekudGXxEi7I4OF5aWNacJMyfM2ZWvBrQWFEUgAgVl4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=VXZxA4NJ; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="VXZxA4NJ" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1f480624d0dso44473535ad.1 for ; Wed, 03 Jul 2024 15:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047030; x=1720651830; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P+yNCweG/Yf8+MG+MGoYnYSGFgT1VkrzUbhAYTabS04=; b=VXZxA4NJAf2qGgVqHrBApLOEYAaumoH790I8kk8an/2Jcpn6EDOhlqfr1qlDB2EU2u 7zA+cA7jpNe3mm1h/+eJtCCTwtGz5U7FO3oYnVsGnQA9uknObcS0Bh9EJm2e/z0oPLGU yhe8+63ZHfrqu/+ToeekIuhAvLcRMU0k2u8tiJvDQrsvjv4NPku41DSpvrpcB8roHXn6 VxS+IOngoHHfzDIGrPaJdCCkHlApsQ4gKQ6b209GCVWsabnzrxYmzx2dtueBXSU+P1Uu vLjaiLW2ELwNiE6DedM4oVgXsJLoaUFr+JdSUxApyK54w+yscaeDr4PO2QgFBfWG8BTg Nw4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047030; x=1720651830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P+yNCweG/Yf8+MG+MGoYnYSGFgT1VkrzUbhAYTabS04=; b=rOIrZnTwIpYnRtdMOyQK9K2pBJLgyJVmPv+YMwf+NF/NuT8e6FLIEsB1wg4VLURQnd u5TO1nwR5fsjd8xRzjArnp02YMCGeMlwi60Fr5rY6CPTHglmtlmw1DuqI3JgZG0ZCApD /QEj2MxJXHple0RY6r+UF7iXCl0N4V/8cUgAHmw+u1k1KIyVBwmrzvnaTO5uxARc0cIA 41cLAEoKPMs0yYyIU0VposZbapCYPc/l/yzsMBitOK3paJaDBzujDw+wmq8M8ZlvEpFl ipazM6W3/GPY11Lbm6EfCPT8HvVf32FHoxgWFOWVJwGqFVCCwd8DHPD3fyUDb5Ep9Mjp Jyjw== X-Forwarded-Encrypted: i=1; AJvYcCV7T6FoTLEQw8dNr82kJkMa97F3teuDigcsUZAkc3cE7ZULuaGBhcSnjj/e7wzaAptlyV3GtP8KPqF47NpulhEVxtxgPOG+ X-Gm-Message-State: AOJu0YwVSiJXD9u6/Jm+4mvgfhEWVOrQisKNnroZ+jRYKZqQo3R0+Q9Y RhmXBL8cMoFFsmfz8SieLHaj7EMqiAjTtX2uIcm9/wz9zFMXcuyX/PqzHBqNIA== X-Google-Smtp-Source: AGHT+IHlG/rKOsUbmB3AFd2YKQDvaT2A5M6VRv7uxMT/MEGoVtPuwXaInmMUIMn0qTOvIf2M8L7smw== X-Received: by 2002:a17:902:d50f:b0:1fa:acf0:72ab with SMTP id d9443c01a7336-1fb33e1835bmr229535ad.16.1720047030528; Wed, 03 Jul 2024 15:50:30 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:30 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 09/10] ixgbe: Call skb_set_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:49 -0700 Message-Id: <20240703224850.1226697-10-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a validated offload CRC for FCOE is detected call skb_set_csum_crc32_unnessary instead of setting CHECKSUM_UNNECESSARY Signed-off-by: Tom Herbert --- drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c index 18d63c8c2ff4..4596dd85a171 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c @@ -398,7 +398,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter, if (fcerr == cpu_to_le32(IXGBE_FCERR_BADCRC)) skb->ip_summed = CHECKSUM_NONE; else - skb->ip_summed = CHECKSUM_UNNECESSARY; + skb_set_csum_crc32_unnecessary(skb); if (eth_hdr(skb)->h_proto == htons(ETH_P_8021Q)) fh = (struct fc_frame_header *)(skb->data + From patchwork Wed Jul 3 22:48:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13723025 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63E59194C74 for ; Wed, 3 Jul 2024 22:50:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047033; cv=none; b=rojNEJPiZ/0pdP2r+mtM+vKqZ4c4k0lmLe/z85jDZm/kvlmsrKVkBrz7cQ+Gk8Z+dvaif1hBq9tkpJhsSWKH+2mu627ayTpidwbgPGO5vpyl6i9ozWby4f1wkNliZUWG2dQS+orq+FUOjrdngpy/9i67H68LW2hrSfJJBSas5T0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720047033; c=relaxed/simple; bh=okRvaY6wtYOig2tH4YWvxkGWOqPOk934c69zOtz6okc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YXlOjIEuNMgyWkWfPXOGZfQjblejRMNDbpMicFkc6baUfXnMDi5kjNtVFVu+9n4RFSlnuv6Nt0t4lC71jUYcyJp/oneSGiq8W4uTy9lM22Jjubr9XNAN6dll1kdwVgOtLPxOaRd1IVLZcqJDuZgGsCQR6HkJUEoP4oWownePPE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com; spf=pass smtp.mailfrom=herbertland.com; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b=hI1sXn2/; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=herbertland.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herbertland.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herbertland.com header.i=@herbertland.com header.b="hI1sXn2/" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-75ee39f1ffbso121874a12.2 for ; Wed, 03 Jul 2024 15:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1720047032; x=1720651832; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LcNhzgnbhqKwod4mhnhz7z6nqA0gm1zz3hxNpqKqAH0=; b=hI1sXn2/W2JvZXpe8XAnVclI9BCLDK01knLBzvH84gYh2bapk4jwnWRqkHahxi0M8F b06pg39C8kAkw4xyzDoXERQ+4mjxYRv7BDMraXl7S9GaBgRG//UvXJB87geVuhv/HCY+ LMybU+/B+pU8LK+wBVt5toOZB2iGfmBRStaP0CJvF9t4Zp1kypiftwpzi7d3eCas7raC 91R/XFjEotiDHUYUiwvtzrMxQQNt0rfTnjkw/vVaWMJtxfrhSuiehAChm04oo9NUmoIL KS1E51GVGKTOrmNaWzQMdETi4Q/zgOOKA0BA6OHaqckcIhI2xIC8srI5zd8owbC2OXtl QZdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720047032; x=1720651832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LcNhzgnbhqKwod4mhnhz7z6nqA0gm1zz3hxNpqKqAH0=; b=LTPy1WFO7U8C/RGuI7NMmcthRKqQkFrlrdxpJ9lYfHOfYzZLWLkAUWulzEkqPrIKDO hgmQyKDaV/khBM32+Jz4L5X2pElr8g5FEZgpZXmjyx93OWufc39wvz2updXBQFb9aTU1 SCHB3pJ99JASvzRhTXgtCx67TvnzEPPgaHXm6yz5Jre443lBm03S+XIrgQAEt/WBIFi6 UYzWDvUmpkZhJakJ2vbD18uAFFo9g4yvblaZ6cze1ILR1KeUiDuEzGN00Sl6PBBVcmPM AKjirAiS2QoS7x/M28tZ53XGzyOWGNHXa+8UQa9Gu1XVZS2ccC/IN7LxTk8mrt8TDddX NfRg== X-Forwarded-Encrypted: i=1; AJvYcCVnqGRM/rmjNQNY0lD9n/YYdYu/s0Dh8GxeCEOJFN7eTahES6uMEFyLqZi+w/g0aLLV1IjHWUAtsTnPFpYFfVDHXqOgJOLh X-Gm-Message-State: AOJu0YxM2Ar11l76ymqlAlGYomtWeyQY4bDWJF+FDOYT8RlUx2jyONyY X+A/hp7VYoTrECbg/BWnIcZf/eYGsDmXYDfWKnzvyn1m0FTJ4ExLr7ie1Ws0FLgd87K1Rl6c0O7 H3g== X-Google-Smtp-Source: AGHT+IGRLAmwIA2CzBRXhD4FX4my0Cv78WXeipXidFdalbHwFMRdRL8OQFAR5KS5LHkIWp79pLZGPQ== X-Received: by 2002:a05:6a20:1584:b0:1bd:fe8:fc9a with SMTP id adf61e73a8af0-1bef60fc0demr16930039637.17.1720047031780; Wed, 03 Jul 2024 15:50:31 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:af8e:aa48:5140:2b5b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1faf75b3407sm40242185ad.85.2024.07.03.15.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 15:50:31 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [RFC net-next 10/10] wangxun: Call skb_set_csum_crc32_unnecessary Date: Wed, 3 Jul 2024 15:48:50 -0700 Message-Id: <20240703224850.1226697-11-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703224850.1226697-1-tom@herbertland.com> References: <20240703224850.1226697-1-tom@herbertland.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When a validated offload CRC for SCTP is detected call skb_set_csum_crc32_unnessary instead of setting CHECKSUM_UNNECESSARY Signed-off-by: Tom Herbert --- drivers/net/ethernet/wangxun/libwx/wx_lib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c index ac0e1d42fe55..8f4ffc961abf 100644 --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c @@ -558,7 +558,10 @@ static void wx_rx_checksum(struct wx_ring *ring, } /* It must be a TCP or UDP or SCTP packet with a valid checksum */ - skb->ip_summed = CHECKSUM_UNNECESSARY; + if (dptype.prot == WX_DEC_PTYPE_PROT_SCTP) + skb_set_csum_crc32_unnecessary(skb); + else + skb->ip_summed = CHECKSUM_UNNECESSARY; /* If there is an outer header present that might contain a checksum * we need to bump the checksum level by 1 to reflect the fact that