Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1271939lqd; Thu, 25 Apr 2024 10:19:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhGorguM5BX3ll3pzEpAYnftyP8ZUzRDshpvjzDTdQ5aV2LSdt1ILxGD/8pkPjFyp0H9f70s0qbkcMf/mLNXrfmn/6wRcvS/vqvyIy7w== X-Google-Smtp-Source: AGHT+IGmaBe+qgo88H2y7mASd6vKWYZxEQzaTMudR7Rx+fGgOKndKCEPKSy3kgiMdWkI7kxyiy2n X-Received: by 2002:a05:6358:1906:b0:18a:9bba:972a with SMTP id w6-20020a056358190600b0018a9bba972amr84304rwm.32.1714065571386; Thu, 25 Apr 2024 10:19:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714065571; cv=pass; d=google.com; s=arc-20160816; b=leOlpJclEQChIvalL2a85hoZ8GfylcBpYjxEw3fGYui0GSQDcfFbuhf9Z3vNzNrFZL KsQ/nCUU9nyQVmddUoC0BdPq07XzJTC94lfPxiBL2CyGK79RAUzL5kbOhnC3Uta242xv JMTUWrhYAlY7qyFZYiGwC/pybdiF1l6/LmqMipyBrg0+908D+wD5MhfFrSWwiDdbNHyK IwqZhCrIlEHGX3hcErzx1hQpT9QS0J9utIjGWHXHA8pBiIzRcQbk6kmC3RsN8OexlS4s fcVtBEzqmkQ1HLW6/OVMpEeUanDN2DGpYIQm1WSDi/Nk1CQJ2rXaCva3VaIaoivhXBhR kI7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=zi6gIX3qYlNYFCzmPgySYwf4UQjtGZRCwX9akkLUtaI=; fh=yUvXEjOyRTxru6UTuYb6SbqUKWOu9unlDRQTthKS1Cg=; b=bOVc0qUgBK9Zze+EporHxwd/9imifj98rRurauY3XcqGMfQE4aEavIcghKkKirZVH7 emnOukqMUyInoWXpJKCX//ggs/xT3YdqogW0gV8hZrbOUaD8JKraE6lYXVQv329QSTog Nb65tdwxjJUIsjzx5GVRGGntFd/SDAGJY5vRNuvkYMxD9HxWWHfAT69myOZl1ID/Poft A8Hm+4qEp1i7GC093Km+CQNYDyf+rcF+e+Ihzm91Fkz29K0c5iNzzndybKAZD9nD+ApB 5A43WV31dzGhhxJMyr/8Z03RfeuwHiwt5r3UIDq+K0byOy+LJ2o7LadkOoa23A9j8Ch/ 9nww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ssi.bg header.s=ink header.b=QcLsvY2v; arc=pass (i=1 spf=pass spfdomain=ssi.bg dkim=pass dkdomain=ssi.bg dmarc=pass fromdomain=ssi.bg); spf=pass (google.com: domain of linux-kernel+bounces-158968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ssi.bg Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cl18-20020a056122251200b004dae8a22bcbsi3263932vkb.126.2024.04.25.10.19.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 10:19:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ssi.bg header.s=ink header.b=QcLsvY2v; arc=pass (i=1 spf=pass spfdomain=ssi.bg dkim=pass dkdomain=ssi.bg dmarc=pass fromdomain=ssi.bg); spf=pass (google.com: domain of linux-kernel+bounces-158968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ssi.bg Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0BF161C20925 for ; Thu, 25 Apr 2024 17:19:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21B6914E2FB; Thu, 25 Apr 2024 17:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ssi.bg header.i=@ssi.bg header.b="QcLsvY2v" Received: from mg.ssi.bg (mg.ssi.bg [193.238.174.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 759FA1E864; Thu, 25 Apr 2024 17:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.238.174.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714065559; cv=none; b=KIUnJz3OTHBr09MPxxxMLb7W/J4hocF292EtjlfG2FBt00FzAOmhpVTb1+D3M1OV1fbTpveLWSk6bVipliPnDBIYPWvZh49UjW3f985p5onNcyPEXsd633MuJXpvS9QGyvT38kAGjjKEcyC1pHXHMHZNcMVWVd8NhWwg/yU8ulI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714065559; c=relaxed/simple; bh=jnjSDnMCXOOxXg1UUOieAbeuHVRhOq6Wkd+/w6HJWqU=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=UR5sHkNlpBj2bQYJKCR1LFHd70ppuLo56JwiJ6ktQYNETeKCNpxw5BjJme70kXNx3FdJ8FrMQ4PD8Ou8Mh7iPr0qTOoafuip6fseXtcDmh8i+A88n7T9KnbgwA1A59VJnsUJJBI64OTuo9RpBXB0lRz+wUF6bBkDtuk0Dlj9ZtE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ssi.bg; spf=pass smtp.mailfrom=ssi.bg; dkim=pass (1024-bit key) header.d=ssi.bg header.i=@ssi.bg header.b=QcLsvY2v; arc=none smtp.client-ip=193.238.174.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ssi.bg Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ssi.bg Received: from mg.ssi.bg (localhost [127.0.0.1]) by mg.ssi.bg (Proxmox) with ESMTP id 85C531C1D8; Thu, 25 Apr 2024 20:19:07 +0300 (EEST) Received: from ink.ssi.bg (ink.ssi.bg [193.238.174.40]) by mg.ssi.bg (Proxmox) with ESMTPS; Thu, 25 Apr 2024 20:19:06 +0300 (EEST) Received: from ja.ssi.bg (unknown [213.16.62.126]) by ink.ssi.bg (Postfix) with ESMTPSA id AE8F69003B8; Thu, 25 Apr 2024 20:19:03 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ssi.bg; s=ink; t=1714065544; bh=jnjSDnMCXOOxXg1UUOieAbeuHVRhOq6Wkd+/w6HJWqU=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=QcLsvY2vZ2mub1fhRo833PU26s1e3aScte8h6eE4C1k8SGNEbhSrMe761iPPOHKGv euJYUo1Igk9FPCTwPEmxjmN0Kvung3mT37ZRu79Am/wi/yJ1RFLITZl7ShgVr+0VFF vO3BzLL5Y7qynkCYZjIRvn0EjjMY3FeYyJusz91A= Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by ja.ssi.bg (8.17.1/8.17.1) with ESMTP id 43PHItdp113003; Thu, 25 Apr 2024 20:18:56 +0300 Date: Thu, 25 Apr 2024 20:18:55 +0300 (EEST) From: Julian Anastasov To: Ismael Luceno cc: linux-kernel@vger.kernel.org, Firo Yang , Andreas Taschner , =?UTF-8?Q?Michal_Kube=C4=8Dek?= , Simon Horman , lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, coreteam@netfilter.org Subject: Re: [PATCH v3] ipvs: Fix checksumming on GSO of SCTP packets In-Reply-To: <20240425162842.23900-1-iluceno@suse.de> Message-ID: <41e7f590-9ff1-da7d-a1a2-1b6e5508f4f1@ssi.bg> References: <20240425162842.23900-1-iluceno@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463811672-2035234302-1714065536=:89087" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811672-2035234302-1714065536=:89087 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Hello, On Thu, 25 Apr 2024, Ismael Luceno wrote: > It was observed in the wild that pairs of consecutive packets would leave > the IPVS with the same wrong checksum, and the issue only went away when > disabling GSO. > > IPVS needs to avoid computing the SCTP checksum when using GSO. > > Fixes: 90017accff61 ("sctp: Add GSO support", 2016-06-02) > Co-developed-by: Firo Yang > Signed-off-by: Ismael Luceno > Tested-by: Andreas Taschner > CC: Michal Kubeček > CC: Simon Horman > CC: Julian Anastasov > CC: lvs-devel@vger.kernel.org > CC: netfilter-devel@vger.kernel.org > CC: netdev@vger.kernel.org > CC: coreteam@netfilter.org > --- > > Notes: > Changes since v2: > * Use only skb_is_gso, no need to check for GSO type v2 is already applied. I acked it because sctp_gso_segment() checks for skb_is_gso_sctp(). If v3 is just an optimization better to live with v2? Is it possible to see skb_is_gso() but not skb_is_gso_sctp() while working with SCTP packet? > Changes since v1: > * Added skb_is_gso before skb_is_gso_sctp. > * Added "Fixes" tag. > > net/netfilter/ipvs/ip_vs_proto_sctp.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c > index a0921adc31a9..83e452916403 100644 > --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c > +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c > @@ -126,7 +126,8 @@ sctp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, > if (sctph->source != cp->vport || payload_csum || > skb->ip_summed == CHECKSUM_PARTIAL) { > sctph->source = cp->vport; > - sctp_nat_csum(skb, sctph, sctphoff); > + if (!skb_is_gso(skb)) > + sctp_nat_csum(skb, sctph, sctphoff); > } else { > skb->ip_summed = CHECKSUM_UNNECESSARY; > } > @@ -174,7 +175,8 @@ sctp_dnat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, > (skb->ip_summed == CHECKSUM_PARTIAL && > !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) { > sctph->dest = cp->dport; > - sctp_nat_csum(skb, sctph, sctphoff); > + if (!skb_is_gso(skb)) > + sctp_nat_csum(skb, sctph, sctphoff); > } else if (skb->ip_summed != CHECKSUM_PARTIAL) { > skb->ip_summed = CHECKSUM_UNNECESSARY; > } > -- > 2.43.0 Regards -- Julian Anastasov ---1463811672-2035234302-1714065536=:89087--