Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1927988lqa; Tue, 30 Apr 2024 03:41:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWp+Td+t7U5Z2na5Ov2jdDXurRdXUKEizgb+Ldt0c/ENfm8skMq5s9pEItKJbYo6kCwumzrTa3W/m9mRo46F5/i9t58t+PqiIMKgpiKaw== X-Google-Smtp-Source: AGHT+IHOYNpMyI0jQuiFLKdmAHfT7vp9QS8a98EoPza20Nq2hPZLCAVD39ab+ttHr34FHCtQXt/a X-Received: by 2002:a50:9f43:0:b0:572:3fe4:18b5 with SMTP id b61-20020a509f43000000b005723fe418b5mr7160484edf.32.1714473685482; Tue, 30 Apr 2024 03:41:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714473685; cv=pass; d=google.com; s=arc-20160816; b=axNff8C6TydewNn4uy5XcxcvszwCzT6t56vi9YPEyjl75QmHOVEo952vC4Ejt0Dxgf E5YQwmFb6pFytrKPCuWT7l6jsT4EQY/B9XnJEk/BPGR+0H7oZGegSlbA272Quo7gRPDh h5H59NNh8r+3mMLYhUDnkH9wYJzjzRRE+Ywx5zjCE+Zx52BeddIPMrQwlB33orX8xe6H na+QG0FsQNpo7CbBbFUQrlIKL0Kj/XnW0auXML2FxrQvdFwKfr9dV0Y2swnWEpPYTo4M 4XqxCNCv52QVyhxu8CaIdYyk96zWgFN94x15IfUtDIpV2AvgS7q5Hv+p8uvtIZ+ZLQUO E1MA== 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=z+3pI/52NLYbeniFa7s38Cg51LKELjtpe+t6gtnHwiY=; fh=1yfz9yaTXX1dsTVjywSonqienmao2sGbQGI+ZaxR3FM=; b=vFomZ3aGF3RGRDmKAFv54m2m6JzjVC5xHxEcvl/NNlXyPqiihoow3kyOgBsz46JnAR zvLAm4GpaWaVaSZ5rpDbsCuppbcRuf2/w7UcNDs/bxCIZfv4pNomhIHnQ5HuI34dzqC8 A8I2+3Jw242c9F1XdvoDi+JFRP0cGQ8rm15BwM3HMeOyDRh0ieJ2a/nNWlfxeyuetT33 1Zokn25cB4q//dHdeXuahlWbyVJW0Qiqh3LBG1eNIabivkftn5GaVoB/ZqNRWFZeJAGj bmNcVuxq3tvHZwCTXgxXv9JMHoG6vsK4AIAYD5bXIzJZK8k6U8g22NbyQBfbGNoIpGQV 3Cww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bT3SDQf3; 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-163779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r20-20020a50aad4000000b005727dbd0514si2687274edc.580.2024.04.30.03.41.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 03:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bT3SDQf3; 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-163779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163779-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 116CC1F23A11 for ; Tue, 30 Apr 2024 10:41:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3033812D745; Tue, 30 Apr 2024 10:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bT3SDQf3" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 7FA9312D1E0 for ; Tue, 30 Apr 2024 10:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714473642; cv=none; b=Vzfv7TcQX4aueyWs7fJzaM9ba0YEcYdiuUMwrK2YSNwwHg8U3D7h06TH+FfOsH3FNVdv6crB52BUFXnZXLpIo8eMWcMNKneq+lIKON0cHGiXmQtQRDf/oCoecbAW3ApWDyhi+gv0EQVB3/vdVbOt/dD+4t2Cuw2nW6F6u9AQuIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714473642; c=relaxed/simple; bh=MZrViSg8jsZ0VHahAlyxw7aZOP9IOSCCin+ffecckc8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=sZa50sMclQ/9KYUUGYRTJlh+N97xdIluP3KHt23oo/sTgIfbdTxojo7w9vPfS+MxnW6yfD3WXlD7fh9cmIzEtbxglj9eyhIM6dSk9OJnw2eLv1Z/BNw4fY8zahoMxu+bsIWvSHfSM4Zr0pD0pc7e5k1sgXq2K0z3QlPGJHU3AUs= 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=bT3SDQf3; arc=none smtp.client-ip=170.10.129.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=1714473639; 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=z+3pI/52NLYbeniFa7s38Cg51LKELjtpe+t6gtnHwiY=; b=bT3SDQf38H7XGTw45Wbtav77sceP/tNqc+eQr8uBbxlj7+0OFRu78xTskaj2y3gEPI4bp7 7LZ/aapXi83YaXfpHp91MB0qpVu51k3hMHNr4FIqBEbLdfe845fB7dEb4VEO0DU0W8uY28 ICbAPcZfepsuB9kAnWzk9+TiXbs8ZiE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-tveKE1jONu-6mPA4faaPow-1; Tue, 30 Apr 2024 06:40:37 -0400 X-MC-Unique: tveKE1jONu-6mPA4faaPow-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-416640b7139so6647875e9.1 for ; Tue, 30 Apr 2024 03:40:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714473636; x=1715078436; 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=z+3pI/52NLYbeniFa7s38Cg51LKELjtpe+t6gtnHwiY=; b=SvKSX8RRxw2fXTVqMS6uqFdHY3QeF4gcuJB7EwDfQx1rq++n31bpa9BGlGyYtP1r+v lrzB0Vs2qULiKLn72OgcqvNvRCQKqsyzxkf7nlGaMnFkljf6uTZ86imYbv+jhCD/I92Z 7rnYQwmrP8fS8WjS2vO9rI0X/BRJfQZNNxRTDr8fy0d1rkb0M8lr1Br6n9HqPzEyOtZF n8NUHNqTWSVvnho1XujhwArIiPaR7mkgRiQHR5EoXpyZtMZveFgHkDgbsEP9NfhRHJhD XbV3XlvjQPEduubI7euFJJcZc9jkC1TFr4X8skxoX6mEaN/JhJDeA8fW7cQaSL+D77Wq D+1g== X-Forwarded-Encrypted: i=1; AJvYcCUcLvJzcXkKQYhDS6luBfeZxd3k1LLlNavLB0k6HShFWdLQOtEAGI2Lf5HSrklXW4b+x8WBkcMUTYgsLzlJ8BvYQHvdsu6CqIM7b1Vf X-Gm-Message-State: AOJu0YxvMR5w+utKJJjOkbpQCio75iqfFpHkc4zmNrG7UuBRM6lYY3G0 ozFzkShVQOeIUo1/wOYgLg+furv6M7LBhOW4EFsGRi1RxMT+2ngB0SS5hmOK+TS0+tbYZVnUUgO gaVNEFlxQgboXqw6zR/2/4snSzB1ZThVaSCsIOx0z2n/i8LOCQuZ56IN9DnIIwA== X-Received: by 2002:a05:600c:1d26:b0:41a:c04a:8021 with SMTP id l38-20020a05600c1d2600b0041ac04a8021mr9320323wms.0.1714473636178; Tue, 30 Apr 2024 03:40:36 -0700 (PDT) X-Received: by 2002:a05:600c:1d26:b0:41a:c04a:8021 with SMTP id l38-20020a05600c1d2600b0041ac04a8021mr9320304wms.0.1714473635738; Tue, 30 Apr 2024 03:40:35 -0700 (PDT) Received: from gerbillo.redhat.com ([2a0d:3341:b0ae:6a10::f71]) by smtp.gmail.com with ESMTPSA id b2-20020a05600010c200b0034c9f060a14sm8445728wrx.11.2024.04.30.03.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 03:40:35 -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:40:33 +0200 In-Reply-To: <9e686cb4-ed1f-4886-a0b7-328367e62757@nbd.name> References: <20240427182305.24461-1-nbd@nbd.name> <20240427182305.24461-3-nbd@nbd.name> <9e686cb4-ed1f-4886-a0b7-328367e62757@nbd.name> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMa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X6RW0XmA53PIQvAP0EAakWsqHoKZ5WdpeOcH9iVlUQhRgemQSkhfNaP9LqR1XKujlTuUTpoyT3xwAzkmSxN1nABoutHEO/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 Tue, 2024-04-30 at 12:27 +0200, Felix Fietkau wrote: > On 30.04.24 12:19, Paolo Abeni wrote: > > On Sat, 2024-04-27 at 20:22 +0200, Felix Fietkau wrote: > > > Preparation for adding TCP fraglist GRO support. It expects packets t= o 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, un= signed 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 = *segs) > > > +{ > > > + 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; > > > +} > >=20 > > AFAICS, all the above is really alike the UDP side, except for the > > transport header zero csum. > >=20 > > 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? > >=20 > > The same for the ipv6 variant. >=20 > Wouldn't that make it more convoluted when taking into account that the= =20 > checksum field offset is different for tcp vs udp? > How would you handle that? Probably making a common helper just for __tcpudpv{4,6}_gso_segment_csum and pass it the target l4 csum pointer as an additional argument. It would not be spectacularly nice, so no strong opinion either way. Cheers, Paolo