From: Lukasz Wojciechowski Date: Wed, 15 Apr 2020 06:22:16 +0000 (+0200) Subject: drivers/crypto: fix log type variables for -fno-common X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6da6baf7631b53dd53d3a4c4c7d62d39da4921b6;p=dpdk.git drivers/crypto: fix log type variables for -fno-common The four crypto drivers: kasumi, mvsam, snow3g and zuc define logtype variables in their header file. As the header files are included in more than one compilation unit, it might cause appearance of multiple instances of the variable and a linker error. Such situation can occur, when no common section is allowed by the compiler settings and tentative definitions are placed in BSS section. Fixes: 2cba3814932e ("crypto/kasumi: add dynamic logging") Fixes: a05a450f42fd ("crypto/mvsam: add dynamic logging") Fixes: f3af5f9d1325 ("crypto/zuc: add dynamic logging") Fixes: a3277ad47feb ("cryptodev: remove crypto device driver name") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski Acked-by: Pablo de Lara --- diff --git a/drivers/crypto/kasumi/kasumi_pmd_private.h b/drivers/crypto/kasumi/kasumi_pmd_private.h index 3b3a6958fd..b7f1c428b4 100644 --- a/drivers/crypto/kasumi/kasumi_pmd_private.h +++ b/drivers/crypto/kasumi/kasumi_pmd_private.h @@ -11,7 +11,7 @@ /**< KASUMI PMD device name */ /** KASUMI PMD LOGTYPE DRIVER */ -int kasumi_logtype_driver; +extern int kasumi_logtype_driver; #define KASUMI_LOG(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, kasumi_logtype_driver, \ diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c index baad5b4e77..d672648420 100644 --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c @@ -17,6 +17,7 @@ #define KASUMI_MAX_BURST 4 #define BYTE_LEN 8 +int kasumi_logtype_driver; static uint8_t cryptodev_driver_id; /** Get xform chain order. */ diff --git a/drivers/crypto/mvsam/mrvl_pmd_private.h b/drivers/crypto/mvsam/mrvl_pmd_private.h index 09702b9e3e..e575330ef5 100644 --- a/drivers/crypto/mvsam/mrvl_pmd_private.h +++ b/drivers/crypto/mvsam/mrvl_pmd_private.h @@ -13,7 +13,7 @@ /**< Marvell PMD device name */ /** MRVL PMD LOGTYPE DRIVER */ -int mrvl_logtype_driver; +extern int mrvl_logtype_driver; #define MRVL_LOG(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, mrvl_logtype_driver, \ diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c index 3c0fe216f0..63782ce974 100644 --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c @@ -19,6 +19,7 @@ #define MRVL_PMD_MAX_NB_SESS_ARG ("max_nb_sessions") #define MRVL_PMD_DEFAULT_MAX_NB_SESSIONS 2048 +int mrvl_logtype_driver; static uint8_t cryptodev_driver_id; struct mrvl_pmd_init_params { diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index d72112b5f4..8101eaaada 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -16,6 +16,7 @@ #define SNOW3G_MAX_BURST 8 #define BYTE_LEN 8 +int snow3g_logtype_driver; static uint8_t cryptodev_driver_id; /** Get xform chain order. */ diff --git a/drivers/crypto/snow3g/snow3g_pmd_private.h b/drivers/crypto/snow3g/snow3g_pmd_private.h index 2074f3d172..23cf078a9c 100644 --- a/drivers/crypto/snow3g/snow3g_pmd_private.h +++ b/drivers/crypto/snow3g/snow3g_pmd_private.h @@ -11,7 +11,7 @@ /**< SNOW 3G PMD device name */ /** SNOW 3G PMD LOGTYPE DRIVER */ -int snow3g_logtype_driver; +extern int snow3g_logtype_driver; #define SNOW3G_LOG(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, snow3g_logtype_driver, \ diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c index 9e06ab7c95..f47a7880de 100644 --- a/drivers/crypto/zuc/rte_zuc_pmd.c +++ b/drivers/crypto/zuc/rte_zuc_pmd.c @@ -14,6 +14,7 @@ #define ZUC_MAX_BURST 16 #define BYTE_LEN 8 +int zuc_logtype_driver; static uint8_t cryptodev_driver_id; /** Get xform chain order. */ diff --git a/drivers/crypto/zuc/zuc_pmd_private.h b/drivers/crypto/zuc/zuc_pmd_private.h index 47a8b08dd7..d8684891ee 100644 --- a/drivers/crypto/zuc/zuc_pmd_private.h +++ b/drivers/crypto/zuc/zuc_pmd_private.h @@ -8,10 +8,10 @@ #include #define CRYPTODEV_NAME_ZUC_PMD crypto_zuc -/**< KASUMI PMD device name */ +/**< ZUC PMD device name */ /** ZUC PMD LOGTYPE DRIVER */ -int zuc_logtype_driver; +extern int zuc_logtype_driver; #define ZUC_LOG(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, zuc_logtype_driver, \ "%s()... line %u: " fmt "\n", __func__, __LINE__, \