netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ipsec smp scalability and cpu use fairness (softirqs)
@ 2013-08-12 13:01 Timo Teras
  2013-08-12 21:58 ` Andrew Collins
  0 siblings, 1 reply; 12+ messages in thread
From: Timo Teras @ 2013-08-12 13:01 UTC (permalink / raw)
  To: netdev

Hi,

I've been recently doing some ipsec benchmarking, and analysis on
system running out of cpu power. The setup is dmvpn gateway
(gre+xfrm+opennhrp) with traffic in forward path.

The system I have been using are VIA Nano (Padlock aes/sha accel) and
Intel Xeon (aes-ni and ssse3 sha1) based. In both setups the crypto
happens synchronously using special opcodes, or assembly implementation
of the algorithm.

It seems that the combination of softirq, napi and synchronous crypto
causes two problems.

1. Single core systems that are going out of cpu power, are
overwhelmed in uncontrollable manner. As softirq is doing the heavy
lifting, the user land processes are starved first. This can cause
userland IKE daemon to starve and lose tunnels when it is unable to
answer liveliness checks. The quick workaround is to setup traffic
shaping for the encrypted traffic.

2. On multicore (6-12 cores) systems, it would appear that it is not
easy to distribute the ipsec to multiple cores. as softirq is sticky to
the cpu where it was raised. The ipsec decryption/encryption is done
synchronously in the napi poll loop, and the throughput is limited by
one cpu. If the NIC supports multiple queues and balancing with ESP
SPI, we can use that to get some parallelism.

Fundamentally, both problems arise because synchronous crypto happens in
the softirq context. I'm wondering if it would make sense to execute
the synchronous crypto in low-priority per-xfrm_state workqueue or
similar.

Any suggestions or comments?

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

end of thread, other threads:[~2013-08-20  6:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 13:01 ipsec smp scalability and cpu use fairness (softirqs) Timo Teras
2013-08-12 21:58 ` Andrew Collins
2013-08-13  6:23   ` Timo Teras
2013-08-13  7:46     ` Steffen Klassert
2013-08-13  7:57       ` Timo Teras
2013-08-13 10:45         ` Steffen Klassert
2013-08-13 11:33           ` Timo Teras
2013-08-13 11:56             ` Steffen Klassert
2013-08-13 12:41               ` Timo Teras
2013-08-20  6:19                 ` Steffen Klassert
2013-08-20  6:39                   ` Timo Teras
2013-08-20  6:17         ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).