Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1275542lqh; Mon, 6 May 2024 02:37:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/p/NLbbXofzP4/a20RZv2/1z64DDO22PSdBIEHo7VpTJxTHNaV+7LxBrTJiiOqSFpb8AY/UmbxvfnHpiOIyRNADAYv8Knvk6AvVLB9Q== X-Google-Smtp-Source: AGHT+IERaHriNC2EXBy1X0axMU+hCeP9lN1td5tI0yimnYRSDy8l6ZTeQxxcT30myL/mJ7IMi+Kq X-Received: by 2002:a05:6808:1b06:b0:3c5:f919:4267 with SMTP id bx6-20020a0568081b0600b003c5f9194267mr13364921oib.47.1714988245600; Mon, 06 May 2024 02:37:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714988245; cv=pass; d=google.com; s=arc-20160816; b=hq2ok1R7wzgn12gYIDnqRCvtppnxWFGIgJSFOYBREnQpcPnV+0XwhO9mFK2ZrMwlFZ rJ4TrxtkNMXjv6NQW3pDYRuhXn8GKjkhl68c7t2H8bKIPKpomJfuxD7YY3vMN2uFRed/ 1VtXWD3zaXNSLT6zlpRUpsu/wbDJvQ8CiCzshrzRnbcmHKuBffwYCwpgQXERr/au1bLW HX8WWKh5I9tQAbTq3HL5ZjPlpupdcUJ0A8RUp6OX49WO1qO4JaBqY+DovDVlJvLFl+nj uwwkjtSzixFAbDD09ylMn++rOVgZ+o6jztRrQmZfZDUtctXd0cj11u1V1PVsNCNUuY6k MewQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=UFC6StoIxDlALEXd4nLUmHSyf9IY2MMtGBaOD7tAdoQ=; fh=e97LNapj5M1Jx45W60qOPF53hiM6/fyR5Tyga34mGx8=; b=C9ZdegLtwIqnOlD5tnKjgl5zuGNNj4fjy6C7sz1YiszUwF+bu5kk30zcuHKU1ooIBB 9dNbBesUCaITf02rHE3t907EH69k2gYd7tJpVqwraPbWbaiUyE1ich0TBhpldXdtExod td9U22lx330ETP2RSZGpeZ0LzUBT0af2SkSNNG5PwrAs1RMdy+uG6llJauvwuK50h0jC Tc3O+PJ8MwnZJaeoVxV8SVIqhMQUiIsrmuwIdok2y9qqyEq/0OBgFldwOi1WHvUJQpAT qciRAeaqZB0KiG09E5VFxnc4cYZOh1epyqydWCmPfnsKY+xSuA4zOE5cU2VWrZgUgXsW 7uUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AuNrdVqT; 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-169580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x16-20020ae9e910000000b007929ead1586si678134qkf.750.2024.05.06.02.37.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169580-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=pass header.i=@gmail.com header.s=20230601 header.b=AuNrdVqT; 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-169580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169580-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B16EC1C2200B for ; Mon, 6 May 2024 09:37:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89B1014264D; Mon, 6 May 2024 09:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AuNrdVqT" Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 17BA11422DF; Mon, 6 May 2024 09:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714988192; cv=none; b=MbOZu82Ij108xGZ8dthr7ccjslVZCl58b2XFbldSLzCpY0sGlh56m4gqX+3xM1YunmGGV2c+I0QEdU+n4ldJAdOnuG7+junCn/rMxsw0PLUYZBYALtCD70Mr86w8HegDZCn48qXVLbYpdSDJAsRWXOVmv+4HXd2m5uStmv2cue0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714988192; c=relaxed/simple; bh=7R8HvbMKxhvQTD+6WjeeyIDykaL5AbTSf5Sm3F3g0MI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=AUZjCUfAn8QZ1QVmOo7BrOqcDw+zFNFXfb8DYLvsVhfCpUXBcDSY23o7Vhm5sBsclOHX7kcyGI4CQJRNy/rZxNP73vkd1YIzOj5mSZlayu2aW2Ea0HmRbYh7y949JmUDo4X09a95+98CGTcl7ALGg3Csc4oB5/LjvQBmlh0NoAc= 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=AuNrdVqT; arc=none smtp.client-ip=209.85.221.48 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-wr1-f48.google.com with SMTP id ffacd0b85a97d-34dc9065606so876781f8f.1; Mon, 06 May 2024 02:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714988189; x=1715592989; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UFC6StoIxDlALEXd4nLUmHSyf9IY2MMtGBaOD7tAdoQ=; b=AuNrdVqT2UmBFWV0VaJLAudIHJ70EEfhZ2ElqRSmC3mAi0ItloQVDDDZ5lPv7/j0ZQ FpxXhLy25ioz8ZMCua+6oGWfrZkq410waAtf8SWCSLqaFkhmjyQDG5Yc71Z73ncUnut4 YlM5MZortfqceTl6h0uJPV/ndquTjaHJWg9pJZwcxGvGnGRSWqvDTA17FhwrwGr7K94i 2c9LK9RcP6y1BaEPqS3Dzt98xCj2zoIGY2A5S2d7e1FiNzuBB6RswfkyGz+2CJqg93qe LnqCHLMupeOCN7etatDtNZqMkSRSApjf11ojmeLl3r9OAlZfhlDtKBYqlkl5vSwV/Z09 IvDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714988189; x=1715592989; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UFC6StoIxDlALEXd4nLUmHSyf9IY2MMtGBaOD7tAdoQ=; b=e5mdci64GvQWC+2wJpNE7JzpQsXpMRbe/+2y+imXpW62FTRyJDuc5/kqkJD4Q7bLom yjpP4DFlzWA1ScyC0Hz+wCMJ3hh1tLV8r4LPIxq/GQksr0pD8e71fgi5Hy2Sw71MteX1 wFDlX0CPrhXjdxZtb8jDEx+L1VxzTGoFBdIc22aSy2Rz3zp5GmvGd98tNmaao/Dmzd87 MV+z9GIlxdhXUSMdGB6qIDvKpncrh7AszAzvgNpPSs2evwSauDYL15yk+8JPYraFIWzt OgXfugkI1qFHvL/xE6DCPUXF4wz2max+2CdBHCnKkM2FjBjCR3ZiwTeUkHF15WrS4IW7 e0Ig== X-Forwarded-Encrypted: i=1; AJvYcCXSBgnqsjIGjjV2xbugysKY2zojw2cFIiBq/Z+kh0JSEBSrBV0TXoC74E2z5RSJl0zI2N/ejy3egl9C1dX8bWc3bmARoMzoCJc6VQKvi9YL9sWYg6XAzbVB0NRZVsnEKLuEVuEHvzstSQ61CoTkqPrcYf0EMHb8lP6gwzPsRWBbp1hCd0dW X-Gm-Message-State: AOJu0YySFE6y6BQlCOJ+GSQ9wdqN9F3xPEBp605TgnDvJHeTsiZbzBrm ZhLHDw5iUii8BUhnZv7r0K1YlFtauZB8AHDFh86lgc5G5+t1cXld X-Received: by 2002:adf:b186:0:b0:34a:6fac:6dab with SMTP id q6-20020adfb186000000b0034a6fac6dabmr11603134wra.12.1714988189159; Mon, 06 May 2024 02:36:29 -0700 (PDT) Received: from localhost ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id m7-20020a05600c4f4700b0041b434e5869sm19100938wmq.43.2024.05.06.02.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:36:28 -0700 (PDT) From: Richard Gobert To: davem@davemloft.net, edumazet@google.com, willemdebruijn.kernel@gmail.com, kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org, alobakin@pm.me, shuah@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Richard Gobert Subject: [PATCH net-next v8 0/3] net: gro: remove network_header use, move p->{flush/flush_id} calculations to L4 Date: Mon, 6 May 2024 11:35:47 +0200 Message-Id: <20240506093550.128210-1-richardbgobert@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The cb fields network_offset and inner_network_offset are used instead of skb->network_header throughout GRO. These fields are then leveraged in the next commit to remove flush_id state from napi_gro_cb, and stateful code in {ipv6,inet}_gro_receive which may be unnecessarily complicated due to encapsulation support in GRO. These fields are checked in L4 instead. 3rd patch adds tests for different flush_id flows in GRO. v7 -> v8: - Remove network_header use in gro - Re-send commits after the dependent patch to net was applied - v7: https://lore.kernel.org/all/20240412155533.115507-1-richardbgobert@gmail.com/ v6 -> v7: - Moved bug fixes to a separate submission in net - Added UDP fwd benchmark - v6: https://lore.kernel.org/all/20240410153423.107381-1-richardbgobert@gmail.com/ v5 -> v6: - Write inner_network_offset in vxlan and geneve - Ignore is_atomic when DF=0 - v5: https://lore.kernel.org/all/20240408141720.98832-1-richardbgobert@gmail.com/ v4 -> v5: - Add 1st commit - flush id checks in udp_gro_receive segment which can be backported by itself - Add TCP measurements for the 5th commit - Add flush id tests to ensure flush id logic is preserved in GRO - Simplify gro_inet_flush by removing a branch - v4: https://lore.kernel.org/all/202420325182543.87683-1-richardbgobert@gmail.com/ v3 -> v4: - Fix code comment and commit message typos - v3: https://lore.kernel.org/all/f939c84a-2322-4393-a5b0-9b1e0be8ed8e@gmail.com/ v2 -> v3: - Use napi_gro_cb instead of skb->{offset} - v2: https://lore.kernel.org/all/2ce1600b-e733-448b-91ac-9d0ae2b866a4@gmail.com/ v1 -> v2: - Pass p_off in *_gro_complete to fix UDP bug - Remove more conditionals and memory fetches from inet_gro_flush - v1: https://lore.kernel.org/netdev/e1d22505-c5f8-4c02-a997-64248480338b@gmail.com/ Richard Gobert (3): net: gro: use cb instead of skb->network_header net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment selftests/net: add flush id selftests include/net/gro.h | 75 +++++++++++++-- net/core/gro.c | 3 - net/ipv4/af_inet.c | 45 +-------- net/ipv4/tcp_offload.c | 18 +--- net/ipv4/udp_offload.c | 10 +- net/ipv6/ip6_offload.c | 16 +--- net/ipv6/tcpv6_offload.c | 3 +- tools/testing/selftests/net/gro.c | 147 ++++++++++++++++++++++++++++++ 8 files changed, 225 insertions(+), 92 deletions(-) -- 2.36.1