From: Timo Teras <timo.teras@iki.fi>
To: netdev@vger.kernel.org
Subject: ipsec smp scalability and cpu use fairness (softirqs)
Date: Mon, 12 Aug 2013 16:01:42 +0300 [thread overview]
Message-ID: <20130812160142.71737a95@vostro> (raw)
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?
next reply other threads:[~2013-08-12 13:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 13:01 Timo Teras [this message]
2013-08-12 21:58 ` ipsec smp scalability and cpu use fairness (softirqs) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130812160142.71737a95@vostro \
--to=timo.teras@iki.fi \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).