Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4971883imm; Tue, 16 Oct 2018 03:10:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV62f50emu7VttHcqiea+0IOTTjRCU7CY49v+kuik5KdXYzBXfhz0wBDwr9Epwp9QpyVEKrac X-Received: by 2002:a62:7f8c:: with SMTP id a134-v6mr21185751pfd.257.1539684616129; Tue, 16 Oct 2018 03:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539684616; cv=none; d=google.com; s=arc-20160816; b=DayCu/SQVpRBs8VmeVYZQ8L/ftYCc9RPbqa+HTT32H7/SzhQOII3MPdiPVm7iVr2ak OyS+9f78BL3VKWTgIHQoKcRAZaGIZADcueixk3IUOM5M+lgX2sXCuDo4XevMKyLHzKhD dYJBPhEbyImucgU6jKzbEZVV6EgWb/mfW+4hlUhPyc37AjBU5IHDU1sJjgaiBZiDVp3w KZ5JtONYoI7ZpVvydDM1u6/JwIzljqAlutuh6YRLFAPtmnNV1LyVQCE9Wo7PTFenG57E uXzpHAK228o0e2ZyxK6sn3Ha+maXA1WV8FhzDgJ26Eow/87IoYnRb9HW+S1A6Ny0WTKM 1PKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=rh+V1Pc6YEWDBuxoA8w7kfeK/Kg7bBpMezNyy/8DuAs=; b=uSlTeaPOlc3kH6bEZqE4IRcHnYitohM3ncHemi68HPP1FpXHfwm2Ut4cREqHnOuZzo i8ByrjuD8ot7cCUwLdC2MdCXXICdYaE4DoLwvEVpXX+MVhfzw+P+yfeeuNGyfMgbWnfJ 9UGNuhfnqfV/c5wvqPRONchSEtCjYxjmG7TdOuQvdBRZFe7o7zpuXzsljWaDPUqdpgQv HY6wSEkh7oRwRs9JTkPRIJYhE0bL6uUb6WdK0rA1xyi0JBTIsW251JAwKCCyc3AUumZZ WVUA/yX4zGcc/k1p2yvSXLRVOvLlzTaW5RPQRY6M4CiSkiJ6EABAFTNguyysKb17YT77 M1Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11-v6si11739112pgl.40.2018.10.16.03.10.00; Tue, 16 Oct 2018 03:10:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbeJPR7H (ORCPT + 99 others); Tue, 16 Oct 2018 13:59:07 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53261 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbeJPR7H (ORCPT ); Tue, 16 Oct 2018 13:59:07 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MiagR-1fgaUj2if9-00flZc; Tue, 16 Oct 2018 12:08:54 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MiagR-1fgaUj2if9-00flZc; Tue, 16 Oct 2018 12:08:54 +0200 From: Arnd Bergmann To: Jeff Kirsher , "David S. Miller" , Steffen Klassert , Herbert Xu Cc: Arnd Bergmann , Jesse Brandeburg , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Alexander Duyck , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] ixgbe: fix XFRM_ALGO dependency Date: Tue, 16 Oct 2018 12:03:41 +0200 Message-Id: <20181016100848.1329843-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:S9WfBRF3MhorrZUyVsq1Po2o06VgBZk9FFPsT9K7GoQ+Ebch/IT tVgkMSDQIZMBmSV3lGFJG6/nZ/SkrG8N0+GPRoNQOe5waeMWsDa/pGAFD7yPQCFBYQa7DY1 QBwSjQOmzOFGJpy+O1/Jr99wfnGqCToTfskyHnGs5ZbEj7C5xjFr0574xVjc/5w7bmzS2lv CY9Tos+ChHaLqJxVnAWew== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:/aa6vRZR+Ek=:DgDQEGEQ+6hXU811qaZ06+ 2VmdPpaFrkmYtHIg6Aidy00MJ8WXW/Ep7y5qJ6Rl/6EPi36pTANCz3B7MMz+VR230dQBioyB2 VAz0o5S4Gx6IVZ1TTQP2wrV2TbZnK4n2WXmEtDBb4YCjT2dT1ki8959+SlhoaxEgSglOQzuaP pbC1ReRVmpfX/AYUIDICjpWNqLWv1Dj7JlKpbtTVW6hiXjAYZCt2vtmGUVsMOv7qQjfkH5mI8 gJgCKT2HBDTz/GqmX28p8XPtsITFB4z3r4uol1OEHNYnrF1xIWYBXbC+z0dcR1i9VVP9aOhNU i6AdmdpS7UjLaaSRoahGudfobluRYufha5k+shq0M/bXJVoO+moXojz9YA1AVCqU3Mp7Kzt5q KkQv9bgYH6W3rpVgwR5tcmBrJuUjFmXGFaRQEdoIjHbVOi833d1wIaJI0dUNlD0mGpRMUQXaT a422dQ/dQ7N7JC7Yj9ZlC4O4iHnHjiAJtop5a2esxNYzU4/uAQdMraQhkJUb2ztC8G/h4tLI4 3a8nRZkmJ/mdNChNGUTGj0sNnsIiT44vVn10T6xAIPdmlI3b2kV5W8+XZHl4YzJC5SplDfHVt FOi5Nfaj5DbxHgMk7XOogCNWnY3tNQLtwaknRrSMFtvwr5z5MWOA3NqwUcW6gjZVJDK0bZZyY mLfXKxxZhpEUEwh7Is8qTb+9Fzat2MRSfk/DCKrWyqQfoZsWsHuv5FhwDPcpzaEFUTC8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When XFRM_ALGO is not enabled, the new igxge ipsec code produces a link error: drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.o: In function `ixgbe_ipsec_vf_add_sa': ixgbe_ipsec.c:(.text+0x1266): undefined reference to `xfrm_aead_get_byname' Simply selectin XFRM_ALGO from here causes circular dependencies, so to fix it, we probably want this slightly more complex solution that is similar to what other drivers with XFRM offload do: A separate Kconfig symbol now controls whether we include the ipsec offload code. To keep the old behavior, this is left as 'default y'. The dependency in XFRM_OFFLOAD still causes a circular dependency but is not actually needed because this symbol is not user visible, so removing that dependency on top makes it all work. Fixes: eda0333ac293 ("ixgbe: add VF IPsec management") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/intel/Kconfig | 10 ++++++++++ drivers/net/ethernet/intel/ixgbe/Makefile | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 8 ++++---- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++--- net/xfrm/Kconfig | 1 - 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig index b542aba6f0e8..d1db382d8299 100644 --- a/drivers/net/ethernet/intel/Kconfig +++ b/drivers/net/ethernet/intel/Kconfig @@ -194,6 +194,16 @@ config IXGBE_DCB If unsure, say N. +config IXGBE_IPSEC + bool "IPSec XFRM cryptography-offload accelaration" + default n + depends on IXGBE + depends on XFRM_OFFLOAD + default y + select XFRM_ALGO + ---help--- + Enable support for IPSec offload in ixgbe.ko + config IXGBEVF tristate "Intel(R) 10GbE PCI Express Virtual Function Ethernet support" depends on PCI_MSI diff --git a/drivers/net/ethernet/intel/ixgbe/Makefile b/drivers/net/ethernet/intel/ixgbe/Makefile index ca6b0c458e4a..4fb0d9e3f2da 100644 --- a/drivers/net/ethernet/intel/ixgbe/Makefile +++ b/drivers/net/ethernet/intel/ixgbe/Makefile @@ -17,4 +17,4 @@ ixgbe-$(CONFIG_IXGBE_DCB) += ixgbe_dcb.o ixgbe_dcb_82598.o \ ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o -ixgbe-$(CONFIG_XFRM_OFFLOAD) += ixgbe_ipsec.o +ixgbe-$(CONFIG_IXGBE_IPSEC) += ixgbe_ipsec.o diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 7a7679e7be84..1d5d66436eac 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h @@ -770,9 +770,9 @@ struct ixgbe_adapter { #define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ u32 *rss_key; -#ifdef CONFIG_XFRM_OFFLOAD +#ifdef CONFIG_IXGBE_IPSEC struct ixgbe_ipsec *ipsec; -#endif /* CONFIG_XFRM_OFFLOAD */ +#endif /* CONFIG_IXGBE_IPSEC */ /* AF_XDP zero-copy */ struct xdp_umem **xsk_umems; @@ -1009,7 +1009,7 @@ void ixgbe_store_key(struct ixgbe_adapter *adapter); void ixgbe_store_reta(struct ixgbe_adapter *adapter); s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); -#ifdef CONFIG_XFRM_OFFLOAD +#ifdef CONFIG_IXGBE_IPSEC void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter); void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter); void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter); @@ -1037,5 +1037,5 @@ static inline int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *mbuf, u32 vf) { return -EACCES; } static inline int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, u32 *mbuf, u32 vf) { return -EACCES; } -#endif /* CONFIG_XFRM_OFFLOAD */ +#endif /* CONFIG_IXGBE_IPSEC */ #endif /* _IXGBE_H_ */ diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 0049a2becd7e..113b38e0defb 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -8694,7 +8694,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, #endif /* IXGBE_FCOE */ -#ifdef CONFIG_XFRM_OFFLOAD +#ifdef CONFIG_IXGBE_IPSEC if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) goto out_drop; #endif @@ -10190,7 +10190,7 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev, * the TSO, so it's the exception. */ if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) { -#ifdef CONFIG_XFRM_OFFLOAD +#ifdef CONFIG_IXGBE_IPSEC if (!skb->sp) #endif features &= ~NETIF_F_TSO; @@ -10883,7 +10883,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (hw->mac.type >= ixgbe_mac_82599EB) netdev->features |= NETIF_F_SCTP_CRC; -#ifdef CONFIG_XFRM_OFFLOAD +#ifdef CONFIG_IXGBE_IPSEC #define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \ NETIF_F_HW_ESP_TX_CSUM | \ NETIF_F_GSO_ESP) diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig index 4a9ee2d83158..140270a13d54 100644 --- a/net/xfrm/Kconfig +++ b/net/xfrm/Kconfig @@ -8,7 +8,6 @@ config XFRM config XFRM_OFFLOAD bool - depends on XFRM config XFRM_ALGO tristate -- 2.18.0