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 04/10] ixgbe: add ipsec data structures
Date: Tue, 12 Dec 2017 15:36:57 -0800 [thread overview]
Message-ID: <1513121823-27944-5-git-send-email-shannon.nelson@oracle.com> (raw)
In-Reply-To: <1513121823-27944-1-git-send-email-shannon.nelson@oracle.com>
Set up the data structures to be used by the ipsec offload.
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
---
v2: ipaddr[] becomes __be32
increase the hash table size
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 5 ++++
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h | 40 ++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 1e11462..9487750 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -622,6 +622,7 @@ struct ixgbe_adapter {
#define IXGBE_FLAG2_EEE_CAPABLE BIT(14)
#define IXGBE_FLAG2_EEE_ENABLED BIT(15)
#define IXGBE_FLAG2_RX_LEGACY BIT(16)
+#define IXGBE_FLAG2_IPSEC_ENABLED BIT(17)
/* Tx fast path data */
int num_tx_queues;
@@ -772,6 +773,10 @@ struct ixgbe_adapter {
#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
u32 *rss_key;
+
+#ifdef CONFIG_XFRM
+ struct ixgbe_ipsec *ipsec;
+#endif /* CONFIG_XFRM */
};
static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h
index 341d3f0..ba1c82e 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h
@@ -49,4 +49,44 @@ enum ixgbe_ipsec_tbl_sel {
#define IXGBE_RXMOD_DECRYPT 0x00000008
#define IXGBE_RXMOD_IPV6 0x00000010
+struct rx_sa {
+ struct hlist_node hlist;
+ struct xfrm_state *xs;
+ __be32 ipaddr[4];
+ u32 key[4];
+ u32 salt;
+ u32 mode;
+ u8 iptbl_ind;
+ bool used;
+ bool decrypt;
+};
+
+struct rx_ip_sa {
+ __be32 ipaddr[4];
+ u32 ref_cnt;
+ bool used;
+};
+
+struct tx_sa {
+ struct xfrm_state *xs;
+ u32 key[4];
+ u32 salt;
+ bool encrypt;
+ bool used;
+};
+
+struct ixgbe_ipsec_tx_data {
+ u32 flags;
+ u16 trailer_len;
+ u16 sa_idx;
+};
+
+struct ixgbe_ipsec {
+ u16 num_rx_sa;
+ u16 num_tx_sa;
+ struct rx_ip_sa *ip_tbl;
+ struct rx_sa *rx_tbl;
+ struct tx_sa *tx_tbl;
+ DECLARE_HASHTABLE(rx_sa_list, 10);
+};
#endif /* _IXGBE_IPSEC_H_ */
--
2.7.4
next prev 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 ` Shannon Nelson [this message]
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 ` [PATCH v2 next-queue 10/10] ixgbe: register ipsec offload with the xfrm subsystem Shannon Nelson
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-5-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).