Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp430455lqd; Wed, 24 Apr 2024 06:50:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXdPGnC3B7GkksA3ZR2LBR6Bvk8YWngR5dBXDGmrumd4xC8sy2QzxgP0XQlGt913Ch0J1dkMpNaDJfXJsvGghbib+0lq53ZZjFxyvS5eg== X-Google-Smtp-Source: AGHT+IG2IU3LZ9dXgkwmdH2HMHz+tOuD+HRJ3twmvirb3DTZYBtoIF9dSqkdoYCmvWGauqbVFUi+ X-Received: by 2002:a0c:ee69:0:b0:6a0:8434:5959 with SMTP id n9-20020a0cee69000000b006a084345959mr2529188qvs.52.1713966656846; Wed, 24 Apr 2024 06:50:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713966656; cv=pass; d=google.com; s=arc-20160816; b=B/9/Z6lRGlOhAXcPPGjQhlfAx7QwuILYrv4JiXZXjJ+vdUXljVTXiNvvazVOkgVECf jbkR7ZZDJF1WlF212g/96be9frCs1ITVaZ/zIJZ+EhOCFdQ3KTur0r/L5wq/IjmNuGyw eHPqtA4BafhsIPEngEPtaEo7yhrZ41cWiM9s3XssP2CR5ZOd+0HhBHazv8ICJB51THB3 T0XZyFfenbHq9R9NG4DrtLsi6sENRQOnWz5rgmy+4PXudcPKC6tJqgVWSv2/93n+cbQA BbMWGIlcVNbzOoxp5XnUzYuhcO+qqzUvz9GGCKxF4Wnsv7ccsSQ0JH+/TIumJfokGcnw oCng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=G3hli6eYNuucDxPQhgOYx6F2vYtfh3N/KW2prUSvcro=; fh=mL0m0ZhDMZ/2Da3hizj6BRr1EDFXABfoVlJt4WxoFFA=; b=fq1uKOMsl6rUuEsKeS03bTZw0GVUjZOPzjTZX/vqnhnpMhVSHHsMm/LwApk8LVmQDg jVZtIalxXUaLhkIwzvU11GJ0mz6rHKzwwjbu5S70yBoVQLK7buSh/uR7lTOVsH6s/JnV xV81qZIPQVgsQbaCgRpi9nVFdQDobiYL4u3fxQW6jUvSGMRmA44nQNoYfInaTcSIsgTv C8IE0jUJ/GIoWX866tfkNePPF44ALPrz31lURx46hvjLH0/CyjreykJvBbYNHjvr8GSH esj3o2XvynHvkTl3I2ImFMmnEd8L5NVbtJxTVxH5IHLnEoZdhGW6do0t8Tz1gNja3Zl+ Gc6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=EFKkX+Rm; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-kernel+bounces-157007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m5-20020ad45dc5000000b006a082754cadsi6376540qvh.292.2024.04.24.06.50.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157007-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=fail header.i=@nbd.name header.s=20160729 header.b=EFKkX+Rm; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-kernel+bounces-157007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name 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 80C961C22F89 for ; Wed, 24 Apr 2024 13:50:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10DFD15D5CA; Wed, 24 Apr 2024 13:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="EFKkX+Rm" Received: from nbd.name (nbd.name [46.4.11.11]) (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 805E815CD6F; Wed, 24 Apr 2024 13:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713966647; cv=none; b=n1mFU7JVubgb4FR7xpHPM74qMTee6JBiHsHx/xcuaByJxtkleaZ264Nl0mTySopac36LyJ2u8NGQZpd+NmqAiN0QqI99nAXU4G6cJ91xmxDL3hfraSYKnSS4qEjd9M5y3kJHv2BRgJjykI8K8Ms4W9kce7SE3ku8+AouWfYJuWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713966647; c=relaxed/simple; bh=4WwbKPa9Qflb+/iIZT+f/FFfbuAR+zna8wQMxq6DJ2Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BadI4eYhsCOgoTgggST5ROOCeVGpSBOIcHwA56BfdGPoJoVXBguwJnr9wp0ViwIJhCtihFRrB/4ouYFumEWyIG0VSknneX/+weTbZGpbrwJhN63wixepUGne6n6armk9sOipsrQPkdygvYsPNjNaoxx7b2gFKJrUYWhH+6uDKbg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=EFKkX+Rm; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=G3hli6eYNuucDxPQhgOYx6F2vYtfh3N/KW2prUSvcro=; b=EFKkX+RmvQ5yfh4QV1WkjR9B1Y 8p4xEfWxvqL8yegH295TDJSNPUVdtIbYb6OdJOXfBT67wfdZ8iRD8Er0eIkFjslQcf8DrVSE4kxNY lqM5ckw6704T42upD0OS4Cj9visNoNuPwo7pXzQJlMTBzhowrfjEAtWdvVJn9sH/Pn7w=; Received: from p54ae9c93.dip0.t-ipconnect.de ([84.174.156.147] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1rzd16-006lN9-2a; Wed, 24 Apr 2024 15:50:32 +0200 Message-ID: Date: Wed, 24 Apr 2024 15:50:32 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] net: add TCP fraglist GRO support To: Willem de Bruijn , Paolo Abeni , Eric Dumazet Cc: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , David Ahern , linux-kernel@vger.kernel.org References: <20240423094117.93206-1-nbd@nbd.name> <63abfa26-d990-46c3-8982-3eaf7b8f8ee5@nbd.name> <7476374f-cf0c-45d0-8100-1b2cd2f290d5@nbd.name> <97f10c8b5b615eac8f65d67ef10928d97b6b760d.camel@redhat.com> <328ab7b3-4890-4e0d-8b9a-fed7700f1a6a@nbd.name> <66285f637bdec_1924cc2941b@willemb.c.googlers.com.notmuch> From: Felix Fietkau Content-Language: en-US Autocrypt: addr=nbd@nbd.name; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uwwYgNqoFtcAunDaMKi9xVQW18FsUusM TdRvTZLBpoUAy+MajAL+R73TwLq3LnKpIcCwftyQXK5pEDKq57OhxJVv1Q8XkA9Dn1SBOjNB l25vJDFAT9ntp9THeDD2fv15yk4EKpWhu4H00/YX8KkhFsrtUs69+vZQwc0cRmVsaXggRmll dGthdSA8bmJkQG5iZC5uYW1lPsJgBBMRAgAgBQJGoeQnAhsjBgsJCAcDAgQVAggDBBYCAwEC HgECF4AACgkQ130UHQKnbvXsvgCgjsAIIOsY7xZ8VcSm7NABpi91yTMAniMMmH7FRenEAYMa VrwYTIThkTlQzsFNBEah5FQQCACMIep/hTzgPZ9HbCTKm9xN4bZX0JjrqjFem1Nxf3MBM5vN CYGBn8F4sGIzPmLhl4xFeq3k5irVg/YvxSDbQN6NJv8o+tP6zsMeWX2JjtV0P4aDIN1pK2/w VxcicArw0VYdv2ZCarccFBgH2a6GjswqlCqVM3gNIMI8ikzenKcso8YErGGiKYeMEZLwHaxE Y7mTPuOTrWL8uWWRL5mVjhZEVvDez6em/OYvzBwbkhImrryF29e3Po2cfY2n7EKjjr3/141K DHBBdgXlPNfDwROnA5ugjjEBjwkwBQqPpDA7AYPvpHh5vLbZnVGu5CwG7NAsrb2isRmjYoqk wu++3117AAMFB/9S0Sj7qFFQcD4laADVsabTpNNpaV4wAgVTRHKV/kC9luItzwDnUcsZUPdQ f3MueRJ3jIHU0UmRBG3uQftqbZJj3ikhnfvyLmkCNe+/hXhPu9sGvXyi2D4vszICvc1KL4RD aLSrOsROx22eZ26KqcW4ny7+va2FnvjsZgI8h4sDmaLzKczVRIiLITiMpLFEU/VoSv0m1F4B FtRgoiyjFzigWG0MsTdAN6FJzGh4mWWGIlE7o5JraNhnTd+yTUIPtw3ym6l8P+gbvfoZida0 TspgwBWLnXQvP5EDvlZnNaKa/3oBes6z0QdaSOwZCRA3QSLHBwtgUsrT6RxRSweLrcabwkkE GBECAAkFAkah5FQCGwwACgkQ130UHQKnbvW2GgCeMncXpbbWNT2AtoAYICrKyX5R3iMAoMhw cL98efvrjdstUfTCP2pfetyN In-Reply-To: <66285f637bdec_1924cc2941b@willemb.c.googlers.com.notmuch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 24.04.24 03:24, Willem de Bruijn wrote: > Felix Fietkau wrote: >> On 23.04.24 16:34, Paolo Abeni wrote: >> > On Tue, 2024-04-23 at 14:23 +0200, Felix Fietkau wrote: >> >> On 23.04.24 14:11, Eric Dumazet wrote: >> >> > On Tue, Apr 23, 2024 at 1:55 PM Felix Fietkau wrote: >> >> > > >> >> > > In the world of consumer-grade WiFi devices, there are a lot of chipsets >> >> > > with limited or nonexistent SG support, and very limited checksum >> >> > > offload capabilities on Ethernet. The WiFi side of these devices is >> >> > > often even worse. I think fraglist GRO is a decent fallback for the >> >> > > inevitable corner cases. >> >> > >> >> > What about netfilter and NAT ? Are they okay with NETIF_F_FRAGLIST_GRO already ? >> >> > >> >> > Many of these devices are probably using NAT. >> >> >> >> In my tests, nftables NAT works just fine, both with and without >> >> flowtable offloading. I didn't see anything in netfilter that would have >> >> a problem with this. >> > >> > I see you handle explicitly NAT changes in __tcpv4_gso_segment_csum(), >> > like the current UDP code. >> > >> > The TCP header has many other fields that could be updated affecting >> > the TCP csum. >> > Handling every possible mutation looks cumbersome and will likely >> > reduce the performance benefits. >> > >> > What is your plan WRT other TCP header fields update? >> >> I think that should be easy enough to handle. My patch already only >> combines packets where tcp_flag_word(th) is identical. So when >> segmenting, I could handle all flags changes with a single >> inet_proto_csum_replace4 call. >> >> > Strictly WRT the patch, I guess it deserves to be split in series, >> > moving UDP helpers in common code and possibly factoring out more >> > helpers with separate patches. >> Will do. > > A significant chunk of the complexity is in the > tcp[46]_check_fraglist_gro sk match. Is this heuristic worth the > complexity? > > It seems that the platforms that will enable NETIF_F_FRAGLIST will > be mainly forwarding planes. There are people using their devices as file servers and routers at the same time. The heuristic helps for those cases. > If keeping, this refinement can probably a separate follow-on patch in > the series too: > > - refactor existing udp code > - add segmentation support to handle such packets on tx > - add coalescing support that starts building such packets on rx > - refine coalescing choice I don't really understand what you're suggesting. With my patch, the GRO code handles coalescing of packets. Segmentation on output is also supported. The next version of my patch will fix the cases that were too similar to the UDP code, so I guess refactoring to share code doesn't really make sense there. Am I missing something? Thanks, - Felix