Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3007813rdb; Tue, 26 Dec 2023 12:25:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEk3opqTdLEbhfVsrkxukEaRGBIIao0hsF9KRcdJaRY3G9jEr1RMD4P39SU1rHlAsI/fP19 X-Received: by 2002:a05:6e02:20eb:b0:35f:e369:9891 with SMTP id q11-20020a056e0220eb00b0035fe3699891mr9740278ilv.17.1703622303442; Tue, 26 Dec 2023 12:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703622303; cv=none; d=google.com; s=arc-20160816; b=kxMIoYTlG7KPKP0MkUBkkDRHaOuwtYVyXNnTvkQCbEHkYrZgzjpiW2pOxd/3B6Mjsf MEUC77WARNGiqi61PPY7/jkKXO0Uz+SGuuIxnyM3L6gFsJSTtdidTbliN7DW/PuzYG03 fkxnwxjzx5bhSfal+L/MuD5/K+Ei1YUJiE/mQiqrrRRkVK7Pu1X5VEBAMULshgoQ+80F FLL+qttNb4bFYZrKoRn3YpX20jAeqvb2DTL0Yz/+JEMtWUXdlPGIqGM0NxhYMvK5ThcP nTiAXuvZgth3q8STIiZDI7/TB2tfgGFc9yhkr2cSUYCwRbFPMw10nZeP5vVJ9fsixKBR m7nw== ARC-Message-Signature: i=1; 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:subject:references:in-reply-to :message-id:to:from:date:dkim-signature; bh=Yl6Kuu/ALuZR/sdx4zNZvmQxUqB5ciNVSwHOslt17vE=; fh=K9OCrk0jtyvEQ6geFWI2sBEi8xrfjigZPYzdy7yBSqI=; b=j4QBmYnUplalUsF/grU3sszdpBmA4REneODoAZkCBdHd9U1Z6oczndp8WoK87u2ZQu SYp/kQ13SzqSvatB2WDFA2QJJnyMOcO2/GcSe4s5b0CsLsaiGZm2XVztuNDEtxMz0jG9 crjbqmhyl76yCfT++Z56Fh5NyUucK6kuaBvpXr4zLBXty4QvV2vz31F3fMPEU97mrvKP tBPhv9SdwMwVPrB/NvTfNClGw0+raQ8NBQb8Xr370RwYUZMh0NAAsp/MB6k8j38/s8JN X5EAYEepObnYMpajmd2tsWfXfgTcH6bdEi467xJlEDS7q+T7JDIUbo+aI07z6LEwWs3/ Y6ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ORjdSmL4; spf=pass (google.com: domain of linux-kernel+bounces-11684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11684-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 e14-20020a656bce000000b005be0ca9ca31si10074958pgw.294.2023.12.26.12.25.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:25:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11684-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=ORjdSmL4; spf=pass (google.com: domain of linux-kernel+bounces-11684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11684-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 C26A0B20ED2 for ; Tue, 26 Dec 2023 20:24:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A85D4C89; Tue, 26 Dec 2023 20:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ORjdSmL4" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.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 7B28B5C99; Tue, 26 Dec 2023 20:24:43 +0000 (UTC) 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-qv1-f48.google.com with SMTP id 6a1803df08f44-67f95d69115so37265766d6.1; Tue, 26 Dec 2023 12:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703622282; x=1704227082; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Yl6Kuu/ALuZR/sdx4zNZvmQxUqB5ciNVSwHOslt17vE=; b=ORjdSmL43XZClASgLtZMN0DuvgM4vHVd/meaJ1jUD5NJKVQNkJK6M1POqc48HJdc9L GmEy0AEjhSGtQhetP/MYTEogyPJ7CZLEqmGB+432usd6/2U6+QWQhHbq3W7EZJyN5JKP +XUsBBhasTz7z4Sea6pkZv8DFsWtkPrDB2EDIXcx1EttE9bZ/fhMsscdkdq5ndwH2MXE Z5Sh4oND3aXH8EIVLDS3pkWpkgjEG5B+l808o7ifha6Cc98PUfZENQQGjjpD86pM5xHe h9tsmrgKgtJQCG85w1quqYY3Z/zS5X7dzuyrT5Rt7EgRlK59I8B7usT1Tw1cdoN89DSX DnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703622282; x=1704227082; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yl6Kuu/ALuZR/sdx4zNZvmQxUqB5ciNVSwHOslt17vE=; b=F7+XXpcc7InlBllXWV0i1efEqeqyLiZUutLfRKc1awS0KkCL8iugNqDN5KgsL6TBZj rOWra/E1Ur8FGbx1Ju2XMrFc5WtbQpBwDLTNEJlDOw+0DJBCDN8vgpgvw+BWS6N78mu8 TnRYxOe90JOn0OLi13TIp5OYGMIB8MwReLoUFwQnVKBMVbpAHF6mkw3D5rgx/FJWDWhj OQdWwpW3LFC6WoduNDftUBwzKuUZSUJP9dTCK6fEJF4Afa2PAnUBiGiokj/P71yKtuno 00mYKijjeLU74Ffovel9pwKT0iJ0R0988ZdC2vE4CwOutfsZBqoPqu5JnC/9fup1V69H Zuug== X-Gm-Message-State: AOJu0YyHgKEGEsS9FFrciBehIRVek1FV+tInuxcHh8iKZ2ijz7/DLSXG wlFOVh/BaTaOUARejg8bzWE= X-Received: by 2002:ad4:5f0d:0:b0:67f:65e1:fdd1 with SMTP id fo13-20020ad45f0d000000b0067f65e1fdd1mr12860190qvb.127.1703622282342; Tue, 26 Dec 2023 12:24:42 -0800 (PST) Received: from localhost (48.230.85.34.bc.googleusercontent.com. [34.85.230.48]) by smtp.gmail.com with ESMTPSA id ec17-20020ad44e71000000b0067f90426698sm4230255qvb.23.2023.12.26.12.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 12:24:42 -0800 (PST) Date: Tue, 26 Dec 2023 15:24:41 -0500 From: Willem de Bruijn To: Richard Gobert , davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Message-ID: <658b3689d3617_5c2a929422@willemb.c.googlers.com.notmuch> In-Reply-To: References: Subject: Re: [PATCH net-next 1/3] net: gso: add HBH extension header offload support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Richard Gobert wrote: > This commit adds net_offload to IPv6 Hop-by-Hop extension headers (as it > is done for routing and dstopts) since it is supported in GSO and GRO. > This allows to remove specific HBH conditionals in GSO and GRO when > pulling and parsing an incoming packet. > > Signed-off-by: Richard Gobert Reviewed-by: Willem de Bruijn > --- > net/ipv6/exthdrs_offload.c | 11 +++++++++++ > net/ipv6/ip6_offload.c | 25 +++++++++++-------------- > 2 files changed, 22 insertions(+), 14 deletions(-) > > diff --git a/net/ipv6/exthdrs_offload.c b/net/ipv6/exthdrs_offload.c > index 06750d65d480..4c00398f4dca 100644 > --- a/net/ipv6/exthdrs_offload.c > +++ b/net/ipv6/exthdrs_offload.c > @@ -16,6 +16,10 @@ static const struct net_offload dstopt_offload = { > .flags = INET6_PROTO_GSO_EXTHDR, > }; > > +static const struct net_offload hbh_offload = { > + .flags = INET6_PROTO_GSO_EXTHDR, > +}; > + > int __init ipv6_exthdrs_offload_init(void) > { > int ret; > @@ -28,9 +32,16 @@ int __init ipv6_exthdrs_offload_init(void) > if (ret) > goto out_rt; > > + ret = inet6_add_offload(&hbh_offload, IPPROTO_HOPOPTS); > + if (ret) > + goto out_dstopts; > + > out: > return ret; > > +out_dstopts: > + inet6_del_offload(&dstopt_offload, IPPROTO_DSTOPTS); > + > out_rt: > inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING); > goto out; > diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c > index d6314287338d..0e0b5fed0995 100644 > --- a/net/ipv6/ip6_offload.c > +++ b/net/ipv6/ip6_offload.c > @@ -45,15 +45,13 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) > struct ipv6_opt_hdr *opth; > int len; > > - if (proto != NEXTHDR_HOP) { > - ops = rcu_dereference(inet6_offloads[proto]); > + ops = rcu_dereference(inet6_offloads[proto]); > > - if (unlikely(!ops)) > - break; > + if (unlikely(!ops)) > + break; > > - if (!(ops->flags & INET6_PROTO_GSO_EXTHDR)) > - break; > - } > + if (!(ops->flags & INET6_PROTO_GSO_EXTHDR)) > + break; > > if (unlikely(!pskb_may_pull(skb, 8))) > break; > @@ -171,13 +169,12 @@ static int ipv6_exthdrs_len(struct ipv6hdr *iph, > > proto = iph->nexthdr; > for (;;) { > - if (proto != NEXTHDR_HOP) { > - *opps = rcu_dereference(inet6_offloads[proto]); > - if (unlikely(!(*opps))) > - break; > - if (!((*opps)->flags & INET6_PROTO_GSO_EXTHDR)) > - break; > - } > + *opps = rcu_dereference(inet6_offloads[proto]); > + if (unlikely(!(*opps))) > + break; > + if (!((*opps)->flags & INET6_PROTO_GSO_EXTHDR)) > + break; > + > opth = (void *)opth + optlen; > optlen = ipv6_optlen(opth); > len += optlen; > -- > 2.36.1 >