patches for DPDK stable branches
 help / color / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jay Zhou <jianjay.zhou@huawei.com>
Cc: dev@dpdk.org, stable@dpdk.org,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [dpdk-stable] [PATCH 06/10] crypto/virtio: fix global variable multiple definitions
Date: Thu,  5 Sep 2019 15:53:11 +0100
Message-ID: <20190905145315.19395-7-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20190905145315.19395-1-ferruh.yigit@intel.com>

'virtio_hw_internal' global variable is defined in both 'crypto/virtio'
and 'net/virtio' PMDs. This means they share same storage when
application linked with static DPDK library, which is not the intention.

Fixing by adding 'crypto_' prefix to the 'crypto/virtio' driver.

Issue has been detected by '-fno-common' gcc flag.

Fixes: 25500d4b8076 ("crypto/virtio: support device init")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/crypto/virtio/virtio_pci.c | 4 ++--
 drivers/crypto/virtio/virtio_pci.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_pci.c b/drivers/crypto/virtio/virtio_pci.c
index 8137b3c5a..f490f6e28 100644
--- a/drivers/crypto/virtio/virtio_pci.c
+++ b/drivers/crypto/virtio/virtio_pci.c
@@ -31,7 +31,7 @@
 #define VIRTIO_PCI_CONFIG(hw) \
 		(((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20)
 
-struct virtio_hw_internal virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO];
+struct virtio_hw_internal crypto_virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO];
 
 static inline int
 check_vq_phys_addr_ok(struct virtqueue *vq)
@@ -452,7 +452,7 @@ vtpci_cryptodev_init(struct rte_pci_device *dev, struct virtio_crypto_hw *hw)
 	 */
 	if (virtio_read_caps(dev, hw) == 0) {
 		VIRTIO_CRYPTO_INIT_LOG_INFO("modern virtio pci detected.");
-		virtio_hw_internal[hw->dev_id].vtpci_ops =
+		crypto_virtio_hw_internal[hw->dev_id].vtpci_ops =
 					&virtio_crypto_modern_ops;
 		hw->modern = 1;
 		return 0;
diff --git a/drivers/crypto/virtio/virtio_pci.h b/drivers/crypto/virtio/virtio_pci.h
index 604ec3662..d9a214dfd 100644
--- a/drivers/crypto/virtio/virtio_pci.h
+++ b/drivers/crypto/virtio/virtio_pci.h
@@ -201,10 +201,10 @@ struct virtio_hw_internal {
 	struct rte_pci_ioport io;
 };
 
-#define VTPCI_OPS(hw)	(virtio_hw_internal[(hw)->dev_id].vtpci_ops)
-#define VTPCI_IO(hw)	(&virtio_hw_internal[(hw)->dev_id].io)
+#define VTPCI_OPS(hw)	(crypto_virtio_hw_internal[(hw)->dev_id].vtpci_ops)
+#define VTPCI_IO(hw)	(&crypto_virtio_hw_internal[(hw)->dev_id].io)
 
-extern struct virtio_hw_internal virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO];
+extern struct virtio_hw_internal crypto_virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO];
 
 /*
  * How many bits to shift physical queue address written to QUEUE_PFN.
-- 
2.21.0


  parent reply index

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190905145315.19395-1-ferruh.yigit@intel.com>
2019-09-05 14:53 ` [dpdk-stable] [PATCH 01/10] bus/fslmc: " Ferruh Yigit
2019-09-10 16:36   ` Sachin Saxena
2019-09-05 14:53 ` [dpdk-stable] [PATCH 02/10] net/igb: " Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 03/10] crypto/null: " Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 04/10] crypto/octeontx: " Ferruh Yigit
2019-09-26 11:20   ` [dpdk-stable] [EXT] " Anoob Joseph
2019-09-26 18:03     ` Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 05/10] crypto/dpaa2_sec: " Ferruh Yigit
2019-09-10 16:53   ` [dpdk-stable] [dpdk-dev] " Sachin Saxena
2019-10-24 14:53   ` [dpdk-stable] " David Marchand
2019-10-24 14:55     ` Ferruh Yigit
2019-10-24 16:56       ` David Marchand
2019-10-25 10:25         ` Ferruh Yigit
2019-09-05 14:53 ` Ferruh Yigit [this message]
2019-09-05 14:53 ` [dpdk-stable] [PATCH 07/10] compress/octeontx: " Ferruh Yigit
2019-09-05 16:00   ` [dpdk-stable] [EXT] " Ashish Gupta
2019-09-05 14:53 ` [dpdk-stable] [PATCH 08/10] app/testpmd: " Ferruh Yigit
2019-10-12 12:36   ` Thomas Monjalon
2019-09-05 14:53 ` [dpdk-stable] [PATCH 09/10] app/test-pipeline: " Ferruh Yigit
2019-09-05 15:01   ` Dumitrescu, Cristian
2019-09-05 15:19     ` Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 10/10] test: " Ferruh Yigit
2019-09-05 15:45   ` Honnappa Nagarahalli

Reply instructions:

You may reply publically 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=20190905145315.19395-7-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianjay.zhou@huawei.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    /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

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox