Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1918795lqa; Tue, 30 Apr 2024 03:19:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZN/fwu7qbCwAxcfTZMf2nG2HWzCj3Ny6Dy/DILdu52eNGD5ng5HjgEeZXu5wpcMWiYIstWphEHMzoOSJzzmIZM0wC22tzIfGSNyrR6g== X-Google-Smtp-Source: AGHT+IEW0BMoMj8Y/ctP/agP93BGMne5+uvmxG1zCNO9z7y97wZTmGWEkPclu6//edXJgiS7ihln X-Received: by 2002:a17:902:ccc1:b0:1eb:2ee2:43bd with SMTP id z1-20020a170902ccc100b001eb2ee243bdmr15173342ple.7.1714472397471; Tue, 30 Apr 2024 03:19:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714472397; cv=pass; d=google.com; s=arc-20160816; b=MtTLwHw6fKlMKEv4KMEs7Y7/sHGRnHLwo2+3gvPwdUmOA+C+L18G8x1iyZCIHgncqI AjVImyxyGsvBs0FzFVjPB3cwJ6TV5eHprjH7H2Rkv4fb1r9CfFqRFakicGBRzLiz/2TU SM0uVefZC/XDnbgwL/GMBml/BCXtAZCP2XTSvdJ+eqe5fXm/v5RriMKvOiph6wVqM+d9 fLfdDW5IqeZe8Us2msWOyygFVhP7uJto6idvNNAgzvE82QcQjaDslka+IToE3vsbJ2gW XwvSh/afCH5Uy8/KdgixD1pQIPOBWIPqf0MyGQZ6Bf+IR4+82+MUgJhnKK1HNyIlS4Zb V4Dw== 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 :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=bMaZOXmwfkvy1y0270V5YasUqwBAP06Q+stByWGvEA8=; fh=RasootU2ippcbiYZ4EaKw9aByvwqdj/7fVgIu6o9mFQ=; b=wJL49CwoSquH9Pm6PV6ssIb1TI3htF71Dh2yRki/6bEvGwIBlZBT5JMkd2esJU1SFQ fZ8tl+8hCQl32TFuQPHZYJN6Y5UsgCTVwkxdzXdjLrxUkXL2YRzh15Q9W0nU3jdKtjoH vYzAW3s0Z8ZNP7c9081Pjx2/lsB9hycX65ByhQEc3ZQydEhe15srTE3W9TaFVEoGPrbk oAcXksbrAxGS91PRNnYI57CVU83PWY9skzVm9DMW472hOb90X/VCF2v8HsVXqK/YcJMD fjGugCUUD2Gmjzxlq/PHmglmhzjL35VzU8h015Fm7oKCdo+0e9ofr29LsaITUzLaXWxt bIVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L0Axocf7; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-163759-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c16-20020a170903235000b001ea9580e570si10595107plh.186.2024.04.30.03.19.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 03:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163759-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L0Axocf7; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-163759-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 43147281EBC for ; Tue, 30 Apr 2024 10:19:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2040812A144; Tue, 30 Apr 2024 10:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L0Axocf7" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 639D61272AB for ; Tue, 30 Apr 2024 10:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714472390; cv=none; b=CwTbRllrhZgTlpp2CPaRjFdBjfqz60JHP2s1h6B4GFVrcC8qUq2YBKRpaohsHEYuvoPEEopRn5l9ZQ8hW7T5gBX1zhf4LdJAY0aWIHQprP4Je0PwB8jAAC1U1qNXUT0Zvey/fAmBbwhl6gBO+Qq3FyfmmOwX3QOLJaS6eotlLD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714472390; c=relaxed/simple; bh=RBvwsFiMJYsTuSDgHfJczO2jCg4XQ1haWtK29o2NpoA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Dz9e4M2S1Bz7PPq2xAwZwQU/mZKAISgoAV1pzSu5cPU615k6shCO/oUPGVEgvBbGBHOherP6AbCtVBf2YioPM/vlMvsBTygFSC3vrFHEtHNvprLBhwjbo05+NDV3uWjxRaJXagdQhMpsviSljTerUcaNvp/3DfNuvZdphi4F1pQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=L0Axocf7; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714472387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=bMaZOXmwfkvy1y0270V5YasUqwBAP06Q+stByWGvEA8=; b=L0Axocf78uRjxwKfuY+5Pz8O/x7zvu3p3oFvUcqLR2sT1EJ/KZPLcQgY7QHa1QVynuhsYR 2nM4I9DRrWzvN+e5uzi7KbGsf7e43uh4GnKq7lDbMOvbuv9F+TwwIHtvn5M+28Ax14Fs3u 3UIY1T4hLKhfsC1XCBLMNBj403K7oyQ= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-30-IpPgtiXbOjyIA47weskFvA-1; Tue, 30 Apr 2024 06:19:45 -0400 X-MC-Unique: IpPgtiXbOjyIA47weskFvA-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5727e9f92c3so243967a12.0 for ; Tue, 30 Apr 2024 03:19:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714472384; x=1715077184; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bMaZOXmwfkvy1y0270V5YasUqwBAP06Q+stByWGvEA8=; b=pGv2EBbuqOloyZ3HR3bpSJ2d8212NfqZcO/IIkHjuiz3Mb6pD5q60rkoqkNs4URrwI MurwVpAzmpv0lZr7JZ2Q4OxQfYWrWYvhu3xi3jcQCOdytRyhCTjccqE1BvT2mGb0XnDH 1KWQPkSYdiY8vA/3zEhtBTNXdeg4eZcRCRxZgigH/AJV88ebb4pItS31qgBq83xZUrKF 3I4j519jF3vZqdn7tyBVdkYox2Lbd7B0JuUQx9p8HlvjdBuet8MRtAEDNlkGaFAe8jGs ytB1ILwg1VjONxCMHffkAamKxpy6GM+FaKy9agnEI1XHkUCeJYJLJMaJVkGpDnOGUXPE Jd6Q== X-Forwarded-Encrypted: i=1; AJvYcCVccoHXObVpdfQxTvfUHSqCx98BshdJmua5TwcDfgcqAqPJ4bwOSW+ITIqAGPjlxTdAR6oTE6jKAOcht4HHdfh0MmS4G15CatEXEbBx X-Gm-Message-State: AOJu0Yy5m42j3D4tJXPNUETUjuZKB3Fo1WDqjzM4DoBqkL8IZvoYtU1K JnasE72EvDWaXtw+48YbDBIpKtVqWqnq4SsSgIiuWVAn3qpgLKYh3NTtaUC28VMFVkQFxmT4vE4 9h+Ftc9kuSOxqqKBb+aoSU21Czx8UPozDgkFWCZ7SD5bvILnI0U9evn3FboAjFg== X-Received: by 2002:a05:6402:e8d:b0:572:58d3:a6bf with SMTP id h13-20020a0564020e8d00b0057258d3a6bfmr8032151eda.2.1714472384606; Tue, 30 Apr 2024 03:19:44 -0700 (PDT) X-Received: by 2002:a05:6402:e8d:b0:572:58d3:a6bf with SMTP id h13-20020a0564020e8d00b0057258d3a6bfmr8032128eda.2.1714472384232; Tue, 30 Apr 2024 03:19:44 -0700 (PDT) Received: from gerbillo.redhat.com ([2a0d:3341:b0ae:6a10::f71]) by smtp.gmail.com with ESMTPSA id y9-20020a50eb09000000b005727bdb1eafsm2770452edp.40.2024.04.30.03.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 03:19:43 -0700 (PDT) Message-ID: Subject: Re: [PATCH v4 net-next v4 2/6] net: add support for segmenting TCP fraglist GSO packets From: Paolo Abeni To: Felix Fietkau , netdev@vger.kernel.org, Eric Dumazet , "David S. Miller" , David Ahern , Jakub Kicinski Cc: willemdebruijn.kernel@gmail.com, linux-kernel@vger.kernel.org Date: Tue, 30 Apr 2024 12:19:42 +0200 In-Reply-To: <20240427182305.24461-3-nbd@nbd.name> References: <20240427182305.24461-1-nbd@nbd.name> <20240427182305.24461-3-nbd@nbd.name> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMaMhk+L8gWc3ZlRQFG0/Pd1pdQEiRuvfM5DUXDo/YOZLV0NfRFU9SmtIPhbdm9cV8Hf8mUwubih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zkmSxN1nABoutHEO/N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sat, 2024-04-27 at 20:22 +0200, Felix Fietkau wrote: > Preparation for adding TCP fraglist GRO support. It expects packets to be > combined in a similar way as UDP fraglist GSO packets. > For IPv4 packets, NAT is handled in the same way as UDP fraglist GSO. >=20 > Signed-off-by: Felix Fietkau > --- > net/ipv4/tcp_offload.c | 67 ++++++++++++++++++++++++++++++++++++++++ > net/ipv6/tcpv6_offload.c | 58 ++++++++++++++++++++++++++++++++++ > 2 files changed, 125 insertions(+) >=20 > diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c > index fab0973f995b..affd4ed28cfe 100644 > --- a/net/ipv4/tcp_offload.c > +++ b/net/ipv4/tcp_offload.c > @@ -28,6 +28,70 @@ static void tcp_gso_tstamp(struct sk_buff *skb, unsign= ed int ts_seq, > } > } > =20 > +static void __tcpv4_gso_segment_csum(struct sk_buff *seg, > + __be32 *oldip, __be32 newip, > + __be16 *oldport, __be16 newport) > +{ > + struct tcphdr *th; > + struct iphdr *iph; > + > + if (*oldip =3D=3D newip && *oldport =3D=3D newport) > + return; > + > + th =3D tcp_hdr(seg); > + iph =3D ip_hdr(seg); > + > + inet_proto_csum_replace4(&th->check, seg, *oldip, newip, true); > + inet_proto_csum_replace2(&th->check, seg, *oldport, newport, false); > + *oldport =3D newport; > + > + csum_replace4(&iph->check, *oldip, newip); > + *oldip =3D newip; > +} > + > +static struct sk_buff *__tcpv4_gso_segment_list_csum(struct sk_buff *seg= s) > +{ > + const struct tcphdr *th; > + const struct iphdr *iph; > + struct sk_buff *seg; > + struct tcphdr *th2; > + struct iphdr *iph2; > + > + seg =3D segs; > + th =3D tcp_hdr(seg); > + iph =3D ip_hdr(seg); > + th2 =3D tcp_hdr(seg->next); > + iph2 =3D ip_hdr(seg->next); > + > + if (!(*(const u32 *)&th->source ^ *(const u32 *)&th2->source) && > + iph->daddr =3D=3D iph2->daddr && iph->saddr =3D=3D iph2->saddr) > + return segs; > + > + while ((seg =3D seg->next)) { > + th2 =3D tcp_hdr(seg); > + iph2 =3D ip_hdr(seg); > + > + __tcpv4_gso_segment_csum(seg, > + &iph2->saddr, iph->saddr, > + &th2->source, th->source); > + __tcpv4_gso_segment_csum(seg, > + &iph2->daddr, iph->daddr, > + &th2->dest, th->dest); > + } > + > + return segs; > +} AFAICS, all the above is really alike the UDP side, except for the transport header zero csum. What about renaming the udp version of this helpers as 'tcpudpv4_...', move them in common code, add an explicit argument for 'zerocsum_allowed' and reuse such helper for both tcp and udp? The same for the ipv6 variant.=C2=A0 Cheers, Paolo