|
52 | 52 | #ifdef CONFIG_IXGBE_DCA
|
53 | 53 | #include <linux/dca.h>
|
54 | 54 | #endif
|
| 55 | +#include "ixgbe_ipsec.h" |
55 | 56 |
|
56 | 57 | #include <net/xdp.h>
|
57 | 58 | #include <net/busy_poll.h>
|
@@ -171,10 +172,11 @@ enum ixgbe_tx_flags {
|
171 | 172 | IXGBE_TX_FLAGS_CC = 0x08,
|
172 | 173 | IXGBE_TX_FLAGS_IPV4 = 0x10,
|
173 | 174 | IXGBE_TX_FLAGS_CSUM = 0x20,
|
| 175 | + IXGBE_TX_FLAGS_IPSEC = 0x40, |
174 | 176 |
|
175 | 177 | /* software defined flags */
|
176 |
| - IXGBE_TX_FLAGS_SW_VLAN = 0x40, |
177 |
| - IXGBE_TX_FLAGS_FCOE = 0x80, |
| 178 | + IXGBE_TX_FLAGS_SW_VLAN = 0x80, |
| 179 | + IXGBE_TX_FLAGS_FCOE = 0x100, |
178 | 180 | };
|
179 | 181 |
|
180 | 182 | /* VLAN info */
|
@@ -629,15 +631,18 @@ struct ixgbe_adapter {
|
629 | 631 | #define IXGBE_FLAG2_EEE_CAPABLE BIT(14)
|
630 | 632 | #define IXGBE_FLAG2_EEE_ENABLED BIT(15)
|
631 | 633 | #define IXGBE_FLAG2_RX_LEGACY BIT(16)
|
| 634 | +#define IXGBE_FLAG2_IPSEC_ENABLED BIT(17) |
632 | 635 |
|
633 | 636 | /* Tx fast path data */
|
634 | 637 | int num_tx_queues;
|
635 | 638 | u16 tx_itr_setting;
|
636 | 639 | u16 tx_work_limit;
|
| 640 | + u64 tx_ipsec; |
637 | 641 |
|
638 | 642 | /* Rx fast path data */
|
639 | 643 | int num_rx_queues;
|
640 | 644 | u16 rx_itr_setting;
|
| 645 | + u64 rx_ipsec; |
641 | 646 |
|
642 | 647 | /* Port number used to identify VXLAN traffic */
|
643 | 648 | __be16 vxlan_port;
|
@@ -781,6 +786,10 @@ struct ixgbe_adapter {
|
781 | 786 |
|
782 | 787 | #define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
|
783 | 788 | u32 *rss_key;
|
| 789 | + |
| 790 | +#ifdef CONFIG_XFRM |
| 791 | + struct ixgbe_ipsec *ipsec; |
| 792 | +#endif /* CONFIG_XFRM */ |
784 | 793 | };
|
785 | 794 |
|
786 | 795 | static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)
|
@@ -1011,4 +1020,24 @@ void ixgbe_store_key(struct ixgbe_adapter *adapter);
|
1011 | 1020 | void ixgbe_store_reta(struct ixgbe_adapter *adapter);
|
1012 | 1021 | s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
|
1013 | 1022 | u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm);
|
| 1023 | +#ifdef CONFIG_XFRM_OFFLOAD |
| 1024 | +void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter); |
| 1025 | +void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter); |
| 1026 | +void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter); |
| 1027 | +void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring, |
| 1028 | + union ixgbe_adv_rx_desc *rx_desc, |
| 1029 | + struct sk_buff *skb); |
| 1030 | +int ixgbe_ipsec_tx(struct ixgbe_ring *tx_ring, struct ixgbe_tx_buffer *first, |
| 1031 | + struct ixgbe_ipsec_tx_data *itd); |
| 1032 | +#else |
| 1033 | +static inline void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter) { }; |
| 1034 | +static inline void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter) { }; |
| 1035 | +static inline void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter) { }; |
| 1036 | +static inline void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring, |
| 1037 | + union ixgbe_adv_rx_desc *rx_desc, |
| 1038 | + struct sk_buff *skb) { }; |
| 1039 | +static inline int ixgbe_ipsec_tx(struct ixgbe_ring *tx_ring, |
| 1040 | + struct ixgbe_tx_buffer *first, |
| 1041 | + struct ixgbe_ipsec_tx_data *itd) { return 0; }; |
| 1042 | +#endif /* CONFIG_XFRM_OFFLOAD */ |
1014 | 1043 | #endif /* _IXGBE_H_ */
|
0 commit comments