From patchwork Mon Jul 1 19:55: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: 13718601 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 2208916F905 for ; Mon, 1 Jul 2024 19:55:33 +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=1719863735; cv=none; b=A6nk1uGr+7bAMUR1BxvPz2vLQ1y+bT7oVODQQWCZnlMkvJ+3nbh1PdEGVAiu9T5o4A4WRTVTfb5EhYg5gq96c33t7CdJJOoxIZToIcu9OIZSVjSBImQLB3S6Xz9oBHAckBYP8CfGbICn7zMa1zSgNp6bV7KPKCU033ahd7cRyfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863735; c=relaxed/simple; bh=+I2/H+WJhavlhOXr4uDGCdGSKZXUSOd+/m6LjuxMsM0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l1uehszx4umEw1p1U+5GJU6UdG6r61/mvFMBkaMiEgMJRA2Z89SoQ4H+fbLmif2DoSnXRlVIz/fbY9wcnp/i05vQd+NgaYb+wuHG8MozL0bSqZ9HJ25KC54y5B2RNhz6RfQO53S2rWTWqUc+tXtBGPVlr4Mg/e1XrkcZju4biVc= 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=RMm9xFaO; 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="RMm9xFaO" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1f4a5344ec7so24412715ad.1 for ; Mon, 01 Jul 2024 12:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863733; x=1720468533; 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=+7RY/2ZPfAZhnMIlpD+xpnoHxw6CGzgcRYJgOQLBHx8=; b=RMm9xFaOnFEK42JbfNdhBcc7TMqsetoliJz+TbByOUJk+m926vdaPWNMiHe/LV9Wuc 9OK22RDsq/Oo4b9yWQUv1D/gV4MnB/UIXGL6bsQC62xh8BnDn9v/WI2aE4raZVA6Tv9G MkSvxb2FdUZ5p5gUf1T4ZIItZjL6UbPEiIpObilKpEP+EAsSiux1FgB4P6AeLHfXo+wx fFYdXSaax1fYVmHTUQ5eOqe88PrC3ybPOwokCUMcqbWMPIiDUWDkDGa30iccrzmYjKSb SFuKJc+x7ouUqGEjq7oOXyKWtKngirCfoRlxpiA6kaNSfK7+UY7Px9vcQLfxi3/R1ooj OkvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863733; x=1720468533; 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=+7RY/2ZPfAZhnMIlpD+xpnoHxw6CGzgcRYJgOQLBHx8=; b=aHUCAZgChKfMzsKD3uOSR13Yo8yjeh/vG5gzVHUVYOJkZu+Oa6ziiwuFlbUUgj5AY0 3OnNi12ZI55J/h1PZ5tCMY/Y8gxmaTCHu43CejBGZSz+GebsOjR2P3IOg7btkAFz7JwC MOwXDuSS2IZD/s1x5GOc22htSDhGhlqMdGOb9C07SVYK4WHXcRjk4fFzwfoUP7gPerXp KdXXhRxFEp9PDFKxXZgN1T12Y8j68DhgFKm9eYoYIxjolHiwcnoOjwICI95yPzQONR5Y CcwQfPJ9DujT6QnH+vvV92++p0ubjJLfN9n2+IhrbBz1khbVkZWWiuY+EdXN1zZ9w1qG yraA== X-Forwarded-Encrypted: i=1; AJvYcCWyqyg7tDDCSTNJpLlU+htbJSe+OfIChQUNrM6vTUg/m2FhCQF7VT7OdyBdlAqnR54Q0DvUDqkOP+LuSat+4U2Bsr/5mDan X-Gm-Message-State: AOJu0YxUmSbQUGPLlieNItZbM3tNqcaju5xMv0swIwC2cd9VIlpi5pGe LIiIDDM1XQ6TLPMV0NNznC8wWqFJczfJ0bI9ZRMEt5u8IklL2RYISXvM7UTJ3htBIXNb0U8RUD8 = X-Google-Smtp-Source: AGHT+IF4lQOo5FUWLGEi/j0bXfdAzJF8lWVn5oLjpBpEM1ucwGAlXtPQZrfW1GRTDDYuPmy78JHeBA== X-Received: by 2002:a17:902:f688:b0:1f9:f6e6:5ada with SMTP id d9443c01a7336-1fac7eec818mr162565495ad.22.1719863733222; Mon, 01 Jul 2024 12:55:33 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55: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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 1/7] ipv6: Add ipv6_skip_exthdr_no_rthdr Date: Mon, 1 Jul 2024 12:55:01 -0700 Message-Id: <20240701195507.256374-2-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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 | 25 ++++++++++++++++++------- 2 files changed, 33 insertions(+), 9 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..25501777ae05 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, @@ -97,21 +98,31 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, *frag_offp = *fp; if (ntohs(*frag_offp) & ~0x7) - break; + goto out; 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; } +out: *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 19:55:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13718602 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 B4061170826 for ; Mon, 1 Jul 2024 19:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863737; cv=none; b=H+nWhedf5EclYLGQUqyVvcqjzN424OkH5uZB5JL2U2OZcyp678fz13cprD04pvD8ygPKiUbhAroCntDvuUXu2j2RLs0cSETGW2X/bR0BeZwwrBh05hlJIpAf57CeZWtk5SDIsdF9NLSoQEVmi5ao3S45dCiYkMKQByp/TPCE0Do= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863737; c=relaxed/simple; bh=GZ98B7Q28bj+vvHAshJE4H1aoAeK0Hw6/9KepOq/cvE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KfPMiWAkgG+CStUFZkqwg+uGxsvKZLTyKx+ruFfmYIIypBoi1bBoz4sKejnLEoACz4bPhLEKlBrUfx+KKNDKbLFqQtgdwX6y84v/YXJuLyzqTegPJwPEildnC27YjJnJ6iPDyfwKR1LUe9Jt7yP+53Eg83yt29eIVvcfQ9UYpRI= 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=c3OdeJVY; arc=none smtp.client-ip=209.85.215.169 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="c3OdeJVY" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-713fa1aea36so1258688a12.1 for ; Mon, 01 Jul 2024 12:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863735; x=1720468535; 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=X/M6v5lKpYaQVZGJ17bh1FRQoB9KGM6O7+m3kCZRwhk=; b=c3OdeJVYpz2WTKQgLqgYF9890Zrjy+zPk6Nsm15BwZVOJg5O5U86GwanqysfgKo8s+ LrzigfyzSx1EqIN8qFMDfegzEypGKiboCXk0iWF+7d48wlS2s+RiKGjtH4osQfR/w12w EkMt3xxxJ2Ip6BWgJrtM5nfX0Sb5hcEJ8OgGUePFIXSAFQzxT6FwxT0E88z6b/lUhZKh T9iELburS/RPWz3xcYWhjXO4IK3rqRQTYmbfv9XqcObCQEu5UsCpjWdsnf3zLDQbo+Hu WR/dt85ulzjWOE350R4Kd5FGOoJVn4jDmVfVKs82+S1lvkyd4f1BitZgWQdS7KukAz2+ xeug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863735; x=1720468535; 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=X/M6v5lKpYaQVZGJ17bh1FRQoB9KGM6O7+m3kCZRwhk=; b=aLqtAwPQwykPJcpr4u2wZoStEE5y5Bx46wYqD5RtvXuPKmeEhB9eqHPy51PwSgTkwP 4jrJSGKyfM8p4Yl5O9ikUX5nveW+87AgvnxDEgPPlGgFaj9neRtsjJKuFt13EvA1VfIi uYna309kb51p6aAKzLbzIT+KsJbVVJ9ThKq8aofMI3+B8gKc/ptvRM8wRnuDh4Pt4dlK rWCR55G/SM9bCHZ1NPBQED6jX03KAP6kos9qRhvY0Fv0Yhy8+u+yIOF0sNOS7oynUKHc WR7bj7pBGaEKnilk7OoA0285exp0yH0xFu2mSiCOpzCvHwCePZOvKJm86h43McL0aTQS yvPw== X-Forwarded-Encrypted: i=1; AJvYcCWNcIAJCkEkEMoQe/xvtrE+OkmGKzRB4WOrG0xOrVXowO/kzxmmoAS4THVAJvaKkqGdOGD9nudrYtchS2dO3fKgomedHXlN X-Gm-Message-State: AOJu0YzuMCh6Eu1pQMhenHKFMVryYw5nWq1JpffwjOzTV9mndHfGYp8x YW62Ahp40qgZYPjiltFECSp1YC74Aw0ZD2Hgy0WgEhv4+FMl4LmpsoBqwELQ9w== X-Google-Smtp-Source: AGHT+IF3YYs3j5ljp4XUT2xe6XlmhrEizM4rqTJKBPqozlr5ykr4P0K+b5D/ODHTY8J6YOiMeGTyaw== X-Received: by 2002:a05:6a20:7344:b0:1bf:d46:a6f6 with SMTP id adf61e73a8af0-1bf0d46be35mr4107296637.54.1719863734921; Mon, 01 Jul 2024 12:55:34 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55:34 -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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 2/7] i40e: Don't do TX csum offload with routing header present Date: Mon, 1 Jul 2024 12:55:02 -0700 Message-Id: <20240701195507.256374-3-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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 19:55:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13718603 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 3CFDE17085A for ; Mon, 1 Jul 2024 19:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863738; cv=none; b=ZszTEFzl2uAgSY0AodeJ5u2Oiqy7okn4eDTG3VJOcJm/GZy2pb5hL6Fwlj3RWq/auZ2zdJ1Ga79LjTnKmYd9HzFk7CtinvUe8+76I8uzzDXagMElKCahCLu944nEO51IHKlCryYiu+VAX7Chdhsyd5XDkpkb8W0BxJnHGo2I00E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863738; c=relaxed/simple; bh=JnGXdB+Xt70eYBvQdqribN+L+yicY/RVPdEdddP81aQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Fq0L5mgGdmY+q44NJoavgSBnGio5g6NyCStyugtXkHLhENlVYrQ1b3VL9wZh2KWxEvKxj35C2SgVpPWoLKtsU7CjlcXYEksRQboipaD5/RyF7/KJhtRsxACtudxxInesSi0gHHZgoX/CDu3KlYl9kdE3ad1WCKeE9fgEf5SsVlY= 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=TGy5PDgn; arc=none smtp.client-ip=209.85.214.182 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="TGy5PDgn" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1fa2782a8ccso16812175ad.2 for ; Mon, 01 Jul 2024 12:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863736; x=1720468536; 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=iHOPxF8XDaYgBRjbvQ9Z/USErSaOdzoImvQNh+JNxgY=; b=TGy5PDgndP83aHX85oXS4QiGruBwULFzVbbuEH8L3zq0kizeFrxwr5WKSFgOcDZ72A UyYNz8zIWBn10dyE/Kp3qviQd7fH1dTtcl3qc7pFmLBHv1z/SsuwKQ+g/qSIqsVW/97N XyjdLBLmGblIIc6nKSJi5QJmN+Nzk1KymCrSwkfnFwIOv6Z5srDTVnbtLei5umJlRmGu jXSf5iywY7Fc9eAlQXh4+12g1KpYxy+IaJNhPAYIzLn9iGSG5vjnv7gO2yqTpUxDl9Uw axB4YMHhKHVgG/V45XiRgXsUGrmuHQdyPY8Mz9A/ApIvs3ExW7mvJAc0DDltjbafRZB/ xddA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863736; x=1720468536; 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=iHOPxF8XDaYgBRjbvQ9Z/USErSaOdzoImvQNh+JNxgY=; b=pZPsMjOaeZ1ORyp3G0IdHDmtYZs/KTKGfpV5l2eltKhz+3kRdT4WGgi3a+15jg55R4 FEMe82wrAvXKgx/X29qRWK1tqiVXqReiZ4FqPfjhovweCEZ+cQRIYk3QbiZQohH5M0wB 26cmGPb0hDNS8xt8FEYzLp6j8Ok/YxO9zWlPEP75NHJf1MuVOjxbceOU8slTo70mnMO1 NzlHhqQQbzd81WCpjtIKebjXcdGxEaE09xbdRy2PYv5KyRRsfSkGkxEJ6CrhS98PMwT9 +col+KEeVVfduFpFv7DuPtVTCcGsDkT2UXGxvCKPOoQIp0lCgOqO+a3o0QwRv/8jaAm6 vFTQ== X-Forwarded-Encrypted: i=1; AJvYcCUx1EdeiLA47wKCDiSRgiXbjlEApWswt6bo3zKA5FlzFIwKnVw93Wuilw+pV9nUUjQgYzYTxgvShaJPoMuuaIlkbmXje5yo X-Gm-Message-State: AOJu0YyvYcDSojeQBV3utUjoa9Hr08f1QXuLwb1OUsP9Cjm1hPZ/6Tab CtycZSPEMqIErpObM1dMcR63gykiQNoTJV8ggMZDCPYVnZF7RV1m+A4lXe1Efg== X-Google-Smtp-Source: AGHT+IHOtaAQcZUNbP+b6dBFvluxRUO5cyTDX8CNNMQwCvAuFTsKNWGLRpTM2AqDilXMTSdJxiW8Gg== X-Received: by 2002:a17:902:ea03:b0:1fa:2760:c3e3 with SMTP id d9443c01a7336-1fadbc73792mr40803415ad.6.1719863736499; Mon, 01 Jul 2024 12:55:36 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55:36 -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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 3/7] iavf: Don't do TX csum offload with routing header present Date: Mon, 1 Jul 2024 12:55:03 -0700 Message-Id: <20240701195507.256374-4-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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 19:55:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13718604 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 A59F716F914 for ; Mon, 1 Jul 2024 19:55:38 +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=1719863740; cv=none; b=iOzpSLVmRczAv/4iAMmPIvwtCeUT7drfEZj9nCFkRldc/7gTj6XNFUJat+ypsLJwpE7la7bGPD3RHzx2nMXPmgqtvegDBHhuOFKd3lvY1fNQRHfEMuj4yV1KKX6fpdh8TDWFw0EYYi9vcwMgcbNbcK9+pXoQ5cZOvyqQkYMdKzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863740; c=relaxed/simple; bh=uxOmoidH78YdY000EH37e1nueV+e7fDSSclo4ruVE94=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jXQ22I8ad+rsfCvsxSKcmAftOu2x2pHwsIYufrFVLYY94yEIVm3KTUGrISVM4UG0hyIGRjINxY3fDZFV6Gfv+0nDCu8xscpbeQdhBSS8sDjPbDgwxYBt+TWXoKfM9d/VrZJxl/eYELU4W6eK3rUADlrqrjNuMeundjMO1HNQkaE= 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=YTV+KJIt; 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="YTV+KJIt" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-726d9b3bcf8so2359975a12.0 for ; Mon, 01 Jul 2024 12:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863738; x=1720468538; 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=uI8MDs8EI2Ym4TuLxEgIHn/m8yrd2PauWbLXazH6/ec=; b=YTV+KJItSwt+jumYjTXNhLksl3V9KtBm260DD25myJikpf09BYg4dIhS7qqo0/sMxk zft6qWVbO7QsFayPoJJ/lLxG+3DDTZYHJrKV0EazFLO98zXiGz89cYeJx7IYJB1U836h 5chPytYXE8mX4Vx73Jl9iBoGpM/XggoiUqDZLE97aHo4HQd12L3isFwGsxNru82mnE9E 8wkYYZmMdrf2Y5+4X1wwYE/tqRRibYbdk57yfLM+Or+NxqW3uOFBsV+BneIqnAG2nxAz 78L/D6IpjPSFpXYPDsOKhh9C/ngJZbxsHmr1FrCB1UBfbFw7XbJdLPTe8unv2pd7P53T ATLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863738; x=1720468538; 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=uI8MDs8EI2Ym4TuLxEgIHn/m8yrd2PauWbLXazH6/ec=; b=KuXQjXDU378oymH9RZLqkEIYQzySE6g4/mkxnQ5ADB8JLb/zhRDMvuKQdVaemMyto6 Xe8kGPgVKsoZzXCVQYAmQU+d/uWoQ6YmzfiTHFx4WAbewXwz3DIIGxOEi+ifcKnvJ/D9 XkCp3nv5GmanN+5AuXvL33cemBVcQbkAl/HVFa1tZ9ztMEQDxDsYllzUARetDrQpCyKx YE5nxfM+J/C0pFPp2ILT6RqQ5z6BCUW2J07S4xiOu+4LrmJXNF7Q5P5NXhoHLsz4ssYR /469i8YErOOl4A50M8TFysanYbqwd/kQalB55xbxehciSpplR+au7DuB02AClyExnZhc D1mA== X-Forwarded-Encrypted: i=1; AJvYcCV4f0IwTumBDNAwHAmDrT6JEXJGULX21PNWSHLSg0FmYvK0HHEmEOTLY/l0YyqnCzGdZG8o8wPsv7JWWB60YyC35RyqigXv X-Gm-Message-State: AOJu0YxCKlkny2tM9q2C+3mYbaVdyyJbW+VCPEiHryH8wrwUKudobH+9 CONoFH9tui0mXmfaIkwnEWHYS+B8qC8a3M+EhTXzadlH5HVGWFTdUOl+hLRZ5g== X-Google-Smtp-Source: AGHT+IGGqaFIGwOU7kSaGwmUOFhZTNMhSfJ212iLHlvjodDZA5KcdVxPkjXFcJH/5TnCeQnSmxqV2g== X-Received: by 2002:a05:6a20:a106:b0:1bd:2559:305e with SMTP id adf61e73a8af0-1bef610cecemr6340905637.30.1719863737960; Mon, 01 Jul 2024 12:55:37 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55:37 -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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 4/7] ice: Don't do TX csum offload with routing header present Date: Mon, 1 Jul 2024 12:55:04 -0700 Message-Id: <20240701195507.256374-5-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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 19:55:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13718605 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.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 305A017085A for ; Mon, 1 Jul 2024 19:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863741; cv=none; b=piXnwkYIt0fUNJj750QIGVVodpYznPyuz+vbSDKkDnNoLGKCyJ2k2hXgxPtaBbIp8zD8ZzQVW6MUNlEQOFwpusf5oAqHO/B8cc5G860Y6/Vc/pMIR/YigTd/53cMQiS43ER5YHLDVGalaMZV4lLyMkZbiG2yLUERGomJsXHbEDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863741; c=relaxed/simple; bh=8/pFF11Z3KOiR4xQOxoh/MwK7AhPgQ8WdN0Mbaaew8Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BjBUhRe93GdRPqMAvTp0/qeO3pHSn61Vvwo/LoMZcvzv3vIfrp1yH2r9k+MEVCRW4QsKkI1EJFPqBG1Xq+sx8WL4C1lNk8IejrNgkLDVIPderoq7Y5UXGu0zJQxvCxIjruy2zXHN4mt/lBrdUPFEeheYeaiAnoDi9ltapM4X5D8= 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=aG8APn6T; arc=none smtp.client-ip=209.85.214.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="aG8APn6T" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1f9c6e59d34so27534685ad.2 for ; Mon, 01 Jul 2024 12:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863739; x=1720468539; 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=iAIOpAMqiMCAKIQhW4VVXKTt/GHh68CBtrTOA/aQ9pg=; b=aG8APn6TuEMNqQcYYZ/LMxPKF95/qKkN9pq8j+h+KTmH4ymlU+irjhzunOsMInTaqc pZx73UMaMnjUjDqkXHgTXg5TMLlYrXLcP3Fe6oDF0TJxEP6NY0tE29nrtdn6nizikIns qMeHu4MUznPhqw/S4YcloFVxBPmvmNfVoxcfrHT+JWbLt5Lo3egit+JCU4olqbUNN7Hn 7SUBnDMAMmSrOu5zeS2w0Dp1U0G8UNfrStihHFNe4c/e6UlZT26nH7e8OWi+fuIWL6gN wrbEgI+3jGgyEjPmHV4d5omCXF+6QF/RLNwHnK5A7WxUvgaPIw8rpXB3/d4DQPLH2xHD ZsBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863739; x=1720468539; 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=iAIOpAMqiMCAKIQhW4VVXKTt/GHh68CBtrTOA/aQ9pg=; b=qYfqQrkDqxS6i6L8xfHmheFA+svk1ib9q9gAhXudzbDosbObHn8hS+rZ7fGGjrI9MO s8OO/kIximecvMsB9tmrkbeFxxZ5IgimdhbwThbO6psiUHN3C2+eFnLnifEOLfXjfcTf Y1DWXvHHqZf7Yk3WRU9q8atYD2DaQI9BIMHO9rY5dnKiOAduAkNXjrwpFLgu3PoAJOgP yA8/fXOdlKnDsFCkM93ux/h4r0gDF1s5GbYKd4wwsmrlrx29PGfyBv5nKnq8kg+YILd2 0SJ0FFjZwcEztCQkF0+G6Z7K2PcFuBeOR/EdWDOcbtEoOb7jmYZ4bCpGA3TU+82xHXtV CnSA== X-Forwarded-Encrypted: i=1; AJvYcCUFUNAWj3AqNhkb/H/cEiXjTUIGmn6wtrBefy/hCtdqGWwbEVrR8TSMJlN2zxEv6/CsBOMaGK2EAbpke/Z0uEVmvlFGwSpU X-Gm-Message-State: AOJu0YyrH1yvTncST4LGwQAvHiqHLtWPYzM27BO2GaPbBG4maVGqyyhx Wv+wctTI2oMREVVjwNh3SFFkNgnFIMKXsBsTfkRAHgYwgPwLcNqxg9dfm2LJdw== X-Google-Smtp-Source: AGHT+IHEHsOgYK1qej/Js39qLen6fK+luAcTzkkTG9I3fYo0wFFUoUN7Z6jzgU968IwoAzJB6Bn+VA== X-Received: by 2002:a17:903:1c4:b0:1fa:4b9:d00f with SMTP id d9443c01a7336-1fadbcf3414mr73054515ad.53.1719863739482; Mon, 01 Jul 2024 12:55:39 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55:39 -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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 5/7] idpf: Don't do TX csum offload with routing header present Date: Mon, 1 Jul 2024 12:55:05 -0700 Message-Id: <20240701195507.256374-6-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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 19:55:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13718606 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.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 A053116FF4E for ; Mon, 1 Jul 2024 19:55:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863743; cv=none; b=Wj0IUdrj4KR5emVoXO7J92xliYjmHoiw7P43ggfmOnJ+hzcE4nuK/BaXenzmuAxJhiQ8ypN8RxohO0E1rmbfLjKAy5tav0YeR5QOLdk76I5GmzPvJkJK6sOwl0OnV/45h0T1KvpQZ/yRE+58YBhgx09TgEE0ZehhfN6fFfhEb7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863743; c=relaxed/simple; bh=wY9AAuF4FEm87P0bhytpAgogKE+ttOxkUg/JOWBRpF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y2kUaYOe/Gm3A+VuZxCVGk0TiwdYBaOXrcLKSBFCWGd3JobzzcGKl9ovep3AykT6M1s1OK5vk+pMdB7ihNqYyAJGoZUP1ZryblfySW8wclpvpBYRgeW5hReUWBBIj2di1ldxuVjPODrAXMQgeyvmpAqncrLISoTql24Pho2ueQw= 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=D9KhVvZA; arc=none smtp.client-ip=209.85.214.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="D9KhVvZA" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1faad2f1967so33572885ad.0 for ; Mon, 01 Jul 2024 12:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863741; x=1720468541; 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=X+MUYNVtleEEkt8v4UAX8klVrIAJI/EYBs/Ma+PY/Rg=; b=D9KhVvZANJfdMmTF6gNmvcyhgPvoCFhbxHxn5XnnTgp3cB1OewJHaBdG+k5RU+TExE nyD0Kk+PE8Y0PWoCmzlsKR1FUUu4viUXwv/l1CphQtKYGRWdvNBR3D3s6lCFwMksANFX v2KIRTF4jkdaaYkX3FXdnnMbOSRNGI8d1NIw5W3icG3SsuiYYBOT/WCVnGAghaunDbAU mL/FU7N2FwY40KJOypHBT1uP996d6RkTKp0C1vvqoFrurfw7iIBv6/e+HqQvVluN5aXC zv7QKRQ9YeHEUUo4M6KWgOgiX9dx0AtyAvo6tLimw/y5eLjSA15iw8abNQU6vuAxciC1 Q3uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863741; x=1720468541; 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=X+MUYNVtleEEkt8v4UAX8klVrIAJI/EYBs/Ma+PY/Rg=; b=TxLvvJ36WuoWa6v8ug/ZznR18ZQSdKpUMRQKNmSZVVCYT2sQ5YZbN6uMadIWCUDx/4 e7U7wApqzLTX3H2U3QrrsQLoMZAmFe+lKNCGwtMgENCmXdiM8ILGObyG4O+OV3d/XRwS JKrQzpVEGV6rgJqKM4jiqSssUI0PHMhXScL5KPVEpXqT6sQpPHeV/2gzp72wumndWX/x N8406acplLlmzukiZjAEM6MYeWhvMrq/S1eSdsFsyKEKh/p9qHIgufts4qfjwnkRS53S a6szISc4tH7IBPnZLri5XujHhUwh94bGsYk23ewLlFNnu2tB24DA7UtTgSDkZn8lH8d6 IIHA== X-Forwarded-Encrypted: i=1; AJvYcCUsELln9FmvwdT3XCJNI9GzT0/YQr/NE7lE7B5wIQ7gHhPdRkXe+MDijjJffqjSTsqVVea/LdbkOX1HTBLskEUbCOkD7do+ X-Gm-Message-State: AOJu0YwdBXbdB64+GzkadRqwwawTWR5EX+3DuD/7UZAwrSI4APlo8oS4 eP9dj31nAXlt+T1rQFnYnzHCwhGDjdzOHbZJ0S8Tjm9N19h14uf0IL+BdSeryw== X-Google-Smtp-Source: AGHT+IEUkxep1ozwUiaocR7v8iGkitxUKRQnp6Rzxqvr4UeMuh5P4ti648Zw050UuFUvdhux+IlllQ== X-Received: by 2002:a17:902:d4cd:b0:1f7:1d71:25aa with SMTP id d9443c01a7336-1fadb42d78bmr112532305ad.6.1719863740997; Mon, 01 Jul 2024 12:55:40 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55:40 -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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 6/7] hinic: Don't do TX csum offload with routing header present Date: Mon, 1 Jul 2024 12:55:06 -0700 Message-Id: <20240701195507.256374-7-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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 19:55:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 13718607 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.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 2CF4A16D9D4 for ; Mon, 1 Jul 2024 19:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863744; cv=none; b=AZXboxOxtg+zG6W/DB7bRsznshWoraddqzSXtfZRUztgy0UnBLQPiHdBtDcbjUpYQgTelisJ0DAqISiG2PancbC6HfDpltKO7tYxkjUSS0G6gmn4LOkA3xybjrovWGfiGXry6mReT7QXvWoymGgqSv8VFcJovP4BxDa9cm9xLsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719863744; c=relaxed/simple; bh=7jKnZ6ePIo6VCBoIov7zVF6xjnmelNc72zCU7n32MDs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HKEyWIPhiesOiJxDNoWXXg8Ec0VKba9Sx7ZpeeFY9cSMwg6fFLJqL9S7oGcWfkTUDTqqlLyeU4ziYINqbsr7BOQL0C+dS6D9YSaqL2wr+JPTAHuKOcdwnRC5sOPdu5l63zTBB/A0EERFfVM3q67PdSJdJqLrNat0Q41hHU+KLq8= 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=Z1tUz9n2; arc=none smtp.client-ip=209.85.215.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="Z1tUz9n2" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-7178ba1c24bso2154499a12.3 for ; Mon, 01 Jul 2024 12:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland.com; s=google; t=1719863742; x=1720468542; 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=61ZyYjhYYNBZVEzKLg/hj86qg6mkRXItd8q/o7xs+AI=; b=Z1tUz9n20REq/+PsEHjFFeyuUlzwC+SxY0iJwG2I8jcTeOZGjYXH7u5V4EoSuD56cb DuOM0Am17+bxGuR7qDbY5n2oxDwhGT1hfRQh2Gwq5dxE4v3rGo8JpS8Q2KqWp3vZyXhJ AQwc7pV22e6WzljdfZF6AVYw60+IPWDFAINcZf4sXQKS5FmV8454siLIyXtImhQ1gN3P DyhHQT7oaElXRmvuvE2SzWcvs5SBV5MwS5aEVhc0Nl0JrVYLiNdVkLuaMuEWdWmCJELO UimRjb8xalQNkOwIhshlY86pRw7Oqg4aydplQVKeXH4Dmzxm6Or73s8f+07IIUf+qVSa MQuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863742; x=1720468542; 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=61ZyYjhYYNBZVEzKLg/hj86qg6mkRXItd8q/o7xs+AI=; b=mJ3GyjKDEa92Ah8xsH02kmTLNR9I0TnTRQ3zxh5QX6WcktrXw+zT6SnbDE7YhBeiEL 87eyjEhejwr0F5moIqGqOiEkI1tzLbV8LXHajSUMCMmnUZSgwuz4adNJL3Ns7DL5+a5q m5edjqAHihuigHB9r9XR+++rYy6oMxqwYA7mUWv7AIQl0k+Li1v+GKWiselLpxxtmHdD hToZ1DgYcniRMSUEg+jrcNwOQB1GEU5eXgBatm1X5KbWaL3NlktELUXoaJ2lcDiXrD/6 U751nnuYNZNJmjFVcNiAdHvl20Dmn1Wx8g6kIvCCCy0IP847kRU0elJ3W3KqnSXn+Rm+ 6Fqw== X-Forwarded-Encrypted: i=1; AJvYcCX7i/X2dgLhoNkE98DsJZWK81uN+S94Z7Dvli48jG6A+yGq0qWz+PKV8aGVEG1lWhetjhjXQy1rN7r4ZqprWlpbQfzWarKW X-Gm-Message-State: AOJu0YwySmv73ZCpHfkcdmqdskexjgtN5Ji7y4EYtVPL6x1CAu41hbwN kV2fv/JNDbERIspcS2Iaw5ZQpUoqFQ3wmfJfJxnxIosnhEzZ4DBZG8ZveF0tNQ== X-Google-Smtp-Source: AGHT+IGIKQ7/gjxnqqYBpMVXf/4AF9OUT95veSuWsUMXsw8fQFggqDdIHRjFvEfwvgIsQklCD6W3kw== X-Received: by 2002:a05:6a21:33a2:b0:1bd:2215:923e with SMTP id adf61e73a8af0-1bef60f5ef8mr11276631637.4.1719863742519; Mon, 01 Jul 2024 12:55:42 -0700 (PDT) Received: from TomsPC.home ([2601:646:8300:55f0:56da:44f:4289:b808]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1599c44sm68785155ad.273.2024.07.01.12.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:55:42 -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, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 7/7] fm10k: Don't do TX csum offload with routing header present Date: Mon, 1 Jul 2024 12:55:07 -0700 Message-Id: <20240701195507.256374-8-tom@herbertland.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701195507.256374-1-tom@herbertland.com> References: <20240701195507.256374-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 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",