DPDK patches and discussions
 help / color / mirror / Atom feed
From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
To: Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Tomasz Duszynski <tdu@semihalf.com>,
	Michael Shamis <michaelsh@marvell.com>,
	Liron Himi <lironh@marvell.com>,
	Reshma Pattan <reshma.pattan@intel.com>,
	Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>,
	Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>,
	Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>,
	Declan Doherty <declan.doherty@intel.com>
Cc: dev@dpdk.org, bruce.richardson@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files
Date: Wed, 15 Apr 2020 08:22:16 +0200	[thread overview]
Message-ID: <20200415062216.22220-1-l.wojciechow@partner.samsung.com> (raw)
In-Reply-To: <20200410172756.20721-1-bruce.richardson@intel.com>

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


  parent reply	other threads:[~2020-04-15  6:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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     ` Lukasz Wojciechowski [this message]
2020-04-17  8:22       ` [dpdk-dev] [PATCH] drivers/crypto: move logtype variables to source files 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200415062216.22220-1-l.wojciechow@partner.samsung.com \
    --to=l.wojciechow@partner.samsung.com \
    --cc=agalyax.babu.radhakrishnan@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=lironh@marvell.com \
    --cc=michaelsh@marvell.com \
    --cc=naga.sureshx.somarowthu@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=slawomirx.mrozowicz@intel.com \
    --cc=stable@dpdk.org \
    --cc=tdu@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).