Skip to content

Commit 0542e13

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2018-01-23 This series contains updates to ixgbe only. Shannon Nelson provides an implementation of the ipsec hardware offload feature for the ixgbe driver for these devices: x540, x550, 82599. The ixgbe NICs support ipsec offload for 1024 Rx and 1024 Tx Security Associations (SAs), using up to 128 inbound IP addresses, and using the rfc4106(gcm(aes)) encryption. This code does not yet support checksum offload, or TSO in conjunction with the ipsec offload - those will be added in the future. This code shows improvements in both packet throughput and CPU utilization. For example, here are some quicky numbers that show the magnitude of the performance gain on a single run of "iperf -c <dest>" with the ipsec offload on both ends of a point-to-point connection: 9.4 Gbps - normal case 7.6 Gbps - ipsec with offload 343 Mbps - ipsec no offload ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents c89b517 + 85bc266 commit 0542e13

File tree

8 files changed

+1116
-23
lines changed

8 files changed

+1116
-23
lines changed

drivers/net/ethernet/intel/ixgbe/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ ixgbe-$(CONFIG_IXGBE_DCB) += ixgbe_dcb.o ixgbe_dcb_82598.o \
4242
ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o
4343
ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o
4444
ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o
45+
ixgbe-$(CONFIG_XFRM_OFFLOAD) += ixgbe_ipsec.o

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

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#ifdef CONFIG_IXGBE_DCA
5353
#include <linux/dca.h>
5454
#endif
55+
#include "ixgbe_ipsec.h"
5556

5657
#include <net/xdp.h>
5758
#include <net/busy_poll.h>
@@ -171,10 +172,11 @@ enum ixgbe_tx_flags {
171172
IXGBE_TX_FLAGS_CC = 0x08,
172173
IXGBE_TX_FLAGS_IPV4 = 0x10,
173174
IXGBE_TX_FLAGS_CSUM = 0x20,
175+
IXGBE_TX_FLAGS_IPSEC = 0x40,
174176

175177
/* 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,
178180
};
179181

180182
/* VLAN info */
@@ -629,15 +631,18 @@ struct ixgbe_adapter {
629631
#define IXGBE_FLAG2_EEE_CAPABLE BIT(14)
630632
#define IXGBE_FLAG2_EEE_ENABLED BIT(15)
631633
#define IXGBE_FLAG2_RX_LEGACY BIT(16)
634+
#define IXGBE_FLAG2_IPSEC_ENABLED BIT(17)
632635

633636
/* Tx fast path data */
634637
int num_tx_queues;
635638
u16 tx_itr_setting;
636639
u16 tx_work_limit;
640+
u64 tx_ipsec;
637641

638642
/* Rx fast path data */
639643
int num_rx_queues;
640644
u16 rx_itr_setting;
645+
u64 rx_ipsec;
641646

642647
/* Port number used to identify VXLAN traffic */
643648
__be16 vxlan_port;
@@ -781,6 +786,10 @@ struct ixgbe_adapter {
781786

782787
#define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */
783788
u32 *rss_key;
789+
790+
#ifdef CONFIG_XFRM
791+
struct ixgbe_ipsec *ipsec;
792+
#endif /* CONFIG_XFRM */
784793
};
785794

786795
static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)
@@ -1011,4 +1020,24 @@ void ixgbe_store_key(struct ixgbe_adapter *adapter);
10111020
void ixgbe_store_reta(struct ixgbe_adapter *adapter);
10121021
s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
10131022
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 */
10141043
#endif /* _IXGBE_H_ */

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = {
115115
{"tx_hwtstamp_timeouts", IXGBE_STAT(tx_hwtstamp_timeouts)},
116116
{"tx_hwtstamp_skipped", IXGBE_STAT(tx_hwtstamp_skipped)},
117117
{"rx_hwtstamp_cleared", IXGBE_STAT(rx_hwtstamp_cleared)},
118+
{"tx_ipsec", IXGBE_STAT(tx_ipsec)},
119+
{"rx_ipsec", IXGBE_STAT(rx_ipsec)},
118120
#ifdef IXGBE_FCOE
119121
{"fcoe_bad_fccrc", IXGBE_STAT(stats.fccrc)},
120122
{"rx_fcoe_dropped", IXGBE_STAT(stats.fcoerpdc)},

0 commit comments

Comments
 (0)