meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hw:nsa310:encrypted_fs [2020/07/03 09:43]
niziak ↷ Page moved from nsa310:encrypted_fs to hw:nsa310:encrypted_fs
hw:nsa310:encrypted_fs [2021/01/20 19:35] (current)
niziak
Line 11: Line 11:
 NOTE: From Kernel 4.2 cesa driver was completely rewritten to support DMA, and old **mv_cesa** driver was removed in kernel 4.15 NOTE: From Kernel 4.2 cesa driver was completely rewritten to support DMA, and old **mv_cesa** driver was removed in kernel 4.15
  
 +===== Kernel 3.18 =====
  
 <​code>​ <​code>​
Line 22: Line 23:
   - cbc(aes)   - cbc(aes)
   - ecb(aes)   - ecb(aes)
 +  - 
  
 There are also additional kernel modules optimised for ARM:  There are also additional kernel modules optimised for ARM: 
Line 27: Line 29:
   - aes_arm   - aes_arm
  
 +===== Kernel 5.8 =====
 +
 +<​code>​
 +modprobe mv_cesa
 +cat /​proc/​crypto | grep cesa -B 2 -A 7
 +</​code>​
 +
 +Is providing:
 +  - hmac(sha1)
 +  - hmac(md5)
 +  - sha1
 +  - md5
 +  - cbc(aes)
 +  - ecb(aes)
 +  - cbc(des3_ede)
 +  - ecb(des3_ede)
 +  - cbc(des)
 +  - ecb(des)
 +
 +There are also additional kernel modules optimised for ARM: 
 +  - sha1_arm
 +  - aes_arm
 +
 +==== fio benchmark ====
 +
 +CESA 4kB:
 +<​code>​
 +   READ: bw=479KiB/s (491kB/s), 479KiB/​s-479KiB/​s (491kB/​s-491kB/​s),​ io=384MiB (403MB), run=820117-820117msec
 +  WRITE: bw=160KiB/s (164kB/s), 160KiB/​s-160KiB/​s (164kB/​s-164kB/​s),​ io=128MiB (134MB), run=820117-820117msec
 +</​code>​
 +
 +CESA 64kB:
 +<​code>​
 +   READ: bw=5663KiB/​s (5799kB/s), 5663KiB/​s-5663KiB/​s (5799kB/​s-5799kB/​s),​ io=382MiB (400MB), run=69037-69037msec
 +  WRITE: bw=1931KiB/​s (1977kB/s), 1931KiB/​s-1931KiB/​s (1977kB/​s-1977kB/​s),​ io=130MiB (137MB), run=69037-69037msec
 +</​code>​
 +
 +ARM 4kB:
 +<​code>​
 +   READ: bw=478KiB/s (490kB/s), 478KiB/​s-478KiB/​s (490kB/​s-490kB/​s),​ io=384MiB (403MB), run=822072-822072msec
 +  WRITE: bw=159KiB/s (163kB/s), 159KiB/​s-159KiB/​s (163kB/​s-163kB/​s),​ io=128MiB (134MB), run=822072-822072msec
 +</​code>​
 +
 +ARM 64kB:
 +<​code>​
 +   READ: bw=5622KiB/​s (5757kB/s), 5622KiB/​s-5622KiB/​s (5757kB/​s-5757kB/​s),​ io=382MiB (400MB), run=69540-69540msec
 +  WRITE: bw=1917KiB/​s (1963kB/s), 1917KiB/​s-1917KiB/​s (1963kB/​s-1963kB/​s),​ io=130MiB (137MB), run=69540-69540msec
 +</​code>​
 +
 +===== Benchmark =====
  
 <​code>​ <​code>​
Line 32: Line 84:
 </​code>​ </​code>​
  
