Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5840275rwl; Wed, 22 Mar 2023 03:07:42 -0700 (PDT) X-Google-Smtp-Source: AK7set9ftcOVPDq4mov0poVsRv3k513YL6n5tY9ha8Rg+Jseq4oEFZZCwMVPOXBfV5N8tMsg7egN X-Received: by 2002:a62:1b0d:0:b0:625:fadb:fb88 with SMTP id b13-20020a621b0d000000b00625fadbfb88mr2166777pfb.32.1679479662239; Wed, 22 Mar 2023 03:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679479662; cv=none; d=google.com; s=arc-20160816; b=QeVez09r69aUO4i4bF4lEpAnwDWyKGM9wL+xtnWkB51lfh6ExIyT2K0UIMIZBY80xb pR8fSmlJyRUxiruLvLIj1/zodD+xtfW97z+QaW+eZbiTp6bz2YbLJPo5CJIU91kTlvuH bWugm8+xXShpS86nj7BS0DIVvSGl0c8tKVqNxiWXZ+2uNjQIOiG6P3VQJ5WAR+0bewpI ebre7M0JHc1HPh/QRYHr0tINwwpfRBSr6tLfGBAQzZ0Y1Cb6VHccqjthoJDZ4DcFcXEx Abso1KMulqIOCox6Y0LfAYX8C9zym2nbixfS9ZdIhJMHmE2eNsJuUT/vRahVPwHutzb5 rrQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:dkim-signature; bh=KGBG0nLcaqVCaoLHEF9OcE8CPFbuG5tHdTJ9VqGf1L0=; b=HJcJ1MOmVwCA6Zak05u5fwuLOwwHHx0TbYEzkhmGCLT7BsiG5TL5MRW70kw0jJ23JO n0crqG9pTH0DXuuauJpot+PBz7zfYsv3qEmNI5UUvcbhFcAukvvcpaKHRJA2cUTp+eFA F3ODN3QFOw8ssQ6+Yl3wVLtQKTfoD4xbSBnQCGctl9sKjm+N1rhOqy+KAt4prsSsMptT n+80QyHyggU8A8Sy6FawDRJiT/QaTl+jzza7Ao6VffVQoIP48jZyCxjRWyQglOdNJk8E N3qFqOqQZvuwOgU1y8DaGZK1W60b+0S8+T4NKIwyM8tFoo/DfoapprZi5Y1c61de+y8I yI8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hu+i4tsv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r27-20020aa79edb000000b00593f89f0efcsi14760838pfq.269.2023.03.22.03.07.29; Wed, 22 Mar 2023 03:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hu+i4tsv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjCVKAi (ORCPT + 99 others); Wed, 22 Mar 2023 06:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjCVKAh (ORCPT ); Wed, 22 Mar 2023 06:00:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00FD7F0 for ; Wed, 22 Mar 2023 02:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679479190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KGBG0nLcaqVCaoLHEF9OcE8CPFbuG5tHdTJ9VqGf1L0=; b=Hu+i4tsvwQyzCgeZNfWeVQAr+ajXOVsiloEF5Vpo5CexHbPByAzv9VcLfpZJmJxwiFXWZH 9r1yNMGP8tYkTYMEWXYfzGjQJ2VvXufCNPEbpENToo0G0umzMdI25lkv5uh0HbNKQ23RrT 4YEHf7GdK9hnjwAVeSP921RNA2nrbB8= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-c_En73GbPcWh0PLCQtlwBw-1; Wed, 22 Mar 2023 05:59:40 -0400 X-MC-Unique: c_En73GbPcWh0PLCQtlwBw-1 Received: by mail-vs1-f70.google.com with SMTP id r15-20020a67c30f000000b00425dd7c582cso4734712vsj.22 for ; Wed, 22 Mar 2023 02:59:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679479179; x=1682071179; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KGBG0nLcaqVCaoLHEF9OcE8CPFbuG5tHdTJ9VqGf1L0=; b=U3xUUqW7QS332WH1b8aCvSPW4BugUsjzetn6M1XvnigmtkGKqvkqSq/y9ohPCN8ymT rJXbUz89HGULRO/cgDxM7/gIFsshBjHg+PCQpLPjClOR+NiWr0Jr0RWLAiogxcZ4MMpt qhAvp+4yQ6FugdC5FYpK1S/s8MiuvaSeBo14AdcG52FlpLg/EnaGQyDXgQCBYVEJN4l4 YY05AVo+Xuy1SrAd8wAsEizpdKYR3rRaIGwdiXIG3PY5F08rwI+J0X6Ya6no8zYV/JVn EEDmoYJHP2UUNlSTONOaUnXztv0y0OriJYrFIIKfkwQhz8YtY8gAh/8BhosMfbYztAHR uKBA== X-Gm-Message-State: AO0yUKViMkKIYPXHNOBmGESZ0O0iuJtL5EZhhJO0GnazxKErzzFdkfTu w0RSy3Xhfu12vsaPrmLXI4todqvC+JZ/+ZuVSGiFcb0mVQUXlirkCqqht92dzVXHsPAc/Fl/+3J LTblOQYibxwKQxz8RTXx86F8F X-Received: by 2002:ac5:ccc4:0:b0:40f:42c7:25f with SMTP id j4-20020ac5ccc4000000b0040f42c7025fmr2447924vkn.0.1679479179588; Wed, 22 Mar 2023 02:59:39 -0700 (PDT) X-Received: by 2002:ac5:ccc4:0:b0:40f:42c7:25f with SMTP id j4-20020ac5ccc4000000b0040f42c7025fmr2447911vkn.0.1679479179273; Wed, 22 Mar 2023 02:59:39 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-244-168.dyn.eolo.it. [146.241.244.168]) by smtp.gmail.com with ESMTPSA id i13-20020a1f9f0d000000b004365a349a03sm1140018vke.7.2023.03.22.02.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 02:59:38 -0700 (PDT) Message-ID: <889f2dc5e646992033e0d9b0951d5a42f1907e07.camel@redhat.com> Subject: Re: [PATCH v4 2/2] gro: optimise redundant parsing of packets From: Paolo Abeni To: Richard Gobert , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, dsahern@kernel.org, alexanderduyck@fb.com, lucien.xin@gmail.com, lixiaoyan@google.com, iwienand@redhat.com, leon@kernel.org, ye.xingchen@zte.com.cn, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 22 Mar 2023 10:59:30 +0100 In-Reply-To: <20230320170009.GA27961@debian> References: <20230320163703.GA27712@debian> <20230320170009.GA27961@debian> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2023-03-20 at 18:00 +0100, Richard Gobert wrote: > Currently the IPv6 extension headers are parsed twice: first in > ipv6_gro_receive, and then again in ipv6_gro_complete. >=20 > By using the new ->transport_proto field, and also storing the size of th= e > network header, we can avoid parsing extension headers a second time in > ipv6_gro_complete (which saves multiple memory dereferences and condition= al > checks inside ipv6_exthdrs_len for a varying amount of extension headers = in > IPv6 packets). >=20 > The implementation had to handle both inner and outer layers in case of > encapsulation (as they can't use the same field). I've applied a similar > optimisation to Ethernet. >=20 > Performance tests for TCP stream over IPv6 with a varying amount of > extension headers demonstrate throughput improvement of ~0.7%. I'm surprised that the improvement is measurable: for large aggregate packets a single ipv6_exthdrs_len() call is avoided out of tens calls for the individual pkts. Additionally such figure is comparable to noise level in my tests. This adds a couple of additional branches for the common (no extensions header) case.=20 while patch 1/2 could be useful, patch 2/2 overall looks not worthy to me. I suggest to re-post for inclusion only patch 1, unless others have strong different opinions. Cheers, Paolo