drivers: fix log type variables for -fno-common

The zlib compression driver, as well as the aesni-gcm, aesni-mb and openssl
crypto drivers all defined the logtype variable in the header file
directly. This gives errors with gcc 10, due to -fno-common being the
default, so we need to apply the same fix in all cases:
* move the variable definition to a suitable .c file
* mark the forward declaration of the variable in the header as "extern"

Fixes: 0c4e4c16b0 ("compress/zlib: introduce zlib PMD")
Fixes: 90c8a2d02a ("crypto/aesni_gcm: add dynamic logging")
Fixes: 276624ae2e ("crypto/aesni_mb: add dynamic logging")
Fixes: 094b2386f4 ("crypto/openssl: add dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
This commit is contained in:
Bruce Richardson 2020-04-10 18:27:56 +01:00 committed by Akhil Goyal
parent a8af994b41
commit 3071d47152
8 changed files with 11 additions and 4 deletions

View File

@ -7,6 +7,8 @@
#include "zlib_pmd_private.h"
int zlib_logtype_driver;
/** Compute next mbuf in the list, assign data buffer and length,
* returns 0 if mbuf is NULL
*/

View File

@ -14,7 +14,7 @@
#define DEF_MEM_LEVEL 8
int zlib_logtype_driver;
extern int zlib_logtype_driver;
#define ZLIB_PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, zlib_logtype_driver, "%s(): "fmt "\n", \
__func__, ##args)

View File

@ -13,6 +13,8 @@
#include "aesni_gcm_pmd_private.h"
int aesni_gcm_logtype_driver;
static uint8_t cryptodev_driver_id;
/* setup session handlers */

View File

@ -20,7 +20,7 @@
/**< AES-NI GCM PMD device name */
/** AES-NI GCM PMD LOGTYPE DRIVER */
int aesni_gcm_logtype_driver;
extern int aesni_gcm_logtype_driver;
#define AESNI_GCM_LOG(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, aesni_gcm_logtype_driver, \
"%s() line %u: "fmt "\n", __func__, __LINE__, \

View File

@ -19,7 +19,7 @@ enum aesni_mb_vector_mode {
/**< AES-NI Multi buffer PMD device name */
/** AESNI_MB PMD LOGTYPE DRIVER */
int aesni_mb_logtype_driver;
extern int aesni_mb_logtype_driver;
#define AESNI_MB_LOG(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, aesni_mb_logtype_driver, \

View File

@ -14,6 +14,8 @@
#include "aesni_mb_pmd_private.h"
int aesni_mb_logtype_driver;
#define AES_CCM_DIGEST_MIN_LEN 4
#define AES_CCM_DIGEST_MAX_LEN 16
#define HMAC_MAX_BLOCK_SIZE 128

View File

@ -16,7 +16,7 @@
/**< Open SSL Crypto PMD device name */
/** OPENSSL PMD LOGTYPE DRIVER */
int openssl_logtype_driver;
extern int openssl_logtype_driver;
#define OPENSSL_LOG(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, openssl_logtype_driver, \
"%s() line %u: " fmt "\n", __func__, __LINE__, \

View File

@ -18,6 +18,7 @@
#define DES_BLOCK_SIZE 8
int openssl_logtype_driver;
static uint8_t cryptodev_driver_id;
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)