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: 13398092 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 089261F95E for ; Mon, 25 Sep 2023 15:59:05 +0000 (UTC) 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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;