netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shannon Nelson <shannon.nelson@oracle.com>
To: intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com
Cc: netdev@vger.kernel.org, steffen.klassert@secunet.com,
	sowmini.varadhan@oracle.com
Subject: [PATCH v2 next-queue 10/10] ixgbe: register ipsec offload with the xfrm subsystem
Date: Tue, 12 Dec 2017 15:37:03 -0800	[thread overview]
Message-ID: <1513121823-27944-11-git-send-email-shannon.nelson@oracle.com> (raw)
In-Reply-To: <1513121823-27944-1-git-send-email-shannon.nelson@oracle.com>

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>
---
v2: added the xdo_dev_state_free callback to make XFRM happy
    changed use of NETIF_F_HW_CSUM_BIT to NETIF_F_HW_CSUM

 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 17 +++++++++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |  4 ++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index ed3a4c8..4949ea9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -715,10 +715,23 @@ static bool ixgbe_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs)
 	return true;
 }
 
+/**
+ * ixgbe_ipsec_free - called by xfrm garbage collections
+ * @xs: pointer to transformer state struct
+ *
+ * We don't have any garbage to collect, so we shouldn't bother
+ * implementing this function, but the XFRM code doesn't check for
+ * existence before calling the API callback.
+ **/
+static void ixgbe_ipsec_free(struct xfrm_state *xs)
+{
+}
+
 static const struct xfrmdev_ops ixgbe_xfrmdev_ops = {
 	.xdo_dev_state_add = ixgbe_ipsec_add_sa,
 	.xdo_dev_state_delete = ixgbe_ipsec_del_sa,
 	.xdo_dev_offload_ok = ixgbe_ipsec_offload_ok,
+	.xdo_dev_state_free = ixgbe_ipsec_free,
 };
 
 /**
@@ -877,6 +890,10 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
 	ixgbe_ipsec_stop_engine(adapter);
 	ixgbe_ipsec_clear_hw_tables(adapter);
 
+	adapter->netdev->xfrmdev_ops = &ixgbe_xfrmdev_ops;
+	adapter->netdev->features |= NETIF_F_HW_ESP;
+	adapter->netdev->hw_enc_features |= NETIF_F_HW_ESP;
+
 	return;
 
 err2:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 814268f..2e5d0a2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9796,6 +9796,10 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev,
 	if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID))
 		features &= ~NETIF_F_TSO;
 
+	/* IPsec offload doesn't get along well with others *yet* */
+	if (skb->sp)
+		features &= ~(NETIF_F_TSO | NETIF_F_HW_CSUM);
+
 	return features;
 }
 
-- 
2.7.4

      parent reply	other threads:[~2017-12-12 23:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 23:36 [PATCH v2 next-queue 00/10] ixgbe: Add ipsec offload Shannon Nelson
2017-12-12 23:36 ` [PATCH v2 next-queue 01/10] ixgbe: clean up ipsec defines Shannon Nelson
2017-12-12 23:36 ` [PATCH v2 next-queue 02/10] ixgbe: add ipsec register access routines Shannon Nelson
2017-12-12 23:36 ` [PATCH v2 next-queue 03/10] ixgbe: add ipsec engine start and stop routines Shannon Nelson
2017-12-12 23:36 ` [PATCH v2 next-queue 04/10] ixgbe: add ipsec data structures Shannon Nelson
2017-12-12 23:36 ` [PATCH v2 next-queue 05/10] ixgbe: add ipsec offload add and remove SA Shannon Nelson
2017-12-12 23:36 ` [PATCH v2 next-queue 06/10] ixgbe: restore offloaded SAs after a reset Shannon Nelson
2017-12-12 23:37 ` [PATCH v2 next-queue 07/10] ixgbe: process the Rx ipsec offload Shannon Nelson
2017-12-12 23:37 ` [PATCH v2 next-queue 08/10] ixgbe: process the Tx " Shannon Nelson
2017-12-13  1:59   ` [Intel-wired-lan] " Alexander Duyck
2017-12-13  5:45     ` Shannon Nelson
2017-12-15 19:20       ` Jesse Brandeburg
2017-12-15 20:10   ` kbuild test robot
2017-12-15 20:22     ` Shannon Nelson
2017-12-15 21:18   ` kbuild test robot
2017-12-12 23:37 ` [PATCH v2 next-queue 09/10] ixgbe: ipsec offload stats Shannon Nelson
2017-12-12 23:37 ` Shannon Nelson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513121823-27944-11-git-send-email-shannon.nelson@oracle.com \
    --to=shannon.nelson@oracle.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sowmini.varadhan@oracle.com \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).