-^  Algorithm ​ ^ Key  ^  Encryption ​  ​^ ​ Decryption ​ ^  accel  ^ +^  Algorithm ​ ^ Key  ^  Encryption ​  ​^ ​ Decryption ​ ^  accel  ​^ kernel ​
-^     ​aes-cbc | 128b |  12.8 MiB/s   ​| ​ 13.4 MiB/s  |         | +^     ​aes-cbc | 128b |  12.8 MiB/s   ​| ​ 13.4 MiB/s  |         |  3.18  ​
-^             ​| ​     |  13.4 MiB/s   ​| ​ 14.1 MiB/s  |  arm    | +^             ​| ​     |  13.4 MiB/s   ​| ​ 14.1 MiB/s  |  arm    ​|  3.18  ​
-^             ​| ​     |**19.7 MiB/s** |**20.2 MiB/​s**| ​ mv_cesa| +^             ​| ​     |**19.7 MiB/s** |**20.2 MiB/​s**| ​ mv_cesa ​ ​| ​ 3.18  | 
-^ serpent-cbc | 128b |  11.1 MiB/s   ​| ​ 11.6 MiB/s  |         | +^             ​| ​     |**34,9 MiB/s** |**36.2 MiB/​s**| ​  ​marvell_cesa ​  ​| ​ 5.8  ​
-^ twofish-cbc | 128b |  13.0 MiB/s   ​| ​ 13.4 MiB/s  |         | +^ serpent-cbc | 128b |  11.1 MiB/s   ​| ​ 11.6 MiB/s  |         |  3.18  ​
-^     ​aes-cbc | 256b |  10.1 MiB/s   ​| ​ 10.5 MiB/s  |         | +^ twofish-cbc | 128b |  13.0 MiB/s   ​| ​ 13.4 MiB/s  |         |  3.18  ​
-^             ​| ​     |  11.0 MiB/s   ​| ​ 11.4 MiB/s  |  arm    | +^     ​aes-cbc | 256b |  10.1 MiB/s   ​| ​ 10.5 MiB/s  |         |  3.18  ​
-^             ​| ​     |**18.9 MiB/s** |**19.2 MiB/​s**| ​ mv_cesa| +^             ​| ​     |  11.0 MiB/s   ​| ​ 11.4 MiB/s  |  arm    ​|  3.18  ​
-^ serpent-cbc | 256b |  11.1 MiB/s   ​| ​ 11.6 MiB/s  |         | +^             ​| ​     |**18.9 MiB/s** |**19.2 MiB/​s**| ​ mv_cesa ​ ​| ​ 3.18  | 
-^ twofish-cbc | 256b |  13.0 MiB/s   ​| ​ 13.4 MiB/s  |         | +^             ​| ​     |**32.0 MiB/s** |**33.1 MiB/​s**| ​ marvell_cesa ​ |  5.8  ​
-^     ​aes-xts | 256b |  13.1 MiB/s   ​| ​ 13.3 MiB/s  |         | +^ serpent-cbc | 256b |  11.1 MiB/s   ​| ​ 11.6 MiB/s  |         |  3.18  ​
-^             ​| ​     |  14.6 MiB/s   ​| ​ 14.7 MiB/s  |  arm    | +^ twofish-cbc | 256b |  13.0 MiB/s   ​| ​ 13.4 MiB/s  |         |  3.18  ​
-^ serpent-xts | 256b |  11.5 MiB/s   ​| ​ 11.6 MiB/s  |         | +^     ​aes-xts | 256b |  13.1 MiB/s   ​| ​ 13.3 MiB/s  |         |  3.18  ​
-^ twofish-xts | 256b |  13.4 MiB/s   ​| ​ 13.2 MiB/s  |         | +^             ​| ​     |  14.6 MiB/s   ​| ​ 14.7 MiB/s  |  arm    ​|  3.18  | 
-^     ​aes-xts | 512b |  10.2 MiB/s   ​| ​ 10.4 MiB/s  |         | +^             ​| ​     |**23.6 MiB/s** |**22.5 MiB/​s**| ​ marvell_cesa ​ |  5.8  ​
-^             ​| ​     |  11.4 MiB/s   ​| ​ 11.8 MiB/s  |  arm    | +^ serpent-xts | 256b |  11.5 MiB/s   ​| ​ 11.6 MiB/s  |         |  3.18  ​
-^ serpent-xts | 512b |  11.5 MiB/s   ​| ​ 11.6 MiB/s  |         |  +^ twofish-xts | 256b |  13.4 MiB/s   ​| ​ 13.2 MiB/s  |         |  3.18  ​
-^ twofish-xts | 512b |  13.4 MiB/s   ​| ​ 13.2 MiB/s  |         |+^     ​aes-xts | 512b |  10.2 MiB/s   ​| ​ 10.4 MiB/s  |         |  3.18  ​
 +^             ​| ​     |  11.4 MiB/s   ​| ​ 11.8 MiB/s  |  arm    ​|  3.18  | 
 +^             ​| ​     |**22.5 MiB/s** |**23.1 MiB/​s**| ​ marvell_cesa ​ |  5.8  ​
 +^ serpent-xts | 512b |  11.5 MiB/s   ​| ​ 11.6 MiB/s  |         |  3.18  ​
 +^ twofish-xts | 512b |  13.4 MiB/s   ​| ​ 13.2 MiB/s  |         |  3.18  ​|
  
 ===== Ciphers benchmark ===== ===== Ciphers benchmark =====
