Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2875487lqp; Mon, 25 Mar 2024 11:41:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDcUV2MnW1bjqKvG7+bfvgoTLcVYGXHnO2Blp1QkRH5oPL3hMUcJXwVF53crYcfxGnZoyq23PYan0D+fI58ZwRx3vao1G8uKrfPf0NpQ== X-Google-Smtp-Source: AGHT+IEIzH5wI2ZOB3aH6RdAywi0nZi70KNGJUWhn+zEQstVzYuaVv8MyKFRXg1cC/oF5B3p0LUu X-Received: by 2002:a17:907:7892:b0:a46:c8d5:84c8 with SMTP id ku18-20020a170907789200b00a46c8d584c8mr4924819ejc.38.1711392060319; Mon, 25 Mar 2024 11:41:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711392060; cv=pass; d=google.com; s=arc-20160816; b=DNVSAXLpoJuSqZxDJjRDMNM1nVo18ihVLFIg8wb0UjFvTRO0JvIM7PPV1eH3/p/JGI mQWEMlKCJVF1XYswPbw5lnageeNISfL4drKh4Q4xTXBI8naIN1WsCRQJncr8ttNANC6q HGEGwknxweKEhSNV19RG1YVrOb+UdYPM2brHJJJmVjeoUHLa/cGVOsTPnJ+bwfKmuOU4 +lHN+k6spiZWF2NHOXOmc//iSPTeEuIAyDvBJdQQu/1fhOBk9eu6y0Qp0HsvvchrYeEN 9Z9X4Se/hfQYbueIsepOKsQ/dlASd6gEMOwvOw/J6R0GoP7lqRgofgCfu+Nr/EzCHmpL sJ3Q== 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:to:from :dkim-signature; bh=olLxRakxTUSwwI2bXiG7lgWcNd9XDiHnHMSgPu9OGUM=; fh=cUrYv6BKoCMulNXsm+gsI/ggBK87KRs2HW/EthicwzU=; b=gHU47BBcniwZpbUI7se6kXo+Un0O72cwZ/v6656GGW1/cgaeqLneoTIK28Vi0j5a8s LrD/mtTPgsbPtKik9lOjmDf+KpIFWN+ZPDu4njM9k0SUKyBvbrYLeL+n4I+Bhx1N08i2 g4DLtkG/810x8PhmNo/izZYyswy7pwQJ1XWf9Ni/UT+yX/C2mmLhHVkBKpDuLxlWNMTO 6qjOUsfjr/jDDbRRi0YbeVHqVnkYhl67YBoZ+EnTZiOxbjZ0MwEhLJ8gIYm0Jp9+ap1M bK9o9dFo8gibfvQRew6+4HQpgFLzSAePcaEkzKQjZdiiD732Pev+RERxiUGEfawWhJk9 oTiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y9O+uwX7; 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-117701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117701-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 k8-20020a17090666c800b00a4748c79a59si2199010ejp.422.2024.03.25.11.41.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 11:41:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117701-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=Y9O+uwX7; 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-117701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117701-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 DF36C1FA4859 for ; Mon, 25 Mar 2024 18:40:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6EA473509; Mon, 25 Mar 2024 18:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y9O+uwX7" Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 2BEE212E6A; Mon, 25 Mar 2024 18:26:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711391207; cv=none; b=KTm/M8LlaWjX/L3qL+GCw1O1HDzACKWZgzZ6bfCUomG51a19ClVC07QqebQqNEkFa8ktqAg/TheCi+YFLhv/2dz9QANFD58Obo+8HcxuNC0ITXk8g6THlw1UkoZyK6H+VzcERS86Y0SKrFqBhhjYUXdsbMAOHyJXAttX/Xamg+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711391207; c=relaxed/simple; bh=alToMwgx8F4x0ok8bQUuFA0DjFg6nUSwo0GbUNoR+Y4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Yh0CE/i4pCHxJNo6GFYq5z+dIqJziF9JtQxDFYHSW27ZFfWT81S8P9BWm7L1ESwjfRD62wPqr86WSeD6sCycwkZoyQzB7cHZh2wrp4EHvv4cqHbFOFQdjBTyYsae5ENrzAhkBoxxRO3HG49qD1I5DPH/fNz6maysr3eFGyJu1DI= 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=Y9O+uwX7; arc=none smtp.client-ip=209.85.208.169 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-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d52e65d4a8so62254541fa.0; Mon, 25 Mar 2024 11:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711391204; x=1711996004; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=olLxRakxTUSwwI2bXiG7lgWcNd9XDiHnHMSgPu9OGUM=; b=Y9O+uwX72Qh9SYkInPsX1u6sR5p44/JwT5JVdyE7YmbewS42Bgwi4S6B5OuvoPP2MA K1a/PHgbIa0f//GskYXchrYxRJhYXcVxeziyXkimMPtTuRS64AdF2sofUFoPDRvjEQ8U UGivsw/xM2tY2PcqwAfzqiLZuPzEJ5Ispfx2Y5hs3cTSjJ2FcfXxOmrK/EQ3GiNWqkD3 EfsAQV9G2aoRx3KYbtnYJT2kQRLJBg/3GpXmr0D+JwlDExXcYlQWc8gvcXgULEIBDBCr dVYxPlv7BtgzQl/iy/kV7+ygxXfwX1Urywcip+GPkf+uMgtp8Ab0Ub7PCqTQW7Og3vjb esEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711391204; x=1711996004; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=olLxRakxTUSwwI2bXiG7lgWcNd9XDiHnHMSgPu9OGUM=; b=YW9/Xp53iTrzowoPiAJcfjrpmXJVYLON9gUcT4uELnl56KQDEZL4vuTvpyt57GCFaO kvUDFEAgF6lKpFlyNBWW0UHzrLywDoRpSERkL/LVGTL0LRd2C6BRc3ueTPIcnwu26Ahm kli06fGo+QnTbYSoEySxSipXJf1gbFQljBgCA4SBrDH2YtSNVXAWXS91YAVn64tDS6NW d8n/tA21ljQ79ZUG4MWDbX7W/lacsV35iDmH6IUyroFBcxqbyvfW95FxO78pkjj80osI prgPjDVjtNAFnF2k/kbJKPs2R7vqIE84h3PhmTUocQvVgdncSaSd9D23utPsceNlfc1U CoQw== X-Forwarded-Encrypted: i=1; AJvYcCU7zOgV+sScWVlds+ZApMr5Yx1jl9GuWPa0bAYVORPgAOIF29uTaG1Su+z+8XA1enYqWve2JV8AMR91DJwDSPbUBBteT9c2XkYoRLk8Jm1agS5HfnTzvN5TWOGb0NjfMsPVrlpF/3t0M2WFIfKHFMAfa+isqRkrWpK1rTIRoi5gB3AOQTRG X-Gm-Message-State: AOJu0Yy3T2Hvr88df2mnwwU+Hov6Tadju2EBfQtBW9dSp4zq/5YaHBr8 pA1r7I3DR82DdBaMsljZjnxDY8ZDTAOGGBtdPi/NQ9wz26UabG3L X-Received: by 2002:a05:651c:b06:b0:2d6:d9cd:ac8c with SMTP id b6-20020a05651c0b0600b002d6d9cdac8cmr2496722ljr.43.1711391204062; Mon, 25 Mar 2024 11:26:44 -0700 (PDT) Received: from localhost ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id m9-20020a5d4a09000000b00341bdecdae3sm7954758wrq.117.2024.03.25.11.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 11:26:43 -0700 (PDT) From: Richard Gobert To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, willemdebruijn.kernel@gmail.com, dsahern@kernel.org, xeb@mail.ru, shuah@kernel.org, idosch@nvidia.com, amcohen@nvidia.com, petrm@nvidia.com, jbenc@redhat.com, bpoirier@nvidia.com, b.galvani@gmail.com, liujian56@huawei.com, horms@kernel.org, linyunsheng@huawei.com, richardbgobert@gmail.com, therbert@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH net-next v4 0/4] net: gro: encapsulation bug fix and flush checks improvements Date: Mon, 25 Mar 2024 19:25:39 +0100 Message-Id: <20240325182543.87683-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 This series fixes a bug in the complete phase of UDP in GRO, in which socket lookup fails due to using network_header when parsing encapsulated packets. The fix is to pass p_off parameter in *_gro_complete. Next, the fields network_offset and inner_network_offset are added to napi_gro_cb, and are both set during the receive phase of GRO. This is 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. In addition, udpgro_fwd selftest is adjusted to include the socket lookup case for vxlan. This selftest will test its supposed functionality once local bind support is merged (https://lore.kernel.org/netdev/df300a49-7811-4126-a56a-a77100c8841b@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/netdev/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 (4): net: gro: add p_off param in *_gro_complete selftests/net: add local address bind in vxlan selftest net: gro: add {inner_}network_offset to napi_gro_cb net: gro: move L3 flush checks to tcp_gro_receive drivers/net/geneve.c | 7 +- drivers/net/vxlan/vxlan_core.c | 11 ++-- include/linux/etherdevice.h | 2 +- include/linux/netdevice.h | 3 +- include/linux/udp.h | 2 +- include/net/gro.h | 36 +++++++---- include/net/inet_common.h | 2 +- include/net/tcp.h | 6 +- include/net/udp.h | 8 +-- include/net/udp_tunnel.h | 2 +- net/8021q/vlan_core.c | 6 +- net/core/gro.c | 6 +- net/ethernet/eth.c | 5 +- net/ipv4/af_inet.c | 49 ++------------ net/ipv4/fou_core.c | 9 +-- net/ipv4/gre_offload.c | 6 +- net/ipv4/tcp_offload.c | 79 ++++++++++++++++++----- net/ipv4/udp.c | 3 +- net/ipv4/udp_offload.c | 26 ++++---- net/ipv6/ip6_offload.c | 41 +++++------- net/ipv6/tcpv6_offload.c | 7 +- net/ipv6/udp.c | 3 +- net/ipv6/udp_offload.c | 13 ++-- tools/testing/selftests/net/udpgro_fwd.sh | 10 ++- 24 files changed, 187 insertions(+), 155 deletions(-) -- 2.36.1