Bug 11451 - Poor SMB3 encryption performance with AES-GCM
Summary: Poor SMB3 encryption performance with AES-GCM
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.3.0rc1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 11286
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-17 06:48 UTC by Stefan Metzmacher
Modified: 2021-02-11 14:14 UTC (History)
7 users (show)

See Also:


Attachments
Patches for v4-3-test (part1) (3.24 KB, patch)
2015-08-17 19:59 UTC, Stefan Metzmacher
slow: review+
vl: review+
metze: review? (obnox)
Details
Patches for v4-3-test (part2) (88.15 KB, patch)
2015-08-28 08:25 UTC, Stefan Metzmacher
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Metzmacher 2015-08-17 06:48:00 UTC
The performance using aes-gcm for SMB3 encryption is very poor compared to
aes-ccm. (Using our software implenentation is both cases).

Callgrind showed that we use 28,165,720,719 cpu cycles to deliver
a 100MB file to a client using aes-ccm.

With aes-gcm this is raises up to 723,094,413,831 cpu cycles.

As a reference copying without signing or encryption uses
just 134,264,902 cpu cycles. And signing with aes-cmac uses
13,321,036,015 cycles. While SMB2 signing with sha256 uses
14,124,659,113 cycles.

We should optimize the aes-{cmac,ccm,gcm} software implementions.
The most problematic parts are the xor and right- and leftshift
implementations.

As it seems that software aes-gcm will still be much slower than
software aes-ccm, we should disable aes-gcm support for 4.3.0.
Comment 1 Stefan Metzmacher 2015-08-17 16:23:04 UTC
The real solution will be usage of hardware encryption (aesni) on modern CPUs.
See bug #11286.
Comment 2 Stefan Metzmacher 2015-08-17 19:59:53 UTC
Created attachment 11346 [details]
Patches for v4-3-test (part1)
Comment 3 Stefan Metzmacher 2015-08-17 20:06:55 UTC
Pushed to autobuild-v4-3-test
Comment 4 Stefan Metzmacher 2015-08-18 11:34:47 UTC
Pushed part1 to v4-3-test
Comment 5 Stefan Metzmacher 2015-08-28 08:25:44 UTC
Created attachment 11374 [details]
Patches for v4-3-test (part2)
Comment 6 Jeremy Allison 2015-08-28 16:20:53 UTC
Comment on attachment 11374 [details]
Patches for v4-3-test (part2)

LGTM.
Comment 7 Jeremy Allison 2015-08-28 16:21:18 UTC
Re-assigning to Karolin for inclusion in 4.3.0.
Comment 8 Stefan Metzmacher 2015-08-31 08:15:01 UTC
Pushed to autobuild-v4-3-test
Comment 9 Stefan Metzmacher 2015-08-31 11:41:30 UTC
Part2 pushed to v4-3-test.