* [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header
@ 2020-04-10 17:27 ` Bruce Richardson
[not found] ` <CGME20200415062247eucas1p2819f2f9045a51287706d3fced5362f9e@eucas1p2.samsung.com>
2020-04-15 6:29 ` [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header Lukasz Wojciechowski
0 siblings, 2 replies; 7+ messages in thread
From: Bruce Richardson @ 2020-04-10 17:27 UTC (permalink / raw)
To: dev
Cc: Bruce Richardson, ashish.gupta, tallurix.chaitanya.babu,
naga.sureshx.somarowthu, pablo.de.lara.guarch, stable
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: 0c4e4c16b004 ("compress/zlib: introduce zlib PMD")
Cc: ashish.gupta@caviumnetworks.com
Fixes: 90c8a2d02a31 ("crypto/aesni_gcm: add dynamic logging")
Cc: tallurix.chaitanya.babu@intel.com
Fixes: 276624ae2ef6 ("crypto/aesni_mb: add dynamic logging")
Fixes: 094b2386f461 ("crypto/openssl: add dynamic logging")
Cc: naga.sureshx.somarowthu@intel.com
Cc: pablo.de.lara.guarch@intel.com
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/compress/zlib/zlib_pmd.c | 2 ++
drivers/compress/zlib/zlib_pmd_private.h | 2 +-
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 ++
drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h | 2 +-
drivers/crypto/aesni_mb/aesni_mb_pmd_private.h | 2 +-
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 2 ++
drivers/crypto/openssl/openssl_pmd_private.h | 2 +-
drivers/crypto/openssl/rte_openssl_pmd.c | 1 +
8 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
index 19f9200c2..e39be2ed8 100644
--- a/drivers/compress/zlib/zlib_pmd.c
+++ b/drivers/compress/zlib/zlib_pmd.c
@@ -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
*/
diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h
index bda49759d..e36c5dc61 100644
--- a/drivers/compress/zlib/zlib_pmd_private.h
+++ b/drivers/compress/zlib/zlib_pmd_private.h
@@ -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)
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index a1caab993..475d523ae 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -13,6 +13,8 @@
#include "aesni_gcm_pmd_private.h"
+int aesni_gcm_logtype_driver;
+
static uint8_t cryptodev_driver_id;
/* setup session handlers */
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
index 080d4f7e4..2763d1c49 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
@@ -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__, \
diff --git a/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h b/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
index 3456693c2..b3cb2f1cf 100644
--- a/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
+++ b/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
@@ -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, \
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index 33f416745..40feae3c6 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -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
diff --git a/drivers/crypto/openssl/openssl_pmd_private.h b/drivers/crypto/openssl/openssl_pmd_private.h
index 43ac3813d..b2054b375 100644
--- a/drivers/crypto/openssl/openssl_pmd_private.h
+++ b/drivers/crypto/openssl/openssl_pmd_private.h
@@ -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__, \
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 199097bf8..b820f6171 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -18,6 +18,7 @@
#define DES_BLOCK_SIZE 8
+int openssl_logtype_driver;
static uint8_t cryptodev_driver_id;
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
--
2.20.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files
[not found] ` <CGME20200415062247eucas1p2819f2f9045a51287706d3fced5362f9e@eucas1p2.samsung.com>
@ 2020-04-15 6:22 ` Lukasz Wojciechowski
2020-04-17 8:22 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 7+ messages in thread
From: Lukasz Wojciechowski @ 2020-04-15 6:22 UTC (permalink / raw)
To: Pablo de Lara, Tomasz Duszynski, Michael Shamis, Liron Himi,
Reshma Pattan, Naga Suresh Somarowthu, Agalya Babu RadhaKrishnan,
Slawomir Mrozowicz, Declan Doherty
Cc: dev, bruce.richardson, stable
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")
Cc: naga.sureshx.somarowthu@intel.com
Fixes: a05a450f42fd ("crypto/mvsam: add dynamic logging")
Cc: tdu@semihalf.com
Fixes: f3af5f9d1325 ("crypto/zuc: add dynamic logging")
Cc: agalyax.babu.radhakrishnan@intel.com
Fixes: a3277ad47feb ("cryptodev: remove crypto device driver name")
Cc: slawomirx.mrozowicz@intel.com
Cc: stable@dpdk.org
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
drivers/crypto/kasumi/kasumi_pmd_private.h | 2 +-
drivers/crypto/kasumi/rte_kasumi_pmd.c | 1 +
drivers/crypto/mvsam/mrvl_pmd_private.h | 2 +-
drivers/crypto/mvsam/rte_mrvl_pmd.c | 1 +
drivers/crypto/snow3g/rte_snow3g_pmd.c | 1 +
drivers/crypto/snow3g/snow3g_pmd_private.h | 2 +-
drivers/crypto/zuc/rte_zuc_pmd.c | 1 +
drivers/crypto/zuc/zuc_pmd_private.h | 4 ++--
8 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/crypto/kasumi/kasumi_pmd_private.h b/drivers/crypto/kasumi/kasumi_pmd_private.h
index 3b3a6958f..b7f1c428b 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 baad5b4e7..d67264842 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 09702b9e3..e575330ef 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 3c0fe216f..63782ce97 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 d72112b5f..8101eaaad 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 2074f3d17..23cf078a9 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 9e06ab7c9..f47a7880d 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 47a8b08dd..d8684891e 100644
--- a/drivers/crypto/zuc/zuc_pmd_private.h
+++ b/drivers/crypto/zuc/zuc_pmd_private.h
@@ -8,10 +8,10 @@
#include <intel-ipsec-mb.h>
#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__, \
--
2.17.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header
2020-04-10 17:27 ` [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header Bruce Richardson
[not found] ` <CGME20200415062247eucas1p2819f2f9045a51287706d3fced5362f9e@eucas1p2.samsung.com>
@ 2020-04-15 6:29 ` Lukasz Wojciechowski
2020-04-15 9:31 ` Bruce Richardson
1 sibling, 1 reply; 7+ messages in thread
From: Lukasz Wojciechowski @ 2020-04-15 6:29 UTC (permalink / raw)
To: Bruce Richardson, dev
Cc: ashish.gupta, tallurix.chaitanya.babu, naga.sureshx.somarowthu,
pablo.de.lara.guarch, stable
W dniu 10.04.2020 o 19:27, Bruce Richardson pisze:
> 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: 0c4e4c16b004 ("compress/zlib: introduce zlib PMD")
> Cc: ashish.gupta@caviumnetworks.com
> Fixes: 90c8a2d02a31 ("crypto/aesni_gcm: add dynamic logging")
> Cc: tallurix.chaitanya.babu@intel.com
> Fixes: 276624ae2ef6 ("crypto/aesni_mb: add dynamic logging")
> Fixes: 094b2386f461 ("crypto/openssl: add dynamic logging")
> Cc: naga.sureshx.somarowthu@intel.com
> Cc: pablo.de.lara.guarch@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/compress/zlib/zlib_pmd.c | 2 ++
> drivers/compress/zlib/zlib_pmd_private.h | 2 +-
> drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 ++
> drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h | 2 +-
> drivers/crypto/aesni_mb/aesni_mb_pmd_private.h | 2 +-
> drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 2 ++
> drivers/crypto/openssl/openssl_pmd_private.h | 2 +-
> drivers/crypto/openssl/rte_openssl_pmd.c | 1 +
> 8 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
> index 19f9200c2..e39be2ed8 100644
> --- a/drivers/compress/zlib/zlib_pmd.c
> +++ b/drivers/compress/zlib/zlib_pmd.c
> @@ -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
> */
> diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h
> index bda49759d..e36c5dc61 100644
> --- a/drivers/compress/zlib/zlib_pmd_private.h
> +++ b/drivers/compress/zlib/zlib_pmd_private.h
> @@ -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)
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> index a1caab993..475d523ae 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> @@ -13,6 +13,8 @@
>
> #include "aesni_gcm_pmd_private.h"
>
> +int aesni_gcm_logtype_driver;
> +
> static uint8_t cryptodev_driver_id;
>
> /* setup session handlers */
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> index 080d4f7e4..2763d1c49 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> @@ -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__, \
> diff --git a/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h b/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
> index 3456693c2..b3cb2f1cf 100644
> --- a/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
> +++ b/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
> @@ -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, \
> diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
> index 33f416745..40feae3c6 100644
> --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
> +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
> @@ -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
> diff --git a/drivers/crypto/openssl/openssl_pmd_private.h b/drivers/crypto/openssl/openssl_pmd_private.h
> index 43ac3813d..b2054b375 100644
> --- a/drivers/crypto/openssl/openssl_pmd_private.h
> +++ b/drivers/crypto/openssl/openssl_pmd_private.h
> @@ -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__, \
> diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
> index 199097bf8..b820f6171 100644
> --- a/drivers/crypto/openssl/rte_openssl_pmd.c
> +++ b/drivers/crypto/openssl/rte_openssl_pmd.c
> @@ -18,6 +18,7 @@
>
> #define DES_BLOCK_SIZE 8
>
> +int openssl_logtype_driver;
> static uint8_t cryptodev_driver_id;
>
> #if (OPENSSL_VERSION_NUMBER < 0x10100000L)
Patch looks good. I added myself one more as a follow up, that fixes 4
more drivers. It's up to you if you want to squash them together.
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
--
Lukasz Wojciechowski
Principal Software Engineer
Samsung R&D Institute Poland
Samsung Electronics
Office +48 22 377 88 25
l.wojciechow@partner.samsung.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header
2020-04-15 6:29 ` [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header Lukasz Wojciechowski
@ 2020-04-15 9:31 ` Bruce Richardson
2020-04-17 21:02 ` Akhil Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Bruce Richardson @ 2020-04-15 9:31 UTC (permalink / raw)
To: Lukasz Wojciechowski
Cc: dev, ashish.gupta, tallurix.chaitanya.babu,
naga.sureshx.somarowthu, pablo.de.lara.guarch, stable
On Wed, Apr 15, 2020 at 08:29:16AM +0200, Lukasz Wojciechowski wrote:
>
> W dniu 10.04.2020 o 19:27, Bruce Richardson pisze:
> > 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: 0c4e4c16b004 ("compress/zlib: introduce zlib PMD")
> > Cc: ashish.gupta@caviumnetworks.com
> > Fixes: 90c8a2d02a31 ("crypto/aesni_gcm: add dynamic logging")
> > Cc: tallurix.chaitanya.babu@intel.com
> > Fixes: 276624ae2ef6 ("crypto/aesni_mb: add dynamic logging")
> > Fixes: 094b2386f461 ("crypto/openssl: add dynamic logging")
> > Cc: naga.sureshx.somarowthu@intel.com
> > Cc: pablo.de.lara.guarch@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > drivers/compress/zlib/zlib_pmd.c | 2 ++
> > drivers/compress/zlib/zlib_pmd_private.h | 2 +-
> > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 ++
> > drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h | 2 +-
> > drivers/crypto/aesni_mb/aesni_mb_pmd_private.h | 2 +-
> > drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 2 ++
> > drivers/crypto/openssl/openssl_pmd_private.h | 2 +-
> > drivers/crypto/openssl/rte_openssl_pmd.c | 1 +
> > 8 files changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
> > index 19f9200c2..e39be2ed8 100644
> > --- a/drivers/compress/zlib/zlib_pmd.c
> > +++ b/drivers/compress/zlib/zlib_pmd.c
> > @@ -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
> > */
> > diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h
> > index bda49759d..e36c5dc61 100644
> > --- a/drivers/compress/zlib/zlib_pmd_private.h
> > +++ b/drivers/compress/zlib/zlib_pmd_private.h
> > @@ -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)
> > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> > index a1caab993..475d523ae 100644
> > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> > @@ -13,6 +13,8 @@
> >
> > #include "aesni_gcm_pmd_private.h"
> >
> > +int aesni_gcm_logtype_driver;
> > +
> > static uint8_t cryptodev_driver_id;
> >
> > /* setup session handlers */
> > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> > index 080d4f7e4..2763d1c49 100644
> > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
> > @@ -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__, \
> > diff --git a/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h b/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
> > index 3456693c2..b3cb2f1cf 100644
> > --- a/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
> > +++ b/drivers/crypto/aesni_mb/aesni_mb_pmd_private.h
> > @@ -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, \
> > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
> > index 33f416745..40feae3c6 100644
> > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
> > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
> > @@ -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
> > diff --git a/drivers/crypto/openssl/openssl_pmd_private.h b/drivers/crypto/openssl/openssl_pmd_private.h
> > index 43ac3813d..b2054b375 100644
> > --- a/drivers/crypto/openssl/openssl_pmd_private.h
> > +++ b/drivers/crypto/openssl/openssl_pmd_private.h
> > @@ -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__, \
> > diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
> > index 199097bf8..b820f6171 100644
> > --- a/drivers/crypto/openssl/rte_openssl_pmd.c
> > +++ b/drivers/crypto/openssl/rte_openssl_pmd.c
> > @@ -18,6 +18,7 @@
> >
> > #define DES_BLOCK_SIZE 8
> >
> > +int openssl_logtype_driver;
> > static uint8_t cryptodev_driver_id;
> >
> > #if (OPENSSL_VERSION_NUMBER < 0x10100000L)
>
> Patch looks good. I added myself one more as a follow up, that fixes 4
> more drivers. It's up to you if you want to squash them together.
>
Thanks Lukasz, I missed those on my system as my IPSec library version was
too old to have them compile.
>
> Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
>
> --
>
> Lukasz Wojciechowski
> Principal Software Engineer
>
> Samsung R&D Institute Poland
> Samsung Electronics
> Office +48 22 377 88 25
> l.wojciechow@partner.samsung.com
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files
2020-04-15 6:22 ` [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files Lukasz Wojciechowski
@ 2020-04-17 8:22 ` De Lara Guarch, Pablo
2020-04-17 21:00 ` Akhil Goyal
0 siblings, 1 reply; 7+ messages in thread
From: De Lara Guarch, Pablo @ 2020-04-17 8:22 UTC (permalink / raw)
To: Lukasz Wojciechowski, Tomasz Duszynski, Michael Shamis,
Liron Himi, Pattan, Reshma, Naga Suresh Somarowthu,
Agalya Babu RadhaKrishnan, Mrozowicz, SlawomirX, Doherty, Declan
Cc: dev, Richardson, Bruce, stable
> -----Original Message-----
> From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
> Sent: Wednesday, April 15, 2020 7:22 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Tomasz Duszynski
> <tdu@semihalf.com>; Michael Shamis <michaelsh@marvell.com>; Liron Himi
> <lironh@marvell.com>; Pattan, Reshma <reshma.pattan@intel.com>; Naga
> Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>; Agalya Babu
> RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>; Mrozowicz,
> SlawomirX <slawomirx.mrozowicz@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] drivers/crypto: move logtype variables to source files
>
> 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")
> Cc: naga.sureshx.somarowthu@intel.com
> Fixes: a05a450f42fd ("crypto/mvsam: add dynamic logging")
> Cc: tdu@semihalf.com
> Fixes: f3af5f9d1325 ("crypto/zuc: add dynamic logging")
> Cc: agalyax.babu.radhakrishnan@intel.com
> Fixes: a3277ad47feb ("cryptodev: remove crypto device driver name")
> Cc: slawomirx.mrozowicz@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files
2020-04-17 8:22 ` De Lara Guarch, Pablo
@ 2020-04-17 21:00 ` Akhil Goyal
0 siblings, 0 replies; 7+ messages in thread
From: Akhil Goyal @ 2020-04-17 21:00 UTC (permalink / raw)
To: De Lara Guarch, Pablo, Lukasz Wojciechowski, Tomasz Duszynski,
Michael Shamis, Liron Himi, Pattan, Reshma,
Naga Suresh Somarowthu, Agalya Babu RadhaKrishnan, Mrozowicz,
SlawomirX, Doherty, Declan
Cc: dev, Richardson, Bruce, stable
> > 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")
> > Cc: naga.sureshx.somarowthu@intel.com
> > Fixes: a05a450f42fd ("crypto/mvsam: add dynamic logging")
> > Cc: tdu@semihalf.com
> > Fixes: f3af5f9d1325 ("crypto/zuc: add dynamic logging")
> > Cc: agalyax.babu.radhakrishnan@intel.com
> > Fixes: a3277ad47feb ("cryptodev: remove crypto device driver name")
> > Cc: slawomirx.mrozowicz@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header
2020-04-15 9:31 ` Bruce Richardson
@ 2020-04-17 21:02 ` Akhil Goyal
0 siblings, 0 replies; 7+ messages in thread
From: Akhil Goyal @ 2020-04-17 21:02 UTC (permalink / raw)
To: Bruce Richardson, Lukasz Wojciechowski
Cc: dev, ashish.gupta, tallurix.chaitanya.babu,
naga.sureshx.somarowthu, pablo.de.lara.guarch, stable
> >
> > Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
> >
> > --
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-04-17 21:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20200410173223eucas1p270fdaa5dc11d4516514b5317dd331958@eucas1p2.samsung.com>
2020-04-10 17:27 ` [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header Bruce Richardson
[not found] ` <CGME20200415062247eucas1p2819f2f9045a51287706d3fced5362f9e@eucas1p2.samsung.com>
2020-04-15 6:22 ` [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files Lukasz Wojciechowski
2020-04-17 8:22 ` De Lara Guarch, Pablo
2020-04-17 21:00 ` Akhil Goyal
2020-04-15 6:29 ` [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header Lukasz Wojciechowski
2020-04-15 9:31 ` Bruce Richardson
2020-04-17 21:02 ` Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).