From patchwork Mon Sep 25 15:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144508 Return-Path: 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 + 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 ); 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 ; 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 To: Jesse Brandeburg Cc: Arnd Bergmann , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alan Brady , Sridhar Samudrala , Willem de Bruijn , Phani Burra , Joshua Hay , Pavan Kumar Linga , Madhu Chittim , 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 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: 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 From: Arnd Bergmann 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 Acked-by: Tony Nguyen --- 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;