Received: by 2002:ab2:72c5:0:b0:1f7:f6a4:354b with SMTP id r5csp96178lqm; Tue, 7 May 2024 09:37:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPLvARgT4oL+OhqJ3iUEr8ZiPIZ/1gZx6hvBKazcKek95b++2LeL250pteszTZpxJSWOPLMh/yFnYTFHOh/e7tvUaEdNZUVdlr1urMDQ== X-Google-Smtp-Source: AGHT+IHmI8+LqMCu6HEhc6CrEz+s9bdgbhW9Szds8QnvzTIBwi3cU7GQpFDrG+r8RyRaL/jFE7lm X-Received: by 2002:a05:6a20:f393:b0:1af:667e:fe41 with SMTP id adf61e73a8af0-1afc8d1ab80mr254654637.5.1715099861402; Tue, 07 May 2024 09:37:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715099861; cv=pass; d=google.com; s=arc-20160816; b=yROFDn4nyOjl5yexjMEW+r1B+FhvbDgzlFa5ElcGTW9U2EfoHE7quPrYQpmNxIgzCK 2jqi0GshCE05Oy9IfLQ8Wx10UQZWzgkDriDihhN7iJnJHZ9qwweE9bvTHk+4YyVSMH/z GAA8cjGnSGwLt/DV31fzkxFUK6FUCzJyM3tasVpWkF7kDc0FT0BlekYDR/n3ncR3WNKm OTnZzSjowB4NQ2IgsXUZskfiunzfpkvkdqdkG+qDOD52M0E8kI0m30XgyvE1vO/2nyFK nTl9vI2pkCZ8F+hRh4ezwHoDjpGVcuENUymF55nIbaAY3EWnhntAyR26VCzgdvX/5qm2 pQNg== 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:to:subject :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=C5z8V18Dnpirc9fyyvyciAXH4sAcfELurWsmbPRhXHU=; fh=wKF+r2KgNcBQBChHbi44Yp7jNX4lDzAmoxBKVr/3NNs=; b=aRcErXgzUfpS9qi+lC0jNGhCfpLwbV2dY1070S4Uv1bh0iFCOqsGk6fOdlrsFnJFnu 2tIVGjx9R0GvfFs0wNDj3C02g4aXfyA0TLTSxWMaXjXKUgaQzq5rytm/8ZoWArN4jVSe ZBxfO1LD1W61sWS34vGFtv9V2avnM7XE31YxFV4gvr7e7elvzfY5gG8GGNrobu6uyqfw uWothJV3Y6LEHBste6Esw7dzKPAi8Phn539KmmHurni2yxewRsvxnUV2DJji+kdo3xuk pa6PJNab43f6NePTf4Poa9L5SzEGR8IZiRLK8UaU5F0xAuPtJvp7NWkv9rk3GbrjNujS AijA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="a/R6gQKO"; 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-171775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s72-20020a63774b000000b0061a949b8296si10385545pgc.168.2024.05.07.09.37.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:37:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="a/R6gQKO"; 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-171775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171775-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AB3BCB23EFD for ; Tue, 7 May 2024 16:11:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7978616ABE2; Tue, 7 May 2024 16:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a/R6gQKO" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 2CEAE200D2; Tue, 7 May 2024 16:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715098309; cv=none; b=KaM0P9ha83VhmV0A+RKWdX5bm0LMPvtnBBQZH9WyVYJHQCE/mTAe5WzUO7CPEp28B5QHalyFZaFVd8Snzu0ReQYLUxH7Xye0SKDGXqezB0T0fVG5yiiXibsUpL6yRFLbcrNgrFIr7Q06b5E8tK1YsYkkOjZLJEz9jjymmaN/Exw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715098309; c=relaxed/simple; bh=p6yW0TaG/xM4tyytfh6Oo3G2KxtjO2msTEHP9QQD62Y=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=pI4NQWw26aVD1Kx4yWAuHMZrY2qrZMCN7lQqvlZRQdvllCzYhI6hcq4DTUtn20wpafe4YrVEleeLq0ul9YC39VYAKifzwS6qcVBBxxbDsJdmbA6iizOYisGo68p9E8P1UTR+BHIYgdRnhdGHn+5jGTpkRKbmC1RU3G9+pyUM46w= 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=a/R6gQKO; arc=none smtp.client-ip=209.85.128.42 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-f42.google.com with SMTP id 5b1f17b1804b1-41b79451153so27288975e9.2; Tue, 07 May 2024 09:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715098306; x=1715703106; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:to:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=C5z8V18Dnpirc9fyyvyciAXH4sAcfELurWsmbPRhXHU=; b=a/R6gQKO8p4Ch9bOcDh+wECTwLDb1PZF9aU414NExRzl8TAW88FwROGc80MtnOLFtu ivmPxBv6c8ZssBLbDun3hfg1ZcIxUMWWZcjoNPmOy75pTcWUej4PBB/V5hhhnlhaZmFa CaPV8G9m+jr6ShYSbDtvHoak8AJqq0MNvo1ZTdkgB/W/2HU0anL036TMSQd7FBXwQD0k KMn+FNNAHETl7vCkAhFfevyxn1v0QWc2svQrKNB6Lu90/eyBA8oUTs5Ku/OoNq9CzlPz nz75Rv51JPe5ORE9PK8PftYpWg43t8su1VNovVzsA0MR2qsRG8QrcfqzR5pEMcnRPG+n Rrrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715098306; x=1715703106; h=content-transfer-encoding:in-reply-to:from:references:to:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=C5z8V18Dnpirc9fyyvyciAXH4sAcfELurWsmbPRhXHU=; b=T0dpUH385WRBIrRsD77zKik3wNfSxBEYVgQLXkFIT34/x5/CpRLprCZXkizwSXf1su 6/8ezjcf/HSC4WgihzpQpRPnUInVFPHaFzvFrI7Xh2UEw7PWcAQ4mzdludNN0c5Pq7q/ Szc4Hthwduv0wx1IWSE2+HxZzuRhm1OEcBLYc+/3sJ0++WUAA+u1ve8Ifay6SjX7jMrt +N2TpCX+KQTUx3yoP7lSCj40fmg9vLrvwXtQNSRwiDSp0H4PU8jfKSMkVjZayvn5VK5p 5gJZndTdIFLkh3dCczQfQh7FtKucQEkBn8egu1J99lZopRMJUIZTI8MljHob+rxX84Fe zrPA== X-Forwarded-Encrypted: i=1; AJvYcCV3009LBHBJCbDth2DtiWFZ7BwghCbQlQVvDnDL+X0sDBUF/I/Bc6w9V9z9U+3RuDp/HOVN2MzQc6aLcvM1njvaBDRrO5p3vzmeQIAqWUmjmBqW5ohaNlEUXyIO2HYs0G0KrcIdowuqv9Z899iNcuVRR5dCtQ1zdrnt5Pl/zTZwgXhCW6bw X-Gm-Message-State: AOJu0Yzj5WfqtMlIHU81a4Qx6bEDkYaTaW82ZhjSqteGZ8vYR9mVksHB qs6/C+7NJcpIZ2w3m7d2utLmrS6jb3MW7GyKZSC9IVgElRPqPNc5 X-Received: by 2002:adf:e543:0:b0:34f:4e40:c05c with SMTP id ffacd0b85a97d-34fca42ee4cmr229591f8f.34.1715098306290; Tue, 07 May 2024 09:11:46 -0700 (PDT) Received: from debian ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id h3-20020a5d4303000000b0034f145b60ebsm5929171wrq.3.2024.05.07.09.11.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 May 2024 09:11:46 -0700 (PDT) Message-ID: <47c175ec-2cb0-4262-bfb1-724749624f58@gmail.com> Date: Tue, 7 May 2024 18:11:23 +0200 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 v8 1/3] net: gro: use cb instead of skb->network_header To: Willem de Bruijn , davem@davemloft.net, edumazet@google.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, alexander.duyck@gmail.com References: <20240506093550.128210-1-richardbgobert@gmail.com> <20240506093550.128210-2-richardbgobert@gmail.com> <6639095ab4887_516de294d8@willemb.c.googlers.com.notmuch> From: Richard Gobert In-Reply-To: <6639095ab4887_516de294d8@willemb.c.googlers.com.notmuch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Willem de Bruijn wrote: > Richard Gobert wrote: >> This patch converts references of skb->network_header to napi_gro_cb's >> network_offset and inner_network_offset. >> >> Signed-off-by: Richard Gobert >> --- >> include/net/gro.h | 9 +++++++-- >> net/ipv4/af_inet.c | 4 ---- >> net/ipv4/tcp_offload.c | 3 ++- >> net/ipv6/ip6_offload.c | 5 ++--- >> net/ipv6/tcpv6_offload.c | 3 ++- >> 5 files changed, 13 insertions(+), 11 deletions(-) >> >> diff --git a/include/net/gro.h b/include/net/gro.h >> index c1d4ca0463a1..1faff23b66e8 100644 >> --- a/include/net/gro.h >> +++ b/include/net/gro.h >> @@ -181,12 +181,17 @@ static inline void *skb_gro_header(struct sk_buff *skb, unsigned int hlen, >> return ptr; >> } >> >> +static inline int skb_gro_network_offset(const struct sk_buff *skb) >> +{ >> + return NAPI_GRO_CB(skb)->network_offsets[NAPI_GRO_CB(skb)->encap_mark]; >> +} >> + > > The fact that .._receive sets encap_mark, but .._complete must read > encapsulation, due to the clear in udp_gro_complete, is non-obvious. > > Can you add a comment to clarify this or rename this to > skb_gro_receive_network_offset? > I'll rename that to skb_gro_receive_network_offset for better clarity, thanks. >> static inline void *skb_gro_network_header(const struct sk_buff *skb) >> { >> if (skb_gro_may_pull(skb, skb_gro_offset(skb))) >> - return skb_gro_header_fast(skb, skb_network_offset(skb)); >> + return skb_gro_header_fast(skb, skb_gro_network_offset(skb)); >> >> - return skb_network_header(skb); >> + return skb->data + skb_gro_network_offset(skb); >> }