From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D25FA0563; Wed, 15 Apr 2020 11:32:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 737891D641; Wed, 15 Apr 2020 11:32:04 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6D3651D641; Wed, 15 Apr 2020 11:32:02 +0200 (CEST) IronPort-SDR: QJ4KlDADZBtxYKbgFi1phGAPUOCQGMGCWGArYYufRb0GsjPlSmcZzrWs1vRupEnY/dZ3NHGfjl YZxCEKdK0tJw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 02:32:01 -0700 IronPort-SDR: hW4U0AgaFOYpPB4EfdBwYYgwCiOrVA17nj0gfUjPKJaDPFqeEobNcj90CnHayo1HyUwmtvds9R PFfrBlykP2VQ== X-IronPort-AV: E=Sophos;i="5.72,386,1580803200"; d="scan'208";a="453864708" Received: from bricha3-mobl.ger.corp.intel.com ([10.212.77.78]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 15 Apr 2020 02:31:59 -0700 Date: Wed, 15 Apr 2020 10:31:54 +0100 From: Bruce Richardson To: Lukasz Wojciechowski Cc: dev@dpdk.org, ashish.gupta@caviumnetworks.com, tallurix.chaitanya.babu@intel.com, naga.sureshx.somarowthu@intel.com, pablo.de.lara.guarch@intel.com, stable@dpdk.org Message-ID: <20200415093154.GA629@bricha3-MOBL.ger.corp.intel.com> References: <20200410172756.20721-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [dpdk-dev] [PATCH] drivers: fix gcc 10 errors due to logtype var in header X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > > --- > > 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 > > -- > > Lukasz Wojciechowski > Principal Software Engineer > > Samsung R&D Institute Poland > Samsung Electronics > Office +48 22 377 88 25 > l.wojciechow@partner.samsung.com >