Skip to content

Commit

Permalink
ixgbe: add ipsec data structures
Browse files Browse the repository at this point in the history
Set up the data structures to be used by the ipsec offload.

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>
  • Loading branch information
Shannon Nelson authored and Jeff Kirsher committed Jan 23, 2018
1 parent 49a94d7 commit 34c822e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/intel/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,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;
Expand Down Expand Up @@ -782,6 +783,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)
Expand Down
40 changes: 40 additions & 0 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,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_ */

0 comments on commit 34c822e

Please sign in to comment.