Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3490087lqp; Tue, 26 Mar 2024 10:25:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMk+i0cPnuB+OAOfUyQaqj4xSy+MyfJlBdzUpZc3uSm1NCgukCJ/Ng9VjBG88plg2S3kh7+xMdoC96GF0M1chpR/Vy72/VQ/0MFq7TnQ== X-Google-Smtp-Source: AGHT+IHIhDSDnb26DMdzpBbO7lDOlEDjrEJO0eQqUFfbbXF9FxDlm+hYUKlBFFkxCmU/VUe6OL2E X-Received: by 2002:a17:906:1c04:b0:a4d:f999:de26 with SMTP id k4-20020a1709061c0400b00a4df999de26mr269026ejg.1.1711473926772; Tue, 26 Mar 2024 10:25:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711473926; cv=pass; d=google.com; s=arc-20160816; b=GZProlja/PBBM7Cz1SwT0PXBIcIx4Tds1KQb17j1wVHTNCptbJkiCa/Ye39NNiB8f6 opBzqXZ27ckLd32sZOysM06I4UolYst1Ciq97qJVRBhd5v7P3czo+gaA3OFFZERdpqJZ lAq5jn9YTL2o9sb0lHHgX2JB8BbMmQLmUJhF1/w6TrArZmonSI614ZxIb3IyRnZLqzWl XgG8lmEngvztIz4F40Jnnor4EHKBcoxKgZUQHzDDGRZC2i2rPtYyU434Wy+tEkS2BaM/ oSLbIy91C3mthNeMyUxGdXJ3a041BjejhuR2l5CmT2Pt4ps8vehCvZ3z98Ze+zipV4fe rU5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=gIUgf1B9/y9K/vRu24Pisue7YbENj34ko6OOe/V8jiE=; fh=66+McVmcdmC/TYHiic987fpGeBv8XgNCx+gb4rKj4KA=; b=CMJ+3l+UxCf3f/bfVi83BZevhnKuCFcUX/wwioWTSqY7KocuYYirnc13c8mtF2v+lD DlBWvimIvAujJLva/LiEF3dc8esHSwXzOJEntJ+1nYYD86fqJTWP3bjHgSqkkzrHdf0e yNc+RpQ27S7lG+peo6E+dIT4rAYswFPgGAXlHvslbWH/yqyZNW38i7LGzIyy9WqA4m/S Ui41HA+e7sEBZ+JEE8fu86Ga2ilORDTYviahJnSe0foNZwafxFQ+xDT42uvO7miJLrEz 5UMKRsHjB1EcS74zhscK/44BrINifSja1xwFLsVkBH3PXx6Q2Xt90YZIOx7HrJVYQdzP SbRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UkuZqFgt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-119583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o15-20020a17090608cf00b00a4df4a66d72si746357eje.482.2024.03.26.10.25.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 10:25:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UkuZqFgt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-119583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 7CA9B1F837A7 for ; Tue, 26 Mar 2024 17:25:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D943C1CFA8; Tue, 26 Mar 2024 17:25:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UkuZqFgt" Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47A1B1F941; Tue, 26 Mar 2024 17:25:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711473916; cv=none; b=ppb5IPyCoILx5YLMRfnFBaVIrB9+IhRrOxlrxlqDnzUJP4P48GhlxRKK3XZaoRpuU8DDEV4U5rMCUT1dFalNUv7HeTuK5dNmVairmKN5oduOaXWE+2JK5upvlXqiu7C5sJQzBqbBiEV22n3oj7pvXZAA9VyH4yZ20C/tHo8deyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711473916; c=relaxed/simple; bh=ouExxAnjMIsGwW4T+Gq7Ao5GRlfTuNgYV0PeftFLR90=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GWsC1OiinkByOWTX0714XIrdgSsxR6Yjtxl6O6vvjxS6bHImKzAJTnY6rWJaltcA9llcs8exliXSWHift31A7HhUP1WGSirI/SgNBC6FrMHFwvc6s0a11tecuIkO2hnLGuWROgPuvY9f1kI6X7TYIeiInOwIy24g9jCW/zwoi/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UkuZqFgt; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-414866f92beso16806445e9.3; Tue, 26 Mar 2024 10:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711473913; x=1712078713; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=gIUgf1B9/y9K/vRu24Pisue7YbENj34ko6OOe/V8jiE=; b=UkuZqFgtdTI/F7xmhgzjDC/VZi4iw7qJBNutXRTMfDAde9m0GnIuIunITpjdgfW2SJ 2r1W9mJl4U8Qcwn/dWSqv91QbZnF+sUgh6E8U0WGsi6CiXunWW49GjEnBIddMymG9Nw0 2SQUT6I973VNaH/deaBnwgd3e6tpBxNWCt91GTVflYUE9CtSy9iNJERL23u4Uzjh3gMf JaSj1gp/GOmrQpeaE/YtWYz+zIy2plIZae37FtfiKJsbq5UTRnQuVSmSrqlda9EO3hkh qfOo4J+UezKw9kqd+toy9gMxkk10YyIneF72/36o3oOJwp3ODQS9Ey3X2oskAxoci8sv 3i1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711473913; x=1712078713; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=gIUgf1B9/y9K/vRu24Pisue7YbENj34ko6OOe/V8jiE=; b=A83FEZylQDiV/t0RaazOsIjyL1i8fCeetSv/Mk+BU2X2hjqPkhW5WBbJhDiwtTZhym c96jggGGah3mzM/DgUJ0O4Rx/9BjG/G8AnQPJ4VKgOuFru96soRPheOtA4cLqbQ8DBd7 KUCZX851T0JoyoOOTr0reGuQy/7Ea1Q44gzW5V+Mk6EKHzLUUGCSKrAQdteu4b/Ki0Yk KOtpC+79qGqP9Yp8Ea4SZeqz5r4kssRZWVL0EdNARR0YVPth2px1SNSssDRK0LJ2oM2y FFMrgMdNcnAnMl5FsfbX52bmecvbUC7dfJBXC3CKpFTFRXA4mGL2ckmAJJlidgj+O6OG olXQ== X-Forwarded-Encrypted: i=1; AJvYcCWcWem35aVIse9BRlQFDjS6V602DQ3UGiuhQqK1pdbQqxw1UKw/eI5fRPnuCvZqInBvJsYgXYD3mQ0XBDCCD3TD9M/fd8qJ6RG/dI957X13yBhuiG8PtO3l6fC0BBL6AMFmttLt47cCB7+GJzx66Ojz3zuc46B2zelvYgbkjAOMkCCqLwJf X-Gm-Message-State: AOJu0YzPFEQXYcl6Og8rAlre1IuhUBoxJjOOk8uKppabqyQga+DM1KfR Ac0xI8ksRrtkkYWvqDZGNz4Dh4dzJ2RH6kCD+7apziY/i3LxFHz2 X-Received: by 2002:a05:600c:4f51:b0:414:9141:1461 with SMTP id m17-20020a05600c4f5100b0041491411461mr157359wmq.29.1711473913398; Tue, 26 Mar 2024 10:25:13 -0700 (PDT) Received: from debian ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id t12-20020a05600c450c00b004148619f5d0sm9341052wmo.35.2024.03.26.10.25.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Mar 2024 10:25:13 -0700 (PDT) Message-ID: <57bf675d-c2f0-4022-845c-166891e336be@gmail.com> Date: Tue, 26 Mar 2024 18:25:02 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net-next v4 4/4] net: gro: move L3 flush checks to tcp_gro_receive To: Paolo Abeni , Eric Dumazet Cc: davem@davemloft.net, kuba@kernel.org, willemdebruijn.kernel@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20240325182543.87683-1-richardbgobert@gmail.com> <20240325182543.87683-5-richardbgobert@gmail.com> <46e0c775-91e7-4bf6-88f3-53ab5e00414f@gmail.com> <6566fd5f-fcdf-4dc7-b8a2-5e8a182f8c49@gmail.com> From: Richard Gobert In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Paolo Abeni wrote: > Hi, > > On Tue, 2024-03-26 at 16:02 +0100, Richard Gobert wrote: >> This patch is meaningful by itself - removing checks against non-relevant >> packets and making the flush/flush_id checks in a single place. > > I'm personally not sure this patch is a win. The code churn is > significant. I understand this is for performance's sake, but I don't > see the benefit??? > Could you clarify what do you mean by code churn? This patch removes all use of p->flush and flush_id from the CB. The entire logic for L3 flush_id is scattered in tcp_gro_receive and {inet,ipv6}_gro_receive with conditionals rewriting ->flush, ->flush_id and ->is_atomic. Moving it to one place (gro_network_flush) should be more readable. (Personally, it took me a lot of time to understand the current logic of flush + flush_id + is_atomic) > The changelog shows that perf reports slightly lower figures for > inet_gro_receive(). That is expected, as this patch move code out of > such functio. What about inet_gro_flush()/tcp_gro_receive() where such > code is moved? > Please consider the following 2 common scenarios: 1) Multiple packets in the GRO bucket - the common case with multiple packets in the bucket (i.e. running super_netperf TCP_STREAM) - each layer executes a for loop - going over each packet in the bucket. Specifically, L3 gro_receive loops over the bucket making flush,flush_id,is_atomic checks. For most packets in the bucket, these checks are not relevant. (possibly also dirtying cache lines with non-relevant p packets). Removing code in the for loop for this case is significant. 2) UDP/TCP streams which do not coalesce in GRO. This is the common case for regular UDP connections (i.e. running netperf UDP_STREAM). In this case, GRO is just overhead. Removing any code from these layers is good (shown in the first measurement of the commit message). In the case of a single TCP connection - the amount of checks should be the same overall not causing any noticeable difference. > Additionally the reported deltas is within noise level according to my > personal experience with similar tests. > I've tested the difference between net-next and this patch repetitively, which showed stable results each time. Is there any specific test you think would be helpful to show the result? Thanks