From patchwork Mon Jul 1 01:20:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717461 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 B687C20ED for ; Mon, 1 Jul 2024 01:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796886; cv=none; b=oeeDL0OwV5F/Ttmw/UCPxfiKGdx6whbvIorlb6NQgCEp7EAUtbz5fgY78dJAGc1N8E0kOSJ996Teh50eKLt2bdk4lusqqQYY7EaaIWJRKpv1E23uomGNqqlHRQGoKXq6uwCAtVTzOvPeEA8hPLiEtML0dv45ZWqsNFpcg1/+9Jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796886; c=relaxed/simple; bh=PppSQNZYsQHHBG81aCM04B44meaAEKdFuq5DL7hv1CY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ma/z/6QE+HPSE9gEI+MwXaqMEQ56ZwI7/yscfQXkSuV8cCIVmDIID0ukKwwvhTg7IR5chxKGt8UqMTYvwgrCmpbJP1zWEXoBBF5dICmKmuNtsXTuoBV1ood//gO3hcXQyYQgHYGzY0mzyNYiYW/+IBSMAHxV1W9vU7VHQSU/Szo= 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=OJzG4RPA; arc=none smtp.client-ip=209.85.216.53 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="OJzG4RPA" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2c8dc2bcb78so1767679a91.1 for ; Sun, 30 Jun 2024 18:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796884; x=1720401684; 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=uqRQz2F3DBtU5/2MleOTBJUdczyOZMma4TaNBmROD4A=; b=OJzG4RPAErCTf2ytrmWVFIW2NBqmToHfnGRTAk9bS0OP2dlvLvI2D4CFQ+X2SUCK8T WFbHzhvNk+9/StCM6yy4BRnJANPYP8GBS6WbZAaf3rkuNMlaRLWvCxGg06sTUt6Xa386 +pSgC9mVHgjZe2MSkOubaOZpyoZH7NYeL0K3B4ylFSTVMExXKboYmPAiBHxs9lNfXBNG /yfCUK38t8vBLvvzyYnY1DIS796IS5ISjgMiQlX1gbseVxkmVbt2EojOV8YUCSdv3wAa si5ZAW2u9gUBrYLqDtROkapPJyuBGut4Ne3FSa/5iYKDOoW0KEWMt6jDPMRtc7+Ph7Zm 2ofA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796884; x=1720401684; 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=uqRQz2F3DBtU5/2MleOTBJUdczyOZMma4TaNBmROD4A=; b=CjLadyXwziPdEcVSPIBGjid7t/4AgPXHToJc508D9XMjG1nFEXiWHtRR9TQZZHvkTA GfvPBVfW/GzyvcGIdMGZn2UY7nbsqg300xJUjWy8sIQtfpHO5lldOCoxQU1BqWTU7Lqe lCj4y/5bLj8qEKTRZG/nnMoNQSkUPxKNoMh2Ay8uUv1suRn5akui0hMg4GxgOJQ3cHRX VCFqZhUyewcZewUt9NiH8ehce9ACTE3UGhT0B/yjQ41YOKLHBQxrEYRirDAK/giiixHS Zokkdg2NuBFw2suMEpEHEoqDNmyr7Zh3x8dIFo4fINov1S6XCmv90oBp+igCxBEsS6QH 80pQ== X-Forwarded-Encrypted: i=1; AJvYcCUtxHa2fSLiAr95P4bVIlUEtV0gCCy9ubZE2wnLYBMUyP8aNoZd3H19L/0k39z3DHWzFsoFahDmhnT2stBIpfRDwhOXHsYX X-Gm-Message-State: AOJu0YxQlXDB1DtIE1yEmbRdE46+oiQhvOncpbOc1OTsqti1HYJa8wzn GoOVFR/OiR7W/e8u65X0xTgp9t77vm74jlPRE3GbyB+t7oMAbPPpjIJYfc/HNQ== X-Google-Smtp-Source: AGHT+IEf5Dfqpg1b34Yf5VMcdxe5M2k1cZxJQh79suSZvOqp+g2kB9aro/HjG+IqypoLrMet0yiE2A== X-Received: by 2002:a17:90b:1bc5:b0:2bf:9566:7c58 with SMTP id 98e67ed59e1d1-2c93d78e1c6mr3336932a91.41.1719796884040; Sun, 30 Jun 2024 18:21:24 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21: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 , Tom Herbert Subject: [PATCH net-next 1/7] ipv6: Add ipv6_skip_exthdr_no_rthdr Date: Sun, 30 Jun 2024 18:20:55 -0700 Message-Id: <20240701012101.182784-2-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert ipv6_skip_exthdr_no_rthdr will be called by drivers that support protocol specific transmit checksum offload with extension headers. Protocol specific checksum offload doesn't work with routing headers since the destination address in the IPv6 header is not the one used in the pseduo checksum for TCP or UDP. This is not a problem with protocol agnostic checksum offload. If a routing header is present then ipv6_skip_exthdr_no_rthdr returns a value less than zero, this is an indication that the driver should call skb_checksum_help instead of offloading the checksum which would be doomed to cause a packet drop at the receiver due to a bad checksum. Signed-off-by: Tom Herbert --- include/net/ipv6.h | 17 +++++++++++++++-- net/ipv6/exthdrs_core.c | 22 ++++++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 88a8e554f7a1..6581fabd1e1e 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -1157,8 +1157,21 @@ void ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, void ipv6_push_frag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, u8 *proto); -int ipv6_skip_exthdr(const struct sk_buff *, int start, u8 *nexthdrp, - __be16 *frag_offp); +int __ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, + __be16 *frag_offp, bool no_rthdr); + +static inline int ipv6_skip_exthdr(const struct sk_buff *skb, int start, + u8 *nexthdrp, __be16 *frag_offp) +{ + return __ipv6_skip_exthdr(skb, start, nexthdrp, frag_offp, false); +} + +static inline int ipv6_skip_exthdr_no_rthdr(const struct sk_buff *skb, + int start, u8 *nexthdrp, + __be16 *frag_offp) +{ + return __ipv6_skip_exthdr(skb, start, nexthdrp, frag_offp, true); +} bool ipv6_ext_hdr(u8 nexthdr); diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c index 49e31e4ae7b7..e08f9fb7c0ec 100644 --- a/net/ipv6/exthdrs_core.c +++ b/net/ipv6/exthdrs_core.c @@ -69,8 +69,8 @@ EXPORT_SYMBOL(ipv6_ext_hdr); * --ANK (980726) */ -int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, - __be16 *frag_offp) +int __ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, + __be16 *frag_offp, bool no_rthdr) { u8 nexthdr = *nexthdrp; @@ -85,7 +85,8 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); if (!hp) return -1; - if (nexthdr == NEXTHDR_FRAGMENT) { + switch (nexthdr) { + case NEXTHDR_FRAGMENT: { __be16 _frag_off, *fp; fp = skb_header_pointer(skb, start+offsetof(struct frag_hdr, @@ -99,10 +100,19 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, if (ntohs(*frag_offp) & ~0x7) break; hdrlen = 8; - } else if (nexthdr == NEXTHDR_AUTH) + break; + } + case NEXTHDR_AUTH: hdrlen = ipv6_authlen(hp); - else + break; + case NEXTHDR_ROUTING: + if (no_rthdr) + return -1; + fallthrough; + default: hdrlen = ipv6_optlen(hp); + break; + } nexthdr = hp->nexthdr; start += hdrlen; @@ -111,7 +121,7 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, *nexthdrp = nexthdr; return start; } -EXPORT_SYMBOL(ipv6_skip_exthdr); +EXPORT_SYMBOL(__ipv6_skip_exthdr); int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type) { From patchwork Mon Jul 1 01:20:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717462 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 468FA6FD5 for ; Mon, 1 Jul 2024 01:21:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796888; cv=none; b=shU6Jo4zcLLVGjQC9mCtZDa23m01Ur9nRrrYo2wuKW/+1cM4bxOFUqpBme+dgSioiaiU0rEKthLvVP0jWO3LfT2UmR7bVrsm1rtTZfgbjGEN5QzafD0R1wPhBrNHosHgY4tg/KAI7+Pddvzc+6gLdKMn2gHJAHum1QRtov969nI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796888; c=relaxed/simple; bh=fjk8KoUFQlWZ+h9za2M6CVDNFS+RTyvKRNPKldL2iTE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YggipQGtVvcagXzDsplkk5M84HC6OaJaXXaQwBBEuNjdv4xef7xgtwqYp+AXFZTvESiF++N5gaah3J81EM3qG7N6v20S477rSfL0D3j8ekNCjofBmbgQK1rYDzZzFbKQeJxZmxHehCCuwy/88KoTkETNgkg/HXgz76dhdooY4tE= 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=YgM9pYkc; arc=none smtp.client-ip=209.85.210.175 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="YgM9pYkc" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7065e2fe7d9so1880412b3a.3 for ; Sun, 30 Jun 2024 18:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796885; x=1720401685; 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=BQQhk0i2sHpe+OIVwA9toTVFV+7i26oQdEGah4XqpXA=; b=YgM9pYkczqBFFOcV6c+WRx4CYPkXwUaJC574+NlNsZzVUs80Nx/pfAqZJ4xTEez0r8 AlyuXr6Fu7S8KDJ+331nb3SEB9WeCXbNUQfPOiNxR+NO5NKXL8YKYng6vAEEzUPCPCSf DKeJMzpk1LaRyWTycJyVCrKqWz2cUECl5ppZX9UgyW/Akqmtphu/+UiySRAyIK454A8G ftyh9ZUKxodBUEPEKoHAH5vhzBJQqpA0Cs9/DhpZt+pglhcRgYbr4P5FTB5isc9LF9F0 lJ0KzOH1enetC2XZMTiKZjhveWTxJrbAIshTG8rUUKG8RK1poM+f0qhTtOeJnKPwA7r0 JOxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796885; x=1720401685; 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=BQQhk0i2sHpe+OIVwA9toTVFV+7i26oQdEGah4XqpXA=; b=VZIKXuU+ANpZsCN+dQnK0A1WuPHntFMRo1z/Kd8dtO2RdLPqLRiIyh4q3tnl1uwDKx oV8+jZHDkIRwRPm8G3FIqzaSdhQGwcEh31aOSwfWAoy2vzAYq+Aj4D/WXjRVbRFA1zad ak5Ucyjm5DiU31qQtdDfhmxJGTDrs2lcsxe1T9tXE18nf0ZdhfVWciNBQbrwxsRoYzxT X0ErMUxhwWH6ost1IjOGAhtrxcjfVIGcd5z7mjVfEubkIsfdXCPAF+ylSTbzpMp+69YU Pg1lEBG8IWIYji03dKRSbcHYFQGxGzChKrX0kQvMHBkVcLRbbjAvzjyYWLCc/YTiWgTC hUgg== X-Forwarded-Encrypted: i=1; AJvYcCX7DTGN05CmTrVdP48r5+D0Oocf96yIJfGwhyXMrKJ3yO94J+uuk8IqWhjzX+l5kQMG94tGF60jigPkI3XRnQTeOt9b+a5/ X-Gm-Message-State: AOJu0Yx3V0x23b7q7Ajrqub0yXeKaKUgRRhwn8iE5UE3Oe0myXQHXP2t ExU5qeXxnncZtV0iODVMEiKohnc5BBdRFxB8AYPoMUjtARgJJktyKWqMTAgD3w== X-Google-Smtp-Source: AGHT+IHMfkQoAsyUBQ1Hulr7GbAzRjKB5uplnlujpGMylH5/k65pClvQQIxvkx0KZdyYpLGk7Ba0rw== X-Received: by 2002:a05:6a20:d48c:b0:1be:d703:bc47 with SMTP id adf61e73a8af0-1bef620fba2mr6983165637.49.1719796885594; Sun, 30 Jun 2024 18:21:25 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21:25 -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 , Tom Herbert Subject: [PATCH net-next 2/7] i40e: Don't do TX csum offload with routing header present Date: Sun, 30 Jun 2024 18:20:56 -0700 Message-Id: <20240701012101.182784-3-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert 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 --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 22 +++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index c006f716a3bd..b89761e3be7f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -3296,16 +3296,13 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, l4_proto = ip.v4->protocol; } else if (*tx_flags & I40E_TX_FLAGS_IPV6) { - int ret; - tunnel |= I40E_TX_CTX_EXT_IP_IPV6; exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; - ret = ipv6_skip_exthdr(skb, exthdr - skb->data, - &l4_proto, &frag_off); - if (ret < 0) - return -1; + if (ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } /* define outer transport */ @@ -3324,6 +3321,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, l4.hdr = skb_inner_network_header(skb); break; default: +no_csum_offload: if (*tx_flags & I40E_TX_FLAGS_TSO) return -1; @@ -3377,9 +3375,10 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; - if (l4.hdr != exthdr) - ipv6_skip_exthdr(skb, exthdr - skb->data, - &l4_proto, &frag_off); + if (l4.hdr != exthdr && + ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } /* compute inner L3 header size */ @@ -3405,10 +3404,7 @@ 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 no_csum_offload; } *td_cmd |= cmd; From patchwork Mon Jul 1 01:20:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717463 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 BC98A79F9 for ; Mon, 1 Jul 2024 01:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796889; cv=none; b=SnVH4jw7XJjf/xCblNwn2/DPS0YDuK0lTncrpAKMM7j2s2FaTel8po0qociotPvveTpWVvrvRuE85R9cCoK2aMA4kHEzJe6+33iWHbzmJo4JMUd954f9jt3S1Ls6wSp/XuFdgRZF2H81ZDbb2mNfmYs446oQaw46hTjKncWKGjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796889; c=relaxed/simple; bh=7/4Lq6MtRNwh8HFYEIyExRTRZxYKzcnNgn00qYFVkRk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qm8jFj8nYSYjLnWO4TsJQHPBm/lnM3zfyjXnad9tAmEVUod6JOWVPFMc9M+xb32qddieWUn3qbLwiwXkeFZdQJW5qK3JWF0QvfCiiP97ZF98JZyxVgHnvJnX3+BEcOnPYFDnmqtbBMKkANhpYA6Ux8uJXdXjWoK2FT4UVxMBIrU= 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=R96VnkEr; arc=none smtp.client-ip=209.85.216.47 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="R96VnkEr" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2c7ecfc9e22so1353522a91.0 for ; Sun, 30 Jun 2024 18:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796887; x=1720401687; 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=4cEAYfC/pSHNYZfAgkJDsHZADd0LSeJUjHpSBEFaKBo=; b=R96VnkErGCed27YoXCgu9J0DVOrNNuMTq420FMKETMGut3EC4P56Dd/pwDIz3ZuEof A1y9NQkr0NXRR6qLT31eg0fKAOfazj9Yy859VUs9LRhx2EOWEbYT+ORmX4SGcqEvav09 LCWRhxeMjdCGC5JB9d4sgUynXY0pkPB/K9Uc778kCDoWPVllsffXxIVLYZzme03CJWOM 7QK9Pc1AvYsK0GjrJry5oZGgWRc+TwGyg91jpxg4DFIY4+x0QmvNlr/5LoDAUq0VFN25 OsGCazGfZUinZAFDAVyBxlv5gQBnt4qgxbgEQygkUquMGjMq7wkyP+wqqs7Mf1TOSvs2 mYHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796887; x=1720401687; 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=4cEAYfC/pSHNYZfAgkJDsHZADd0LSeJUjHpSBEFaKBo=; b=CFXOeF+WwyytlMn1JLWH7X8NTuAf/qgg6VZHp75I2rRNA8JdEYakmgRyNn795wnEAT 87tM/XxskabxUyjM5OmTgUiHoT34QHTwv1wOKFts9EB2wVR/4lyVkM7SJ16U1T7c2kvs tLbnlmA0e0Y1MfbaMi9cr8LWMedahHf0DQSiOVrEvJxky0OYP6yN7Q5iWbC7GgmBalUc X8qjTtftUvBqPXxYZmN2eOGFhfatIIyo8wnzgPZYzzRplxLZJTu4DXsb9q6TodRkmzpA RUaYJyW/jq8VMJYihbSMMnoVjjf47lC5u7guhVRVm/k1xIDU8v6nYKs2pynVREep8U7/ /cjg== X-Forwarded-Encrypted: i=1; AJvYcCUvFOxhr2GMi60pxF9kpo5+PhXewQR51/Yh27c2tzqthiG2essGz9F0cMR88UBYhnEKe9iycUcVyDx4uROu6utvGLleYYjZ X-Gm-Message-State: AOJu0YwUHsk9QClGBGrbYFNyEMLfvDYOn6Pq+LLHf65s5iLxKRufhEjO gPOBR1JNLtl9pJn054IPhgODWWuknEK6AvNXV6E98S0hzwmrTjADdxoPxWjA4iLxWF9iSgMg/6K Ycw== X-Google-Smtp-Source: AGHT+IGnDOzoiGPre9Plji8WTvfyNU5J5D2Vyuydhgo84cX0pup4HdtGNG1H8BSFvdlqPNTK7UPpfw== X-Received: by 2002:a17:90a:ee56:b0:2c7:da20:5252 with SMTP id 98e67ed59e1d1-2c93d6eed7amr1911889a91.6.1719796887063; Sun, 30 Jun 2024 18:21:27 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21: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 , Tom Herbert Subject: [PATCH net-next 3/7] iavf: Don't do TX csum offload with routing header present Date: Sun, 30 Jun 2024 18:20:57 -0700 Message-Id: <20240701012101.182784-4-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert 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 --- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c index 26b424fd6718..44cad541bed4 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c @@ -1651,9 +1651,10 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; - if (l4.hdr != exthdr) - ipv6_skip_exthdr(skb, exthdr - skb->data, - &l4_proto, &frag_off); + if (l4.hdr != exthdr && + ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } /* define outer transport */ @@ -1672,6 +1673,7 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, l4.hdr = skb_inner_network_header(skb); break; default: +no_csum_offload: if (*tx_flags & IAVF_TX_FLAGS_TSO) return -1; @@ -1725,9 +1727,10 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; - if (l4.hdr != exthdr) - ipv6_skip_exthdr(skb, exthdr - skb->data, - &l4_proto, &frag_off); + if (l4.hdr != exthdr && + ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } /* compute inner L3 header size */ @@ -1753,10 +1756,7 @@ static int iavf_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT; break; default: - if (*tx_flags & IAVF_TX_FLAGS_TSO) - return -1; - skb_checksum_help(skb); - return 0; + goto no_csum_offload; } *td_cmd |= cmd; From patchwork Mon Jul 1 01:20:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717464 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 245388494 for ; Mon, 1 Jul 2024 01:21:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796890; cv=none; b=AAJccLcLcGT/qAYKmrd0TZRXHGu9/CXB1KDBJdHVUfTrn07Q89CbK7Li09QWd7/8OIcVhm9y821AuLUlshIiaDQeR5UXwDMyHlevNPI+02gvaw/UoOnwoqD1Fa1ZSil22hkZBjN5EnnkIY32o+IEBulQcDBJlTi/XGuvmMkrQXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796890; c=relaxed/simple; bh=RMo+Aoe/0AR30CK9/W77DohGKdDGc0/aPJUSUoAaV/U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sldsK3jXwCUFfIlYWHum07Xge0GlSmw7eGaSDxC7Rx0sW0TOK0HRoD+pUFDO6vzmwd3EtyT7X1UG+zvsV2PJ4QhItJ0ZI2K5pcgaxq+FD1trqv3EgPa/LIk03Au5LBdNDHSSfA3q6SK753LJcfNAsh5GhdLwC7blnOqxcDUShfg= 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=VJmKpDbg; arc=none smtp.client-ip=209.85.215.180 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="VJmKpDbg" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-656d8b346d2so1232953a12.2 for ; Sun, 30 Jun 2024 18:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796888; x=1720401688; 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=KIDEpdck9YV2zPdfWntiOz8NVusw1OMyqGgNFj+H7EQ=; b=VJmKpDbgkhMNl/ICJQygD+VbtSu2/7fk2iNyn5H64t0fvQgmKlpXfTlfHGO9GxclYY oeI9mGMHam0TTR2up815XbVfy0U9zmaiDCKqu4BcWq3MlzWi637//4RVQlSV393y3gJV PXVjE3SyjS7kzr7FMmt5Ps4wu6/Z59+Okh0w4d7H74TcCOR8Nm2QopRtgi4vbHJYx8zT 0Vw2Nj+FVO1SaGK1lZkkoJkN0z4Ns7ZxytTE/gHgQTQpwnA/zUe2QWA3g5i8g0Z/Auf1 CO0/wPQ2jGcFqLOtbMlrx2HyhieSonCPIgXUEPzrnh+VOW8TsY40LLOGr2/EcUI/tIm5 jDUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796888; x=1720401688; 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=KIDEpdck9YV2zPdfWntiOz8NVusw1OMyqGgNFj+H7EQ=; b=DAoSLjCEJR0Jop9FrW+y8ZOr9nijRAW8H5JJFHZzYqc1wVmRYWMICdLbt+WMw9DMgR 1/PItSfURWSPT4UKeTzfmSoPizvqL2wJ60fikfXK+QEY+UU8fTKxO4L2f9jrC+pUUkPJ LUmE39d7s2MP61UP55aWg5uRPzIs7WsNCxBW25F0QfqnXzklLX187p4n71mQ1B6lHeag X0XMh7HzEqet/DDbT4riFKDFCyFwbLvo2YRhGlcbw8i3vpEfPkdCe75DPTXRJqXAoqUH 5UbVA/osNSt0LIPV6FrFflDalxQSlyjYnAO7ElQCcP/2esfXzzUwYonAZX7CfcTbPZtH NhFg== X-Forwarded-Encrypted: i=1; AJvYcCXaBYK5Wbh4ZCVZpupptpbOUjBxDvVQGnFV3vqgg8FtMmExsEMCNI28S2YqtX0N+HqkM4BAtzjg26edxAIpsisUtqqEy3XB X-Gm-Message-State: AOJu0YysC6JmQmZmgC73Jxc/bP2Y+XYqcqUodKeGONyUcCuZ8tNiXZu3 kWA3u5Vq/0zcQ2E6ThUhPmONpm4qqDei0LyXLhtXu1kdjHY0PBafvTGWUkOysA== X-Google-Smtp-Source: AGHT+IGiOkImm91NnX2VzM+Sqbujp57DznsSvbtQZ6AoTnKAFy3efDpy0SAelsICUMznMNS3sF0WgA== X-Received: by 2002:a05:6a20:7344:b0:1be:e3d8:1a85 with SMTP id adf61e73a8af0-1bef610d0c2mr3960764637.36.1719796888541; Sun, 30 Jun 2024 18:21:28 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21: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 , Tom Herbert Subject: [PATCH net-next 4/7] ice: Don't do TX csum offload with routing header present Date: Sun, 30 Jun 2024 18:20:58 -0700 Message-Id: <20240701012101.182784-5-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert 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 --- drivers/net/ethernet/intel/ice/ice_txrx.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index 8bb743f78fcb..fd57ac52191e 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -1842,15 +1842,12 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off) ICE_TX_CTX_EIPT_IPV4_NO_CSUM; l4_proto = ip.v4->protocol; } else if (first->tx_flags & ICE_TX_FLAGS_IPV6) { - int ret; - tunnel |= ICE_TX_CTX_EIPT_IPV6; exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; - ret = ipv6_skip_exthdr(skb, exthdr - skb->data, - &l4_proto, &frag_off); - if (ret < 0) - return -1; + if (ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } /* define outer transport */ @@ -1869,6 +1866,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: +no_csum_offload: if (first->tx_flags & ICE_TX_FLAGS_TSO) return -1; @@ -1928,9 +1926,10 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off) cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; - if (l4.hdr != exthdr) - ipv6_skip_exthdr(skb, exthdr - skb->data, &l4_proto, - &frag_off); + if (l4.hdr != exthdr && + ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } else { return -1; } @@ -1961,10 +1960,7 @@ 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 no_csum_offload; } off->td_cmd |= cmd; From patchwork Mon Jul 1 01:20:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717465 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 D6AF8B663 for ; Mon, 1 Jul 2024 01:21:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796892; cv=none; b=H74Zz7JEJGxnw+jX7D1h2PWoJKHNYqFF7VyQFp+ERgDyE+RoiHFWmKsfTuaYLJiauVTuEaHnbzqevGbux6e3rjK128maKEb3T1iz3pjqye96hWXdFqGp6iT5fzJthv++8XJzsUn0IgMytFk8BgYDDegF2LFT4yEIB8vuv8/TJiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796892; c=relaxed/simple; bh=wif0J0u+OszYckvNl0pn9Yf2TVfSrCe634fBjLmlvA0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B8eM9NGKMZ6fV04TPHXYtmMQZAV5QgechQ0FeO71eVTuUwReLtTNSBnNkA341ccje7kQtMuc8kvQzKZMW73L3DETiCx5u+zEMWPjDrMXf+I4MptMGJ/1zpsBCHkyZ8CMdq1x+kbM3KgGG9FxXobO56xg06mek6YPNQMqwdzxnkg= 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=e6b0Ff8W; arc=none smtp.client-ip=209.85.215.180 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="e6b0Ff8W" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-7201cb6cae1so1054951a12.2 for ; Sun, 30 Jun 2024 18:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796890; x=1720401690; 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=4vAVAXTRO3CNYNew1s5viXhPasACaseI44kQDWAlbhc=; b=e6b0Ff8Wlm5UUwBOVBNf4uolIW6GHAhPVvQ8xENJZcVsbtuRFMRx3HRWbcKlxnUrCD rKG6O6o4TJ9QU5sP7/7EwzZNr7N9KQ98zDc+0Nc+isvGifJpKP6JSbjfJrjHlohpYyZn 4nCMF428YXsHnhc8mOycT+dEgXaJ8DSC0+cdSMh34gOYv9ncYU/M7oj+fQT1HIw+V1Uw kR8O+L3mH72pmj+L6Cs1pJNjCKXaBj1zB3RyQv/X0QvxkWge5lJrXKth0HMFf/orPEXR pKKixr8Y2xvbK5nr3fZqPaUrB+Lo2wQiHR2Mz1XJsU2h6WNSVfr3l7h+1ZXnlCnw5w4E N+sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796890; x=1720401690; 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=4vAVAXTRO3CNYNew1s5viXhPasACaseI44kQDWAlbhc=; b=luXF29H+JrK5faO7T/QNl5en/ORdbTyzv0XJMvwhtJ01xa0At7GVrLps9OFPxbo8CW G4Dwj7n6ip77mnzi9uQOg50bU1yNNyOuNoK8Oa8Usl5uWDjFF/b/fXJDYYZBkcID7pXS m48lsn0AkTPkI1fMV61abQLwQoHK/JSVn96irAREcg9b6rDfD5A2j4YmiXKNSwpb9A4m 8QvbBc9wrRnd/angEi1XS/0f/onbNughntFhI2gGO6RpW1T6o2xrfwtYIG08EOU6XBsK Pt8RR/8Ak+hL2mfV2Rqi7q5xx5hPxIu0+6qqMYLRLUj4WBe9ettxDstXYfw2B/KCsfl4 d5Jw== X-Forwarded-Encrypted: i=1; AJvYcCXaaqOtQPCfjNDv9/N8Bxoh9yhfuB12f8UHsYYC1WZuoQkTOPE88YcW2CHofxfwpuTNRE+IzjcxOQWVzN1nfBb1tyzPLq8d X-Gm-Message-State: AOJu0YyAXrwX+hM2F/NZ1+6wEbmpRIgnL1Jp1Xjl9b7yG+GzJjx3zXPj yG00dxXXy83jRhyoRvvGqLdqJFRgtRhCSlFfv/lzpZN7+irlrQRtQ503N3mrEA== X-Google-Smtp-Source: AGHT+IFUn87s2SThoTPnzXdiVkAN2+XxvMLqQUjGR80ZFzc70hh+Z3wNtZm6GufYj46vqfuZ43NyJw== X-Received: by 2002:a05:6a20:258a:b0:1be:c3c1:7be8 with SMTP id adf61e73a8af0-1bef61407bbmr3534011637.26.1719796890341; Sun, 30 Jun 2024 18:21:30 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21:29 -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 , Tom Herbert Subject: [PATCH net-next 5/7] idpf: Don't do TX csum offload with routing header present Date: Sun, 30 Jun 2024 18:20:59 -0700 Message-Id: <20240701012101.182784-6-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert 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 --- .../ethernet/intel/idpf/idpf_singleq_txrx.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 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..3b0bc4d7d691 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c @@ -57,10 +57,12 @@ static int idpf_tx_singleq_csum(struct sk_buff *skb, tunnel |= IDPF_TX_CTX_EXT_IP_IPV6; l4_proto = ip.v6->nexthdr; - if (ipv6_ext_hdr(l4_proto)) - ipv6_skip_exthdr(skb, skb_network_offset(skb) + - sizeof(*ip.v6), - &l4_proto, &frag_off); + if (ipv6_ext_hdr(l4_proto) && + ipv6_skip_exthdr_no_rthdr(skb, + skb_network_offset(skb) + + sizeof(*ip.v6), &l4_proto, + &frag_off) < 0) + goto no_csum_offload; } /* define outer transport */ @@ -76,6 +78,7 @@ static int idpf_tx_singleq_csum(struct sk_buff *skb, l4.hdr = skb_inner_network_header(skb); break; default: +no_csum_offload: if (is_tso) return -1; @@ -131,10 +134,12 @@ static int idpf_tx_singleq_csum(struct sk_buff *skb, } else if (off->tx_flags & IDPF_TX_FLAGS_IPV6) { cmd |= IDPF_TX_DESC_CMD_IIPT_IPV6; l4_proto = ip.v6->nexthdr; - if (ipv6_ext_hdr(l4_proto)) - ipv6_skip_exthdr(skb, skb_network_offset(skb) + - sizeof(*ip.v6), &l4_proto, - &frag_off); + if (ipv6_ext_hdr(l4_proto) && + ipv6_skip_exthdr_no_rthdr(skb, + skb_network_offset(skb) + + sizeof(*ip.v6), &l4_proto, + &frag_off) < 0) + goto no_csum_offload; } else { return -1; } @@ -161,12 +166,7 @@ static int idpf_tx_singleq_csum(struct sk_buff *skb, l4_len = sizeof(struct sctphdr) >> 2; break; default: - if (is_tso) - return -1; - - skb_checksum_help(skb); - - return 0; + goto no_csum_offload; } offset |= l4_len << IDPF_TX_DESC_LEN_L4_LEN_S; From patchwork Mon Jul 1 01:21:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717466 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.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 6334BDF42 for ; Mon, 1 Jul 2024 01:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796893; cv=none; b=kHAl5rF5Vlrfp0qhMquPQyBe+1WDvnOaE3qs5g1Be3e0rPH1u3kOCAOTtIXM8DaN2NcI5B/i1I1TTUMKhK+hgnvQO4kDwxnd+gI/kZFUpvmb22JdhXf9VbwhHtAJ3WyYLoyb6jEB5SZMqu3UbyEbVau8OY6ncOc4Sp3FpeRw3ME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796893; c=relaxed/simple; bh=jIuNIafRnFEfCJzX6gQqkI1HAzoXM47rQAVEKRQvo2I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e2lq6uePeH8EWeP1QcCh48tvp8dkx5pApQ0h692p7p7B6wdanU+hYvySw77wLsuXC9a5cEyUwIfe2eVzlI30Yn3K8QWfel/DZJcq9W9zHa+TrhHbKKK8IJA8TfPCYb/JCOTf9iAhSM7JAQ0uS1alBHGOJSNjjRpE4OQMYv7AFsI= 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=FkS0WyYX; arc=none smtp.client-ip=209.85.210.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="FkS0WyYX" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70670188420so1479597b3a.2 for ; Sun, 30 Jun 2024 18:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796892; x=1720401692; 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=UuGoCf6HMv4WXYT1IGvtzkbvAJQLRlgnX2FDOCBWTe0=; b=FkS0WyYXjRDg5c0IIYJgOXviVM4EVa2wsjDSf78aLmHfPUj3x5XxUx7j3LsjjG4nvF VdJ+D/LAH7zskH3T6Q1wIKAFeMYEBGNHAuec358AkzD3pFkbt54G2J3kj62XwL/FMQa5 kB6hLnxs8WWD7PuCTIIYQbdrtEHcK6ja7TjT0m43yreBAn6wmYoznNZfuTLTQeuEFN1e zktIXzGpkum4Fw/cDJ7WO6o1fcBgexho1WZUMk3g+DmQ8tWU4LIMRuyfJ0KIeFdDDNDJ gxolkbZ7By9MarsnfyXR1ZJKe8FVmJbi1OzLkRQRvYReXtJHvmwVRHUolclLL7pSf7oe Gb1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796892; x=1720401692; 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=UuGoCf6HMv4WXYT1IGvtzkbvAJQLRlgnX2FDOCBWTe0=; b=Vy+k52JnJSYRONgsjvDkGboXsS23ACSCG+fTqPGoQ5a6HYZnlcGZCvmMYm5XS7INmi PMzAwSQeI14GF08VPlt7oSlr5plNJyAXvJIdTj3jvPcvcHsyV82IgZU+nNPGEJzuqETz 8xWbFP1XV4wf5E5nbJa2Rl9sIlIV9KlCJxLKi/ZVkeMtADTejf5mAh0tml6Ihsog9Vkn i0SB4iy1KR6+XVrBv0BtkpRSHQJ/n76O0h9mbP01soNS7q0eLkTRGE8lhQBTggAi+s3a X6sln9MUWAHY/kDvqi0Wogha8ls9WycVk6Qqj7h8SwjCQfRznToZUbtD2+NgL8LW9UrP Xybw== X-Forwarded-Encrypted: i=1; AJvYcCVt64srp/h3mrpHPmg0ZzE0LLIpTjCtU8KDOwEYFGpi1b2liRnMCKXopeWAA/P8guV6JY9E1V88NpY4Iake3Za9h9DIIvVP X-Gm-Message-State: AOJu0YwYomM1zKMe1aWhveXiSGmDdMRytanSSZGMGCAXwFwYeiT7gtt2 9+hQXwfsc6V0Nm6YZKmrTPjFAReQgfc90sye0Glanju9b48tyNdO+/ZT8NTtJYs2Fij85MY8giu 0Sw== X-Google-Smtp-Source: AGHT+IHGYS3ML6BRn75QTYbqg8mym+TkIZbXIJRC7AgT5OhrUFoRvS2iTmiY9rPiyMHcNaoe0YuhpA== X-Received: by 2002:a05:6a21:3287:b0:1be:cea:d381 with SMTP id adf61e73a8af0-1bef613effcmr3305957637.18.1719796891838; Sun, 30 Jun 2024 18:21:31 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21: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 , Tom Herbert Subject: [PATCH net-next 6/7] hinic: Don't do TX csum offload with routing header present Date: Sun, 30 Jun 2024 18:21:00 -0700 Message-Id: <20240701012101.182784-7-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert 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 --- drivers/net/ethernet/huawei/hinic/hinic_tx.c | 23 +++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c index 9b60966736db..ba6b7481b6fa 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c @@ -357,8 +357,10 @@ static int offload_csum(struct hinic_sq_task *task, u32 *queue_info, u32 offset, l4_len, network_hdr_len; enum hinic_l3_offload_type l3_type; u32 tunnel_type = NOT_TUNNEL; + unsigned char *exthdr; union hinic_l3 ip; union hinic_l4 l4; + __be16 frag_off; u8 l4_proto; if (skb->ip_summed != CHECKSUM_PARTIAL) @@ -374,17 +376,15 @@ static int offload_csum(struct hinic_sq_task *task, u32 *queue_info, l3_type = IPV4_PKT_NO_CHKSUM_OFFLOAD; l4_proto = ip.v4->protocol; } else if (ip.v4->version == 6) { - unsigned char *exthdr; - __be16 frag_off; - l3_type = IPV6_PKT; tunnel_type = TUNNEL_UDP_CSUM; exthdr = ip.hdr + sizeof(*ip.v6); l4_proto = ip.v6->nexthdr; l4.hdr = skb_transport_header(skb); - if (l4.hdr != exthdr) - ipv6_skip_exthdr(skb, exthdr - skb->data, - &l4_proto, &frag_off); + if (l4.hdr != exthdr && + ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; } else { l3_type = L3TYPE_UNKNOWN; l4_proto = IPPROTO_RAW; @@ -411,6 +411,7 @@ static int offload_csum(struct hinic_sq_task *task, u32 *queue_info, network_hdr_len = skb_network_header_len(skb); break; default: +no_csum_offload: /* Unsupported tunnel packet, disable csum offload */ skb_checksum_help(skb); return 0; @@ -421,6 +422,16 @@ static int offload_csum(struct hinic_sq_task *task, u32 *queue_info, ip.hdr = skb_network_header(skb); l4.hdr = skb_transport_header(skb); network_hdr_len = skb_network_header_len(skb); + + if (ip.v4->version == 6) { + exthdr = ip.hdr + sizeof(*ip.v6); + l4_proto = ip.v6->nexthdr; + l4.hdr = skb_transport_header(skb); + if (l4.hdr != exthdr && + ipv6_skip_exthdr_no_rthdr(skb, exthdr - skb->data, + &l4_proto, &frag_off) < 0) + goto no_csum_offload; + } } get_inner_l3_l4_type(skb, &ip, &l4, TX_OFFLOAD_CSUM, &l3_type, From patchwork Mon Jul 1 01:21:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13717467 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (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 4A08E171AF for ; Mon, 1 Jul 2024 01:21:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796895; cv=none; b=ceud++jSy2u0JpYCLN//Ig39JEoHJ5/GxJyB+Yr9fJDGgAuUKwowrVgNMSm1sVahk/fjTFR4gNU87wJ3tncZdS82Z4/a3RLtM/KnDCmfgpXSBz59v7hKpE6xBNCzlf/aBNnPvN2R+VGe1zQNtMYzHLvp/9E42FzZ4IZ6yBlC7Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719796895; c=relaxed/simple; bh=7lntupVKf9E5CTX9AHlZIfAIM30yPoqZyJUXX6Q1i+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rn8FM5lSN1LzQSlvG3y0qHwiuZk+sk6arH55hwyq8zzHx1BqEF6TeMZ74yE3+LPqLtR7fQ0OWkjM/1dWbbgJzc0sWxyoBZX26HVFv0MsstV7khK80zNhSpxPt4si4edrQWpzZYGk2d0unHWrpWWwMJGBs2Nh0SH3lP+AuTasdw0= 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=L/rTapdT; arc=none smtp.client-ip=209.85.161.49 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="L/rTapdT" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5c1d2f7ab69so1178504eaf.3 for ; Sun, 30 Jun 2024 18:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719796893; x=1720401693; 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=HgH/Dp12PQwRCvuuv6JrWA4Cp78PNWk7TmUD/JNFAMs=; b=L/rTapdTTNs842z914C6M7Tz45ZMfgO22jy+OzR/wqvtT+splWCuz9daObGgtPMYjZ FvGRYMR2ubcp+kZMzIwMLMIoXTrOXe1FNpkU7vxpC+tj0RhNod6fBnbgGAcLsH1oMyv2 ISlC7NcYjb3ubvKr12bmPrz5PMY7nCjO7OlXwWXrvpUy3pZ/DjPIpe5f/Co3d67DOcGE wh8WqtIEk+mAKraccokK5vYH5Xa0CANf10SRSBrq2x0jtXbWIPpuqQa21KxUcLo6lkR0 hAwj5SK8+uG7t5p9kYrB/+aAj1A397ABGDbYKF00e3dyNoK6i5Yr0szR8Hen4QetBZPs BggQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719796893; x=1720401693; 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=HgH/Dp12PQwRCvuuv6JrWA4Cp78PNWk7TmUD/JNFAMs=; b=kWSavOnt90kE2neonpteh60Hs2tYsFn8HvBH7yChTPHPXpQmsebH7BlZcBXLFbWKGg 48LJdFRSGHbGZYx6GlQikGUWMnD61s31PmGuT0nnNHSPOyYo2ys/QjB0hg24XNX5CtXF C+RK17Me8rQZf9kqnFx2YsQNnlne0dOjcgKyv8oxXlDpnnaUzwyH8/aTfqSma4eS9CFj OhInnsE5Wx/u8GEmeQirPlIj9DPgnY71dXN4d1RjBaI5JPS3m4zS87eGFp2vmOwRhv5/ ltLHYXJPISP2BxHWAxG/iH3G+9jwvSrpzilv3iOeXQH7WnnuSNIAXaqfrhXuCDr6ty0q 0V5Q== X-Forwarded-Encrypted: i=1; AJvYcCUDhPrQ/H2x0fmK5u7vykR86c0eeuewxhQ+Qb+kG80myeHIzJAv7UYLM9G3ppRMgfotzsI7ml53bH5AgHflUQa0EghcqLxC X-Gm-Message-State: AOJu0YzltMcS2FNTH9OIvRa1O1Isb2bmzjfnZrirUp9PJcq/tw/X1hYb mvsmm0tgmO6wq0G2ToNRxL4bpZuOK/YczxESUnaPisKbJwLKPhsxaNSYLalE5g== X-Google-Smtp-Source: AGHT+IFzBF1ZL7zf+pOcYvGW69tV6V/Ch7C1+ZokI6vHL2H4wySQpwbiOhS0pLt0CY7t+rGnYThpXw== X-Received: by 2002:a05:6358:2c93:b0:1a3:69b:9bba with SMTP id e5c5f4694b2df-1a6acec70e1mr414138655d.20.1719796893249; Sun, 30 Jun 2024 18:21:33 -0700 (PDT) Received: from TomsPC.. ([2601:646:8300:25d3:25ec:3900:78b7:fad0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91ce5490esm5529284a91.24.2024.06.30.18.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 18:21:32 -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 , Tom Herbert Subject: [PATCH net-next 7/7] fm10k: Don't do TX csum offload with routing header present Date: Sun, 30 Jun 2024 18:21:01 -0700 Message-Id: <20240701012101.182784-8-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701012101.182784-1-tom@herbertland.com> References: <20240701012101.182784-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 From: Tom Herbert 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 --- drivers/net/ethernet/intel/fm10k/fm10k_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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",