aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@oracle.com>2017-12-19 19:00:02 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-01-23 13:09:12 -0500
commit85bc2663a5df852ade80fa328c21716a8fe132f6 (patch)
tree435ed4bfbece2a4f1f74c8afade5eefee2e48ac0
parenta8a43fda2734cfe54f1a004458b0f049bfae8540 (diff)
ixgbe: register ipsec offload with the xfrm subsystem
With all the support code in place we can now link in the ipsec offload operations and set the ESP feature flag for the XFRM subsystem to see. Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c17
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c6
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index c25b0bb2c4e6..93eacddb6704 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -718,10 +718,23 @@ static bool ixgbe_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs)
718 return true; 718 return true;
719} 719}
720 720
721/**
722 * ixgbe_ipsec_free - called by xfrm garbage collections
723 * @xs: pointer to transformer state struct
724 *
725 * We don't have any garbage to collect, so we shouldn't bother
726 * implementing this function, but the XFRM code doesn't check for
727 * existence before calling the API callback.
728 **/
729static void ixgbe_ipsec_free(struct xfrm_state *xs)
730{
731}
732
721static const struct xfrmdev_ops ixgbe_xfrmdev_ops = { 733static const struct xfrmdev_ops ixgbe_xfrmdev_ops = {
722 .xdo_dev_state_add = ixgbe_ipsec_add_sa, 734 .xdo_dev_state_add = ixgbe_ipsec_add_sa,
723 .xdo_dev_state_delete = ixgbe_ipsec_del_sa, 735 .xdo_dev_state_delete = ixgbe_ipsec_del_sa,
724 .xdo_dev_offload_ok = ixgbe_ipsec_offload_ok, 736 .xdo_dev_offload_ok = ixgbe_ipsec_offload_ok,
737 .xdo_dev_state_free = ixgbe_ipsec_free,
725}; 738};
726 739
727/** 740/**
@@ -895,6 +908,10 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
895 ixgbe_ipsec_stop_engine(adapter); 908 ixgbe_ipsec_stop_engine(adapter);
896 ixgbe_ipsec_clear_hw_tables(adapter); 909 ixgbe_ipsec_clear_hw_tables(adapter);
897 910
911 adapter->netdev->xfrmdev_ops = &ixgbe_xfrmdev_ops;
912 adapter->netdev->features |= NETIF_F_HW_ESP;
913 adapter->netdev->hw_enc_features |= NETIF_F_HW_ESP;
914
898 return; 915 return;
899 916
900err2: 917err2:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 58b36ce35b28..722cc3153a99 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9895,6 +9895,12 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev,
9895 if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) 9895 if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID))
9896 features &= ~NETIF_F_TSO; 9896 features &= ~NETIF_F_TSO;
9897 9897
9898#ifdef CONFIG_XFRM_OFFLOAD
9899 /* IPsec offload doesn't get along well with others *yet* */
9900 if (skb->sp)
9901 features &= ~(NETIF_F_TSO | NETIF_F_HW_CSUM);
9902#endif
9903
9898 return features; 9904 return features;
9899} 9905}
9900 9906