From 58d3852ef57630578f5f2744beb53848fd974e47 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 3 Jul 2018 09:22:34 +0100 Subject: [PATCH] crypto/aesni_mb: 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 --- doc/guides/cryptodevs/aesni_mb.rst | 6 +++--- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 7 +++++++ drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h | 9 +++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/guides/cryptodevs/aesni_mb.rst b/doc/guides/cryptodevs/aesni_mb.rst index 236828c0af..df3ed67da0 100644 --- a/doc/guides/cryptodevs/aesni_mb.rst +++ b/doc/guides/cryptodevs/aesni_mb.rst @@ -57,8 +57,8 @@ Installation To build DPDK with the AESNI_MB_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 from ``_. +The latest version of the library supported by this PMD is v0.50, which +can be downloaded from ``_. .. code-block:: console @@ -80,7 +80,7 @@ and the Multi-Buffer library version supported by them: 17.05 - 17.08 0.45 - 0.48 17.11 0.47 - 0.48 18.02 0.48 - 18.05 0.49 + 18.05+ 0.49+ ============== ============================ diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 8dd849f0c3..b1b6bb0762 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -886,6 +886,13 @@ cryptodev_aesni_mb_create(const char *name, internals->vector_mode = vector_mode; internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs; +#if IMB_VERSION_NUM >= IMB_VERSION(0, 50, 0) + AESNI_MB_LOG(INFO, "IPSec Multi-buffer library version used: %s\n", + imb_get_version_str()); +#else + AESNI_MB_LOG(INFO, "IPSec Multi-buffer library version used: 0.49.0\n"); +#endif + return 0; } diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h index 30922daa45..d355315212 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h @@ -7,6 +7,15 @@ #include "aesni_mb_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_MB_PMD crypto_aesni_mb /**< AES-NI Multi buffer PMD device name */ -- 2.20.1