All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 next-queue 00/10] ixgbe: Add ipsec offload
@ 2017-12-19 23:59 ` Shannon Nelson
  0 siblings, 0 replies; 50+ messages in thread
From: Shannon Nelson @ 2017-12-19 23:59 UTC (permalink / raw)
  To: intel-wired-lan, jeffrey.t.kirsher
  Cc: steffen.klassert, sowmini.varadhan, netdev

This is an implementation of the ipsec hardware offload feature for
the ixgbe driver and Intel's 10Gbe series NICs: x540, x550, 82599.
These patches apply to net-next v4.14 as well as Jeff Kirsher's next-queue
v4.15-rc1-206-ge47375b.

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 IPv6,
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

To set up a similar test case, you first need to be sure you have a recent
version of iproute2 that supports the ipsec offload tag, probably something
from ip 4.12 or newer would be best.  I have a shell script that builds
up the appropriate commands for me, but here are the resulting commands
for all tcp traffic between 14.0.0.52 and 14.0.0.70:

For the left side (14.0.0.52):
  ip x p add dir out src 14.0.0.52/24 dst 14.0.0.70/24 proto tcp tmpl \
     proto esp src 14.0.0.52 dst 14.0.0.70 spi 0x07 mode transport reqid 0x07
  ip x p add dir in src 14.0.0.70/24 dst 14.0.0.52/24 proto tcp tmpl \
     proto esp dst 14.0.0.52 src 14.0.0.70 spi 0x07 mode transport reqid 0x07
  ip x s add proto esp src 14.0.0.52 dst 14.0.0.70 spi 0x07 mode transport \
     reqid 0x07 replay-window 32 \
     aead 'rfc4106(gcm(aes))' 0x44434241343332312423222114131211f4f3f2f1 128 \
     sel src 14.0.0.52/24 dst 14.0.0.70/24 proto tcp offload dev eth4 dir out
  ip x s add proto esp dst 14.0.0.52 src 14.0.0.70 spi 0x07 mode transport \
     reqid 0x07 replay-window 32 \
     aead 'rfc4106(gcm(aes))' 0x44434241343332312423222114131211f4f3f2f1 128 \
     sel src 14.0.0.70/24 dst 14.0.0.52/24 proto tcp offload dev eth4 dir in
 
For the right side (14.0.0.70):
  ip x p add dir out src 14.0.0.70/24 dst 14.0.0.52/24 proto tcp tmpl \
     proto esp src 14.0.0.70 dst 14.0.0.52 spi 0x07 mode transport reqid 0x07
  ip x p add dir in src 14.0.0.52/24 dst 14.0.0.70/24 proto tcp tmpl \
     proto esp dst 14.0.0.70 src 14.0.0.52 spi 0x07 mode transport reqid 0x07
  ip x s add proto esp src 14.0.0.70 dst 14.0.0.52 spi 0x07 mode transport \
     reqid 0x07 replay-window 32 \
     aead 'rfc4106(gcm(aes))' 0x44434241343332312423222114131211f4f3f2f1 128 \
     sel src 14.0.0.70/24 dst 14.0.0.52/24 proto tcp offload dev eth4 dir out
  ip x s add proto esp dst 14.0.0.70 src 14.0.0.52 spi 0x07 mode transport \
     reqid 0x07 replay-window 32 \
     aead 'rfc4106(gcm(aes))' 0x44434241343332312423222114131211f4f3f2f1 128 \
     sel src 14.0.0.52/24 dst 14.0.0.70/24 proto tcp offload dev eth4 dir in

In both cases, the command "ip x s flush ; ip x p flush" will clean
it all out and remove the offloads.

Lastly, thanks to Alex Duyck for his early comments.

Please see the individual patches for specific update info.

v3: fixes after comments from those wonderfully pesky kbuild robots
v2: fixes after comments from Alex

Shannon Nelson (10):
  ixgbe: clean up ipsec defines
  ixgbe: add ipsec register access routines
  ixgbe: add ipsec engine start and stop routines
  ixgbe: add ipsec data structures
  ixgbe: add ipsec offload add and remove SA
  ixgbe: restore offloaded SAs after a reset
  ixgbe: process the Rx ipsec offload
  ixgbe: process the Tx ipsec offload
  ixgbe: ipsec offload stats
  ixgbe: register ipsec offload with the xfrm subsystem

 drivers/net/ethernet/intel/ixgbe/Makefile        |   1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe.h         |  33 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |   2 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c   | 923 +++++++++++++++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h   |  92 +++
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c     |   4 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    |  39 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h    |  22 +-
 8 files changed, 1093 insertions(+), 23 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
 create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.h

-- 
2.7.4

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2018-01-03 22:33 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-19 23:59 [PATCH v3 next-queue 00/10] ixgbe: Add ipsec offload Shannon Nelson
2017-12-19 23:59 ` [Intel-wired-lan] " Shannon Nelson
2017-12-19 23:59 ` [PATCH v3 next-queue 01/10] ixgbe: clean up ipsec defines Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:27   ` Bowers, AndrewX
2017-12-19 23:59 ` [PATCH v3 next-queue 02/10] ixgbe: add ipsec register access routines Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:28   ` Bowers, AndrewX
2017-12-19 23:59 ` [PATCH v3 next-queue 03/10] ixgbe: add ipsec engine start and stop routines Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:28   ` Bowers, AndrewX
2017-12-19 23:59 ` [PATCH v3 next-queue 04/10] ixgbe: add ipsec data structures Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:29   ` Bowers, AndrewX
2017-12-19 23:59 ` [PATCH v3 next-queue 05/10] ixgbe: add ipsec offload add and remove SA Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2017-12-21  1:17   ` Marcelo Ricardo Leitner
2017-12-21  1:17     ` [Intel-wired-lan] " Marcelo Ricardo Leitner
2017-12-21  1:39     ` Shannon Nelson
2017-12-21  1:39       ` [Intel-wired-lan] " Shannon Nelson
2017-12-21  2:21       ` Marcelo Ricardo Leitner
2017-12-21  2:21         ` [Intel-wired-lan] " Marcelo Ricardo Leitner
2017-12-21  3:30         ` Shannon Nelson
2017-12-21  3:30           ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:30   ` Bowers, AndrewX
2017-12-19 23:59 ` [PATCH v3 next-queue 06/10] ixgbe: restore offloaded SAs after a reset Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:30   ` Bowers, AndrewX
2017-12-19 23:59 ` [PATCH v3 next-queue 07/10] ixgbe: process the Rx ipsec offload Shannon Nelson
2017-12-19 23:59   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:31   ` Bowers, AndrewX
2017-12-20  0:00 ` [PATCH v3 next-queue 08/10] ixgbe: process the Tx " Shannon Nelson
2017-12-20  0:00   ` [Intel-wired-lan] " Shannon Nelson
2017-12-22  8:24   ` Yanjun Zhu
2017-12-22  8:24     ` [Intel-wired-lan] " Yanjun Zhu
2017-12-22 22:33     ` Shannon Nelson
2017-12-22 22:33       ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:32   ` Bowers, AndrewX
2017-12-20  0:00 ` [PATCH v3 next-queue 09/10] ixgbe: ipsec offload stats Shannon Nelson
2017-12-20  0:00   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:32   ` Bowers, AndrewX
2017-12-20  0:00 ` [PATCH v3 next-queue 10/10] ixgbe: register ipsec offload with the xfrm subsystem Shannon Nelson
2017-12-20  0:00   ` [Intel-wired-lan] " Shannon Nelson
2018-01-03 22:33   ` Bowers, AndrewX
2017-12-21  6:39 ` [PATCH v3 next-queue 00/10] ixgbe: Add ipsec offload Yanjun Zhu
2017-12-21  6:39   ` [Intel-wired-lan] " Yanjun Zhu
2017-12-21  7:09   ` Yanjun Zhu
2017-12-21  7:09     ` [Intel-wired-lan] " Yanjun Zhu
2017-12-21 17:55     ` Shannon Nelson
2017-12-21 17:55       ` [Intel-wired-lan] " Shannon Nelson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.