Line 178: Line 234:
  
 ====== SSH performance ====== ====== SSH performance ======
 +
 Enable low complexity ciphers if device is used locally. Enable low complexity ciphers if device is used locally.
 <code bash>ssh -Q cipher localhost | paste -d , -s</​code>​ <code bash>ssh -Q cipher localhost | paste -d , -s</​code>​
Line 186: Line 243:
 </​file>​ </​file>​
  
-^  cmd                    ^ performance ^  time  ^ +^  cmd                        ^ performance ^  time  ​^ Kernel 5.8   
-| (default) ​             |   ​3.1MB/​s ​  ​| ​       | +| (default) ​                  ​|   ​3.1MB/​s ​  ​| ​       ​|              ​
-| 3des-cbc ​              ​|   ​1.2MB/​s ​  ​| ​ 1m28  | +| 3des-cbc ​                   |   ​1.2MB/​s ​  ​| ​ 1m28  ​| ​  67.9 MB/s  | 
-| blowfish-cbc ​          ​|   ​3.3MB/​s ​  ​| ​ 0m30  | +| blowfish-cbc ​               |   ​3.3MB/​s ​  ​| ​ 0m30  ​| ​ 245.7 MB/s  | 
-| cast128-cbc ​           |   ​2.9MB/​s ​  ​| ​ 0m34  | +| cast128-cbc ​                ​|   ​2.9MB/​s ​  ​| ​ 0m34  ​| ​ 248.8 MB/s  | 
-| arcfour ​               |   ​4.2MB/​s ​  ​| ​ 0m24  | +| arcfour ​                    ​|   ​4.2MB/​s ​  ​| ​ 0m24  ​| ​ 425.5 MB/s  | 
-| arcfour128 ​            ​|    -//-     ​| ​ -//-  | +| arcfour128 ​                 |    -//-     ​| ​ -//-  ​| ​ 395.3 MB/s  | 
-| **arcfour256** ​        ​|   ​4.6MB/​s ​  ​| ​ 0m22  | +| **arcfour256** ​             |   ​4.6MB/​s ​  ​| ​ 0m22  ​| ​ 425.5 MB/s  | 
-| aes128-cbc ​            ​|   ​2.8MB/​s ​  ​| ​ 0m37  | +| aes128-cbc ​                 |   ​2.8MB/​s ​  ​| ​ 0m37  ​| ​ 228.8 MB/s  | 
-| aes192-cbc ​            ​|   ​2.9MB/​s ​  ​| ​ 0m34  | +| aes192-cbc ​                 |   ​2.9MB/​s ​  ​| ​ 0m34  ​| ​ 211.4 MB/s  | 
-| aes256-cbc ​                 |  2.5MB/​s ​   |  0m40  | +| aes256-cbc ​                 |  2.5MB/​s ​   |  0m40  ​| ​ 192.3 MB/s  | 
-| rijndael-cbc@lysator.liu.se |  2.8MB/​s ​   |  0m36  | +| rijndael-cbc@lysator.liu.se |  2.8MB/​s ​   |  0m36  ​| ​ 192.3 MB/s  | 
-| aes128-ctr ​                 |  2.9MB/​s ​   |  0m35  | +| aes128-ctr ​                 |  2.9MB/​s ​   |  0m35  ​| ​ 223.2 MB/s  | 
-| aes192-ctr ​                 |  2.9MB/​s ​   |  0m35  | +| aes192-ctr ​                 |  2.9MB/​s ​   |  0m35  ​| ​ 202.8 MB/s  | 
-| aes256-ctr ​                 |  2.9MB/​s ​   |  0m40  | +| aes256-ctr ​                 |  2.9MB/​s ​   |  0m40  ​| ​ 191.6 MB/s  | 
-| aes128-gcm@openssh.com ​     |  2.6MB/​s ​   |  0m39  | +| aes128-gcm@openssh.com ​     |  2.6MB/​s ​   |  0m39  ​| ​ 170.7 MB/s  | 
-| aes256-gcm@openssh.com ​        ​| ​ 2.2MB/​s ​   |  0m47  | +| aes256-gcm@openssh.com ​        ​| ​ 2.2MB/​s ​ |  0m47  ​| ​ 151.7 MB/s  | 
-| chacha20-poly1305@openssh.com ​ |  3.2MB/​s ​   |  0m32  |+| chacha20-poly1305@openssh.com ​ |  3.2MB/​s ​ |  0m32  ​| ​ 268.8 MB/s  |
  
 +====== fsck performance ======
 +    * Kernel 5.8 CESA: user 1m32,​738s ​ sys 0m9,​904s
 +    * Kernel 5.8 ARM: user 1m32,​642s ​ sys 0m9,​177s
 +
 +====== Rsync with SSH tunnell performance ======
 +When rsyncing huge file, to use delta transfers, rsync needs to scan file to make checksums. ​
 +
 +===== Kernel 5.8 ARM =====
 +<​code>​
 +    134,​113,​800 ​  ​1% ​   7.99MB/​s ​   0:​16:​11  ​
 +    142,​909,​200 ​  ​1% ​   8.04MB/​s ​   0:​16:​03  ​
 +    151,​768,​800 ​  ​1% ​   8.33MB/​s ​   0:​15:​29  ​
 +    159,​151,​800 ​  ​1% ​   8.11MB/​s ​   0:​15:​53  ​
 +    175,​715,​400 ​  ​2% ​   7.74MB/​s ​   0:​16:​36  ​
 +    192,​664,​200 ​  ​2% ​   7.86MB/​s ​   0:​16:​20  ​
 +    200,​111,​400 ​  ​2% ​   7.61MB/​s ​   0:​16:​50  ​
 +    217,​060,​200 ​  ​2% ​   7.63MB/​s ​   0:​16:​45  ​
 +    234,​715,​200 ​  ​2% ​   8.19MB/​s ​   0:​15:​34  ​
 +    243,​382,​200 ​  ​3% ​   8.17MB/​s ​   0:​15:​37  ​
 +    250,​572,​600 ​  ​3% ​   7.94MB/​s ​   0:​16:​02  ​
 +    259,​432,​200 ​  ​3% ​   7.98MB/​s ​   0:​15:​57  ​
 +    268,​227,​600 ​  ​3% ​   7.98MB/​s ​   0:​15:​55  ​
 +    334,​674,​600 ​  ​4% ​   8.19MB/​s ​   0:​15:​24  ​
 +
 +%Cpu(s): 50,0 us, 50,0 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +32375 root      20   ​0 ​      ​0 ​     0      0 R  63,2   ​0,​0 ​  ​1:​14.38 kworker/​u2:​3-kcryptd/​253:​0 ​                                                                                                                   ​
 +16281 root      20   ​0 ​  ​14808 ​  ​6600 ​  3028 R  36,8   ​2,​7 ​  ​0:​04.58 rsync                                                                                                                                         
 +
 +%Cpu(s): 30,8 us, 65,4 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  3,8 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +16360 root      20   ​0 ​      ​0 ​     0      0 R  57,1   ​0,​0 ​  ​0:​00.35 kworker/​u2:​1+kcryptd/​253:​0 ​                                                                                                                   ​
 +16281 root      20   ​0 ​  ​14808 ​  ​6604 ​  3028 D  28,6   ​2,​7 ​  ​0:​06.54 rsync                                                                                                                                         
 +    ​
 +%Cpu(s): 29,0 us, 71,0 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +16360 root      20   ​0 ​      ​0 ​     0      0 R  58,3   ​0,​0 ​  ​0:​01.74 kworker/​u2:​1+kcryptd/​253:​0 ​                                                                                                                   ​
 +16281 root      20   ​0 ​  ​14808 ​  ​6604 ​  3028 R  29,2   ​2,​7 ​  ​0:​07.24 rsync                                                                                                                                           
 +
 +%Cpu(s): 26,9 us, 73,1 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +31416 root      20   ​0 ​      ​0 ​     0      0 R  50,0   ​0,​0 ​  ​0:​06.85 kworker/​u2:​2+kcryptd/​253:​0 ​                                                                                                                   ​
 +16281 root      20   ​0 ​  ​14808 ​  ​6608 ​  3028 D  27,3   ​2,​7 ​  ​0:​08.21 rsync                                                                                                                                         
 +
 +%Cpu(s): 33,3 us, 66,7 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +16360 root      20   ​0 ​      ​0 ​     0      0 R  63,6   ​0,​0 ​  ​0:​08.34 kworker/​u2:​1+kcryptd/​253:​0 ​                                                                                                                   ​
 +16281 root      20   ​0 ​  ​14808 ​  ​6612 ​  3028 R  27,3   ​2,​7 ​  ​0:​10.61 rsync                                                                                                                                                                 
 +</​code>​
 +
 +===== Kernel 5.8 CESA =====
 +<​code>​
 +    178,​540,​200 ​  ​2% ​   7.46MB/​s ​   0:​17:​15  ​
 +    185,​987,​400 ​  ​2% ​   7.35MB/​s ​   0:​17:​29  ​
 +    209,​613,​000 ​  ​2% ​   7.39MB/​s ​   0:​17:​20  ​
 +    271,​758,​600 ​  ​3% ​   7.30MB/​s ​   0:​17:​24  ​
 +    287,​680,​200 ​  ​3% ​   7.31MB/​s ​   0:​17:​20  ​
 +    334,​995,​600 ​  ​4% ​   7.30MB/​s ​   0:​17:​16  ​
 +    358,​300,​200 ​  ​4% ​   7.41MB/​s ​   0:​16:​57  ​
 +    761,​026,​800 ​  ​9% ​   7.07MB/​s ​   0:​16:​51  ​
 +    769,​051,​800 ​  ​9% ​   7.15MB/​s ​   0:​16:​38  ​
 +    777,​397,​800 ​  ​9% ​   7.40MB/​s ​   0:16:03
 +    ​
 +%Cpu(s): 31,3 us, 68,1 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,6 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +29705 root      20   ​0 ​      ​0 ​     0      0 R  34,4   ​0,​0 ​  ​1:​40.62 kworker/​u2:​0+kcryptd/​253:​0 ​                                                                                                                   ​
 +30062 root     ​-51 ​  ​0 ​      ​0 ​     0      0 S  32,5   ​0,​0 ​  ​1:​10.38 irq/​29-f1030000 ​                                                                                                                              
 +32091 root      20   ​0 ​  ​14808 ​  ​6516 ​  2908 D  28,7   ​2,​7 ​  ​0:​24.76 rsync                                                                                                                                         
 +   
 +%Cpu(s): 36,4 us, 63,6 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +29705 root      20   ​0 ​      ​0 ​     0      0 R  28,0   ​0,​0 ​  ​1:​41.40 kworker/​u2:​0+kcryptd/​253:​0 ​                                                                                                                   ​
 +30062 root     ​-51 ​  ​0 ​      ​0 ​     0      0 S  28,0   ​0,​0 ​  ​1:​11.12 irq/​29-f1030000 ​                                                                                                                              
 +32091 root      20   ​0 ​  ​14808 ​  ​6516 ​  2908 D  24,0   ​2,​7 ​  ​0:​25.41 rsync       
 +
 +%Cpu(s): 26,5 us, 73,5 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +29705 root      20   ​0 ​      ​0 ​     0      0 R  30,8   ​0,​0 ​  ​1:​42.31 kworker/​u2:​0+kcryptd/​253:​0 ​                                                                                                                   ​
 +30062 root     ​-51 ​  ​0 ​      ​0 ​     0      0 S  26,9   ​0,​0 ​  ​1:​11.98 irq/​29-f1030000 ​                                                                                                                              
 +32091 root      20   ​0 ​  ​14808 ​  ​6520 ​  2908 D  19,2   ​2,​7 ​  ​0:​26.17 rsync                                                                                                                                         
 +
 +%Cpu(s): 29,0 us, 71,0 sy,  0,0 ni,  0,0 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                                                                                                                      
 +29705 root      20   ​0 ​      ​0 ​     0      0 R  25,9   ​0,​0 ​  ​1:​42.76 kworker/​u2:​0+kcryptd/​253:​0 ​                                                                                                                   ​
 +30062 root     ​-51 ​  ​0 ​      ​0 ​     0      0 S  22,2   ​0,​0 ​  ​1:​12.41 irq/​29-f1030000 ​                                                                                                                              
 +32091 root      20   ​0 ​  ​14808 ​  ​6520 ​  2908 D  18,5   ​2,​7 ​  ​0:​26.54 rsync                                                                                                                                         
 +</​code>​