Message ID | 20230925155858.651425-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1371082vqu; Mon, 25 Sep 2023 10:28:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6PJWa4pXzcX/Amq2BPuHB3zMqeV2jHqZqqUcjw36i6c7gyp9KGaEZmS1MATHTawvHutaY X-Received: by 2002:a05:6870:f689:b0:1d5:f814:56a3 with SMTP id el9-20020a056870f68900b001d5f81456a3mr6159319oab.2.1695662911483; Mon, 25 Sep 2023 10:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695662911; cv=none; d=google.com; s=arc-20160816; b=gx3DRRZhMfJSX6sJZYbmB0VGkAe2ZFrsfOD+4/IhiNM5OS7C2fYNG/NoHoDvjFzGLp JxrCJOEs9Mr4JYdWG2GX+6oYczjZbqlKjftmxrTIbabxyoVXYY6s0cabMPxZlyV0MJeG 5iQkZ/POK4ijEF/ZoUulaRyNqFwwyhXnQkXmtnwtJAHRWRFO/Yc9nRIkuzKfT/ltavc5 0k3Pu0ccaVSQR874Xe2XteEDTDbGWe/O+MMY5WgjMQsTvUj69PaHX8PCWbDhnbDLrZ9w +Rv8Io5xSdfypk6rqRk4AOJ7UbHyWaLZsJ9YnsWaJt9+Lho74kaQq0mz8zgkn5GPWE7m Aswg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6V37IhOOEyXdlEQ0fP03V/zoWzxmJQJVsxjPZyw2mO4=; fh=quDRuJf+7CERL/TgapMbnIXWAFvUUHHo5jGYe4VkGuw=; b=Jx2fh6bgXtSA2eDP1/00HADFIA9AMvMukGripRrxV+09/TlBztn0p2WM17wiJQBjP8 nM3Q+T1NeXsEOc7kgbWrfpuXYfLJhbcqQ9C2XcjTHLdyXUrchGFsBrsfj5jx4iqqtLxd PO4obLAzrW89GSn93wae7YmXIcTUE0hmr19DT7Nox8/7OgDapfzJQnTB5JBltLy/9b9W bweI4y1o6awYJc75Vs7q/yUALw3Mt5y+5vuVgR6PhGDf+2Vlt+FQvNdpXfF8/HDF5q2b YuKeApem0BZoPKDUJwbC9zWG/1g/rtWjoSr3k2mWHSToUuTzwPNd33IdCF82CmcJspbd yO1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Adys9/F3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q26-20020a631f5a000000b0057c9e0c7bb8si8299024pgm.312.2023.09.25.10.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Adys9/F3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8548C80CE7DF; Mon, 25 Sep 2023 08:59:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbjIYP7P (ORCPT <rfc822;pusanteemu@gmail.com> + 29 others); Mon, 25 Sep 2023 11:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbjIYP7N (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 25 Sep 2023 11:59:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1FA7B6 for <linux-kernel@vger.kernel.org>; Mon, 25 Sep 2023 08:59:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3A7AC433C7; Mon, 25 Sep 2023 15:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695657545; bh=RrtU4RECwP4yzk+K9XzYnJXLXX3xo09O9R98nMyytTY=; h=From:To:Cc:Subject:Date:From; b=Adys9/F3M27GS5RkwihTaM+15EOZe0NoXZRfBW44jWh/4iZgMZKGQiwtiLFmEFe4h GrYPKAY8ly1lmpAoolOo8ypEQjWeCAqyTqwAB9Q1M9Rqu4MLN1RBSOKAdth7yokiZm ZkhqrtOyVcR6oMSvDzV8b6tKxve6HsHRYALXckry1DzFgfSacu/ostOrnGliGiGbZh HrNTKf2/FPad5fLLS3VSxkrlG5hbZWNAQplFDuHL5cZr+QFBEpkfMAuK5UNM/LwQJw PGTA8bsbRiEdcoJ1XMIrci4AN7UEs9WLkIjNysN+wl4wqlhvqVs/6HbUcCSmNdXpCo mYnAGuYGoxwkg== From: Arnd Bergmann <arnd@kernel.org> To: Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: Arnd Bergmann <arnd@arndb.de>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Alan Brady <alan.brady@intel.com>, Sridhar Samudrala <sridhar.samudrala@intel.com>, Willem de Bruijn <willemb@google.com>, Phani Burra <phani.r.burra@intel.com>, Joshua Hay <joshua.a.hay@intel.com>, Pavan Kumar Linga <pavan.kumar.linga@intel.com>, Madhu Chittim <madhu.chittim@intel.com>, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] idpf: fix building without IPv4 Date: Mon, 25 Sep 2023 17:58:44 +0200 Message-Id: <20230925155858.651425-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:59:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778031432677213526 X-GMAIL-MSGID: 1778031432677213526 |
Series |
idpf: fix building without IPv4
|
|
Commit Message
Arnd Bergmann
Sept. 25, 2023, 3:58 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The newly added offload code fails to link when IPv4 networking is disabled: arm-linux-gnueabi-ld: drivers/net/ethernet/intel/idpf/idpf_txrx.o: in function `idpf_vport_splitq_napi_poll': idpf_txrx.c:(.text+0x7a20): undefined reference to `tcp_gro_complete' Add complile-time checks for both CONFIG_INET (ipv4) and CONFIG_IPV6 in order to drop the corresponding code when the features are unavailable. This should also help produce slightly better output for IPv4-only kernel builds, if anyone still uses those. Fixes: 3a8845af66edb ("idpf: add RX splitq napi poll support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
Comments
On 9/25/2023 8:58 AM, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The newly added offload code fails to link when IPv4 networking is disabled: > > arm-linux-gnueabi-ld: drivers/net/ethernet/intel/idpf/idpf_txrx.o: in function `idpf_vport_splitq_napi_poll': > idpf_txrx.c:(.text+0x7a20): undefined reference to `tcp_gro_complete' > > Add complile-time checks for both CONFIG_INET (ipv4) and CONFIG_IPV6 > in order to drop the corresponding code when the features are unavailable. > This should also help produce slightly better output for IPv4-only > kernel builds, if anyone still uses those. Hi Arnd, Also, a pending patch for this [1], however, this does look a bit more efficient. Adding Olek as he's author on the other patch. netdev maintainers, If this is the version that does get picked up, did you want to take it directly to close out the compile issues? Acked-by: Tony Nguyen <anthony.l.nguyen@intel.com> > Fixes: 3a8845af66edb ("idpf: add RX splitq napi poll support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/net/ethernet/intel/idpf/idpf_txrx.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c > index 6fa79898c42c5..140c1ad3e0679 100644 > --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c > +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c > @@ -2770,8 +2770,10 @@ static void idpf_rx_csum(struct idpf_queue *rxq, struct sk_buff *skb, > if (!(csum_bits->l3l4p)) > return; > > - ipv4 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); > - ipv6 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); > + ipv4 = IS_ENABLED(CONFIG_INET) && > + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); > + ipv6 = IS_ENABLED(CONFIG_IPV6) && > + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); > > if (ipv4 && (csum_bits->ipe || csum_bits->eipe)) > goto checksum_fail; > @@ -2870,8 +2872,10 @@ static int idpf_rx_rsc(struct idpf_queue *rxq, struct sk_buff *skb, > if (unlikely(!rsc_seg_len)) > return -EINVAL; > > - ipv4 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); > - ipv6 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); > + ipv4 = IS_ENABLED(CONFIG_INET) && > + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); > + ipv6 = IS_ENABLED(CONFIG_IPV6) && > + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); > > if (unlikely(!(ipv4 ^ ipv6))) > return -EINVAL; [1] https://lore.kernel.org/netdev/20230921125936.1621191-1-aleksander.lobakin@intel.com/
On Mon, 25 Sep 2023 10:05:03 -0700 Tony Nguyen wrote: > Also, a pending patch for this [1], however, this does look a bit more > efficient. Adding Olek as he's author on the other patch. > > netdev maintainers, > > If this is the version that does get picked up, did you want to take it > directly to close out the compile issues? Sorry for the delays. Should we not add a !INET static inline wrapper for tcp_gro_complete()? Seems a bit backwards to me to make drivers suffer and think about such a preposterous config :S $ git grep tcp_gro_complete -- drivers/ drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c: tcp_gro_complete(skb); drivers/net/ethernet/broadcom/bnxt/bnxt.c: tcp_gro_complete(skb); drivers/net/ethernet/intel/idpf/idpf_txrx.c: tcp_gro_complete(skb); drivers/net/ethernet/qlogic/qede/qede_fp.c: tcp_gro_complete(skb); We have 4 drivers which need ifdefs already and the number will only grow with GRO-HW spreading.
On Wed, Oct 4, 2023, at 00:43, Jakub Kicinski wrote: > On Mon, 25 Sep 2023 10:05:03 -0700 Tony Nguyen wrote: >> Also, a pending patch for this [1], however, this does look a bit more >> efficient. Adding Olek as he's author on the other patch. >> >> netdev maintainers, >> >> If this is the version that does get picked up, did you want to take it >> directly to close out the compile issues? > > Sorry for the delays. Should we not add a !INET static inline wrapper > for tcp_gro_complete()? Seems a bit backwards to me to make drivers > suffer and think about such a preposterous config :S > > $ git grep tcp_gro_complete -- drivers/ > drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c: tcp_gro_complete(skb); > drivers/net/ethernet/broadcom/bnxt/bnxt.c: tcp_gro_complete(skb); > drivers/net/ethernet/intel/idpf/idpf_txrx.c: tcp_gro_complete(skb); > drivers/net/ethernet/qlogic/qede/qede_fp.c: tcp_gro_complete(skb); > > We have 4 drivers which need ifdefs already and the number will only > grow with GRO-HW spreading. That sounds good to me, but it's better if someone that understands this code patch better than me writes the stub helpers, to ensure all callers have sensible behavior in that configuration. I also had a brief look at who might be using kernels without CONFIG_INET. In the kernel source tree, there are 19 defconfig files that completely enable CONFIG_NET, which means that both INET and ETHERNET are always turned off as well. There are four configs that enable CONFIG_NET but not CONFIG_INET: arch/arm/configs/spear3xx_defconfig arch/arm/configs/spear6xx_defconfig arch/m68k/configs/virt_defconfig arch/s390/configs/zfcpdump_defconfig I'm confident that the two arm configs are a mistake, as these are regular embedded SoCs with on-chip ethernet that is enabled in the config but almost certainly has no other use. The virt defconfig lost CONFIG_INET after commit d7385ba13771 ("9p: Remove INET dependency") added an 'imply INET'. This sounds like a bad idea, since it messes up the 'defconfig' logic when a leaf driver enables an entire subsystem. The s390 zfcpdump defconfig looks like a legitimate case for disabling INET, but it's not that size constrained and it might not actually need CONFIG_NET either. So overall, it seems there is no real need to support CONFIG_NET=y with CONFIG_INET=n and we could just make them be the same and avoid bugs like this. In theory we could also go the opposite way and try to make INET a tristate symbol that can live in a loadable module like all other network protocols. This would be nice conceptually and for smaller vmlinux files (some systems are much more limited in the size of their boot partition than their RAM and rootfs), but would clearly cause way more build failures. Arnd
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: Mon, 25 Sep 2023 10:05:03 -0700 > > On 9/25/2023 8:58 AM, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.de> >> >> The newly added offload code fails to link when IPv4 networking is >> disabled: >> >> arm-linux-gnueabi-ld: drivers/net/ethernet/intel/idpf/idpf_txrx.o: in >> function `idpf_vport_splitq_napi_poll': >> idpf_txrx.c:(.text+0x7a20): undefined reference to `tcp_gro_complete' >> >> Add complile-time checks for both CONFIG_INET (ipv4) and CONFIG_IPV6 >> in order to drop the corresponding code when the features are >> unavailable. >> This should also help produce slightly better output for IPv4-only >> kernel builds, if anyone still uses those. > > Hi Arnd, > > Also, a pending patch for this [1], however, this does look a bit more I agree Arnd's version is more efficient, the other question is why my patch has been hanging in your tree for 2 weeks, although I asked to take it directly to fix automated builds ASAP xD > efficient. Adding Olek as he's author on the other patch. > > netdev maintainers, > > If this is the version that does get picked up, did you want to take it > directly to close out the compile issues? [...] Thanks, Olek
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index 6fa79898c42c5..140c1ad3e0679 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -2770,8 +2770,10 @@ static void idpf_rx_csum(struct idpf_queue *rxq, struct sk_buff *skb, if (!(csum_bits->l3l4p)) return; - ipv4 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); - ipv6 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); + ipv4 = IS_ENABLED(CONFIG_INET) && + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); + ipv6 = IS_ENABLED(CONFIG_IPV6) && + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); if (ipv4 && (csum_bits->ipe || csum_bits->eipe)) goto checksum_fail; @@ -2870,8 +2872,10 @@ static int idpf_rx_rsc(struct idpf_queue *rxq, struct sk_buff *skb, if (unlikely(!rsc_seg_len)) return -EINVAL; - ipv4 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); - ipv6 = IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); + ipv4 = IS_ENABLED(CONFIG_INET) && + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV4); + ipv6 = IS_ENABLED(CONFIG_IPV6) && + IDPF_RX_PTYPE_TO_IPV(decoded, IDPF_RX_PTYPE_OUTER_IPV6); if (unlikely(!(ipv4 ^ ipv6))) return -EINVAL;