intel/intel-ipsec-mb

AESNI emulation code not to be compiled in by default

Closed this issue · 6 comments

AESNI emulation implementations are based on the SSE ones. They replace AESNI and PCLMULQDQ instructions with adequate macros. This method of supporting platforms without these CPU extensions is simple and functional. However, it significantly increases library footprint and compilation time. Most users don't need this functionality anyway.

The plan is to:

  • disable compilation of AESNI emulation code by default
  • add a new compile option to include it as required

Any concerns then please let us know here.

closing this announcement

Hi @tkanteck, not sure if this is the best place to discuss the following: I am facing an issue where the application using this library segfaults due to the host's CPU lack of AES-NI instruction set. Is there any specific compile option to build also the "software" AES-NI emulation? FYI, I'm using this library indirectly via DPDK's AES-NI PMD, do you happen to know if there would be any code change required in the DPDK PMD or should I better ask this in the dpdk mailing list?

Thanks in advance

Hi @pa5h1nh0. You should compile with "AESNI_EMU=y". Re DPDK, I don't think any changes are required.

Hi @pablodelara, thanks for replying. Does this mean that I'd need to build two DPDK libraries? One for hosts supporting the AES-NI instruction set (so with "AESNI_EMU=n"), and one for hosts without it (i.e. with "AESNI_EMU=y")?

Hi @pa5h1nh0. No, when AESNI_EMU=y, everything is supported. For machines supporting AES-NI, it will use the implementation using AES-NI and for machines not supporting AES-NI, it will use the emulated instruction implementation.

AESNI emulation is very slow. It is very difficult to find system that doesn't support AESNI these days ;) It's broadly available since ~10 years. There could be a BIOS option that switches these extensions off - it may be worth checking it. If this is a virtual environment then there may be a VM misconfiguration (AESNI not supported).