From: Pablo de Lara Date: Tue, 3 Jul 2018 08:22:22 +0000 (+0100) Subject: crypto/aesni_gcm: support IPsec Multi-buffer lib v0.50 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f961a887d73670fbe95094a3689d2a00c1a485b8;p=dpdk.git crypto/aesni_gcm: support IPsec Multi-buffer lib v0.50 Adds support for the v0.50 of the IPsec Multi-buffer lib. The library now exposes its version, with the idea of maintaining backwards compatibility in the future, avoiding breaking the compilation of the PMD every time there is a new version available. Signed-off-by: Pablo de Lara --- diff --git a/doc/guides/cryptodevs/aesni_gcm.rst b/doc/guides/cryptodevs/aesni_gcm.rst index 01590e850f..e0346080a9 100644 --- a/doc/guides/cryptodevs/aesni_gcm.rst +++ b/doc/guides/cryptodevs/aesni_gcm.rst @@ -36,8 +36,8 @@ Installation To build DPDK with the AESNI_GCM_PMD the user is required to download the multi-buffer library from `here `_ and compile it on their user system before building DPDK. -The latest version of the library supported by this PMD is v0.49, which -can be downloaded in ``_. +The latest version of the library supported by this PMD is v0.50, which +can be downloaded in ``_. .. code-block:: console @@ -57,7 +57,7 @@ and the external crypto libraries supported by them: 16.04 - 16.11 Multi-buffer library 0.43 - 0.44 17.02 - 17.05 ISA-L Crypto v2.18 17.08 - 18.02 Multi-buffer library 0.46 - 0.48 - 18.05 Multi-buffer library 0.49 + 18.05+ Multi-buffer library 0.49+ ============= ================================ diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 7651a8abfa..752e0cd6a0 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -515,6 +515,13 @@ aesni_gcm_create(const char *name, internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs; +#if IMB_VERSION_NUM >= IMB_VERSION(0, 50, 0) + AESNI_GCM_LOG(INFO, "IPSec Multi-buffer library version used: %s\n", + imb_get_version_str()); +#else + AESNI_GCM_LOG(INFO, "IPSec Multi-buffer library version used: 0.49.0\n"); +#endif + return 0; } diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h index 0bcd4fa091..c13a12a571 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h @@ -7,6 +7,15 @@ #include "aesni_gcm_ops.h" +/* + * IMB_VERSION_NUM macro was introduced in version Multi-buffer 0.50, + * so if macro is not defined, it means that the version is 0.49. + */ +#if !defined(IMB_VERSION_NUM) +#define IMB_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) +#define IMB_VERSION_NUM IMB_VERSION(0, 49, 0) +#endif + #define CRYPTODEV_NAME_AESNI_GCM_PMD crypto_aesni_gcm /**< AES-NI GCM PMD device name */