Skip to content

Commit 34c822e

Browse files
Shannon NelsonJeff Kirsher
authored andcommitted
ixgbe: add ipsec data structures
Set up the data structures to be used by the ipsec offload. Signed-off-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 49a94d7 commit 34c822e

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ struct ixgbe_adapter {
630630
#define IXGBE_FLAG2_EEE_CAPABLE BIT(14)
631631
#define IXGBE_FLAG2_EEE_ENABLED BIT(15)
632632
#define IXGBE_FLAG2_RX_LEGACY BIT(16)
633+
#define IXGBE_FLAG2_IPSEC_ENABLED BIT(17)
633634

634635
/* Tx fast path data */
635636
int num_tx_queues;
@@ -782,6 +783,10 @@ struct ixgbe_adapter {
782783

783784
#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
784785
u32 *rss_key;
786+
787+
#ifdef CONFIG_XFRM
788+
struct ixgbe_ipsec *ipsec;
789+
#endif /* CONFIG_XFRM */
785790
};
786791

787792
static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,44 @@ enum ixgbe_ipsec_tbl_sel {
5050
#define IXGBE_RXMOD_DECRYPT 0x00000008
5151
#define IXGBE_RXMOD_IPV6 0x00000010
5252

53+
struct rx_sa {
54+
struct hlist_node hlist;
55+
struct xfrm_state *xs;
56+
__be32 ipaddr[4];
57+
u32 key[4];
58+
u32 salt;
59+
u32 mode;
60+
u8 iptbl_ind;
61+
bool used;
62+
bool decrypt;
63+
};
64+
65+
struct rx_ip_sa {
66+
__be32 ipaddr[4];
67+
u32 ref_cnt;
68+
bool used;
69+
};
70+
71+
struct tx_sa {
72+
struct xfrm_state *xs;
73+
u32 key[4];
74+
u32 salt;
75+
bool encrypt;
76+
bool used;
77+
};
78+
79+
struct ixgbe_ipsec_tx_data {
80+
u32 flags;
81+
u16 trailer_len;
82+
u16 sa_idx;
83+
};
84+
85+
struct ixgbe_ipsec {
86+
u16 num_rx_sa;
87+
u16 num_tx_sa;
88+
struct rx_ip_sa *ip_tbl;
89+
struct rx_sa *rx_tbl;
90+
struct tx_sa *tx_tbl;
91+
DECLARE_HASHTABLE(rx_sa_list, 10);
92+
};
5393
#endif /* _IXGBE_IPSEC_H_ */

0 commit comments

Comments
 (0)