aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-10-18 18:39:43 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-10-31 13:53:15 -0400
commit48e01e001da31d5a40e31ed5f8cea83a18823cc1 (patch)
tree76de3ce8558869eb967cfb492737b07f35f88f43 /drivers/net/ethernet/intel
parent35ae5414e7085dfabe3d1737569eff549b04942e (diff)
ixgbe/ixgbevf: fix XFRM_ALGO dependency
Based on the original work from Arnd Bergmann. When XFRM_ALGO is not enabled, the new ixgbe 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 selecting 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. CC: Arnd Bergmann <arnd@arndb.de> CC: Shannon Nelson <shannon.nelson@oracle.com> Fixes: eda0333ac293 ("ixgbe: add VF IPsec management") Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/Kconfig18
-rw-r--r--drivers/net/ethernet/intel/ixgbe/Makefile2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h8
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/Makefile2
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf.h4
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c2
7 files changed, 30 insertions, 12 deletions
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index fd3373d82a9e..59e1bc0f609e 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -200,6 +200,15 @@ config IXGBE_DCB
200 200
201 If unsure, say N. 201 If unsure, say N.
202 202
203config IXGBE_IPSEC
204 bool "IPSec XFRM cryptography-offload acceleration"
205 depends on IXGBE
206 depends on XFRM_OFFLOAD
207 default y
208 select XFRM_ALGO
209 ---help---
210 Enable support for IPSec offload in ixgbe.ko
211
203config IXGBEVF 212config IXGBEVF
204 tristate "Intel(R) 10GbE PCI Express Virtual Function Ethernet support" 213 tristate "Intel(R) 10GbE PCI Express Virtual Function Ethernet support"
205 depends on PCI_MSI 214 depends on PCI_MSI
@@ -217,6 +226,15 @@ config IXGBEVF
217 will be called ixgbevf. MSI-X interrupt support is required 226 will be called ixgbevf. MSI-X interrupt support is required
218 for this driver to work correctly. 227 for this driver to work correctly.
219 228
229config IXGBEVF_IPSEC
230 bool "IPSec XFRM cryptography-offload acceleration"
231 depends on IXGBEVF
232 depends on XFRM_OFFLOAD
233 default y
234 select XFRM_ALGO
235 ---help---
236 Enable support for IPSec offload in ixgbevf.ko
237
220config I40E 238config I40E
221 tristate "Intel(R) Ethernet Controller XL710 Family support" 239 tristate "Intel(R) Ethernet Controller XL710 Family support"
222 imply PTP_1588_CLOCK 240 imply PTP_1588_CLOCK
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 \
17ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o 17ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o
18ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o 18ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o
19ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o 19ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o
20ixgbe-$(CONFIG_XFRM_OFFLOAD) += ixgbe_ipsec.o 20ixgbe-$(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 ec1b87cc4410..143bdd5ee2a0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -769,9 +769,9 @@ struct ixgbe_adapter {
769#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ 769#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
770 u32 *rss_key; 770 u32 *rss_key;
771 771
772#ifdef CONFIG_XFRM_OFFLOAD 772#ifdef CONFIG_IXGBE_IPSEC
773 struct ixgbe_ipsec *ipsec; 773 struct ixgbe_ipsec *ipsec;
774#endif /* CONFIG_XFRM_OFFLOAD */ 774#endif /* CONFIG_IXGBE_IPSEC */
775 775
776 /* AF_XDP zero-copy */ 776 /* AF_XDP zero-copy */
777 struct xdp_umem **xsk_umems; 777 struct xdp_umem **xsk_umems;
@@ -1008,7 +1008,7 @@ void ixgbe_store_key(struct ixgbe_adapter *adapter);
1008void ixgbe_store_reta(struct ixgbe_adapter *adapter); 1008void ixgbe_store_reta(struct ixgbe_adapter *adapter);
1009s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, 1009s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
1010 u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); 1010 u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm);
1011#ifdef CONFIG_XFRM_OFFLOAD 1011#ifdef CONFIG_IXGBE_IPSEC
1012void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter); 1012void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter);
1013void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter); 1013void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter);
1014void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter); 1014void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter);
@@ -1036,5 +1036,5 @@ static inline int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter,
1036 u32 *mbuf, u32 vf) { return -EACCES; } 1036 u32 *mbuf, u32 vf) { return -EACCES; }
1037static inline int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, 1037static inline int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter,
1038 u32 *mbuf, u32 vf) { return -EACCES; } 1038 u32 *mbuf, u32 vf) { return -EACCES; }
1039#endif /* CONFIG_XFRM_OFFLOAD */ 1039#endif /* CONFIG_IXGBE_IPSEC */
1040#endif /* _IXGBE_H_ */ 1040#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,
8694 8694
8695#endif /* IXGBE_FCOE */ 8695#endif /* IXGBE_FCOE */
8696 8696
8697#ifdef CONFIG_XFRM_OFFLOAD 8697#ifdef CONFIG_IXGBE_IPSEC
8698 if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) 8698 if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx))
8699 goto out_drop; 8699 goto out_drop;
8700#endif 8700#endif
@@ -10190,7 +10190,7 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev,
10190 * the TSO, so it's the exception. 10190 * the TSO, so it's the exception.
10191 */ 10191 */
10192 if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) { 10192 if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) {
10193#ifdef CONFIG_XFRM_OFFLOAD 10193#ifdef CONFIG_IXGBE_IPSEC
10194 if (!skb->sp) 10194 if (!skb->sp)
10195#endif 10195#endif
10196 features &= ~NETIF_F_TSO; 10196 features &= ~NETIF_F_TSO;
@@ -10883,7 +10883,7 @@ skip_sriov:
10883 if (hw->mac.type >= ixgbe_mac_82599EB) 10883 if (hw->mac.type >= ixgbe_mac_82599EB)
10884 netdev->features |= NETIF_F_SCTP_CRC; 10884 netdev->features |= NETIF_F_SCTP_CRC;
10885 10885
10886#ifdef CONFIG_XFRM_OFFLOAD 10886#ifdef CONFIG_IXGBE_IPSEC
10887#define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \ 10887#define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \
10888 NETIF_F_HW_ESP_TX_CSUM | \ 10888 NETIF_F_HW_ESP_TX_CSUM | \
10889 NETIF_F_GSO_ESP) 10889 NETIF_F_GSO_ESP)
diff --git a/drivers/net/ethernet/intel/ixgbevf/Makefile b/drivers/net/ethernet/intel/ixgbevf/Makefile
index 297d0f0858b5..186a4bb24fde 100644
--- a/drivers/net/ethernet/intel/ixgbevf/Makefile
+++ b/drivers/net/ethernet/intel/ixgbevf/Makefile
@@ -10,5 +10,5 @@ ixgbevf-objs := vf.o \
10 mbx.o \ 10 mbx.o \
11 ethtool.o \ 11 ethtool.o \
12 ixgbevf_main.o 12 ixgbevf_main.o
13ixgbevf-$(CONFIG_XFRM_OFFLOAD) += ipsec.o 13ixgbevf-$(CONFIG_IXGBEVF_IPSEC) += ipsec.o
14 14
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index e399e1c0c54a..ecab686574b6 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -459,7 +459,7 @@ int ethtool_ioctl(struct ifreq *ifr);
459 459
460extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector); 460extern void ixgbevf_write_eitr(struct ixgbevf_q_vector *q_vector);
461 461
462#ifdef CONFIG_XFRM_OFFLOAD 462#ifdef CONFIG_IXGBEVF_IPSEC
463void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter); 463void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter);
464void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter); 464void ixgbevf_stop_ipsec_offload(struct ixgbevf_adapter *adapter);
465void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter); 465void ixgbevf_ipsec_restore(struct ixgbevf_adapter *adapter);
@@ -482,7 +482,7 @@ static inline int ixgbevf_ipsec_tx(struct ixgbevf_ring *tx_ring,
482 struct ixgbevf_tx_buffer *first, 482 struct ixgbevf_tx_buffer *first,
483 struct ixgbevf_ipsec_tx_data *itd) 483 struct ixgbevf_ipsec_tx_data *itd)
484{ return 0; } 484{ return 0; }
485#endif /* CONFIG_XFRM_OFFLOAD */ 485#endif /* CONFIG_IXGBEVF_IPSEC */
486 486
487void ixgbe_napi_add_all(struct ixgbevf_adapter *adapter); 487void ixgbe_napi_add_all(struct ixgbevf_adapter *adapter);
488void ixgbe_napi_del_all(struct ixgbevf_adapter *adapter); 488void ixgbe_napi_del_all(struct ixgbevf_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 98707ee11d72..5e47ede7e832 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -4150,7 +4150,7 @@ static int ixgbevf_xmit_frame_ring(struct sk_buff *skb,
4150 first->tx_flags = tx_flags; 4150 first->tx_flags = tx_flags;
4151 first->protocol = vlan_get_protocol(skb); 4151 first->protocol = vlan_get_protocol(skb);
4152 4152
4153#ifdef CONFIG_XFRM_OFFLOAD 4153#ifdef CONFIG_IXGBEVF_IPSEC
4154 if (skb->sp && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx)) 4154 if (skb->sp && !ixgbevf_ipsec_tx(tx_ring, first, &ipsec_tx))
4155 goto out_drop; 4155 goto out_drop;
4156#endif 4156#endif