[dpdk-stable] patch 'net/thunderx: fix build with gcc optimization on' has been queued to LTS release 16.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Jul 24 18:07:36 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/26/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 751700cb71459d5b2a70a2b3d1cdd0dce429f287 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Thu, 21 Jun 2018 19:14:50 +0100
Subject: [PATCH] net/thunderx: fix build with gcc optimization on
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit d90141961b9acead2a3cfacc7547ac1a256979eb ]

build error gcc version 6.3.1 20161221 (Red Hat 6.3.1-1),
with EXTRA_CFLAGS="-O3":

.../drivers/net/thunderx/nicvf_ethdev.c:907:9:
   error: ‘txq’ may be used uninitialized in this function
   [-Werror=maybe-uninitialized]
  if (txq->pool_free == nicvf_single_pool_free_xmited_buffers)
      ~~~^~~~~~~~~~~
.../drivers/net/thunderx/nicvf_ethdev.c:886:20:
   note: ‘txq’ was declared here
  struct nicvf_txq *txq;
                    ^~~

Same error on function 'nicvf_eth_dev_init' and 'nicvf_dev_start', it
seems 'nicvf_set_tx_function' inlined when optimization enabled.

Initialize the txq and add NULL check before using it to fix.

Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")

Reported-by: Richard Walsh <richard.walsh at intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
---
 drivers/net/thunderx/nicvf_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index d0f0d52dd..82106a78b 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -879,7 +879,7 @@ nicvf_dev_tx_queue_release(void *sq)
 static void
 nicvf_set_tx_function(struct rte_eth_dev *dev)
 {
-	struct nicvf_txq *txq;
+	struct nicvf_txq *txq = NULL;
 	size_t i;
 	bool multiseg = false;
 
@@ -900,6 +900,9 @@ nicvf_set_tx_function(struct rte_eth_dev *dev)
 		dev->tx_pkt_burst = nicvf_xmit_pkts;
 	}
 
+	if (!txq)
+		return;
+
 	if (txq->pool_free == nicvf_single_pool_free_xmited_buffers)
 		PMD_DRV_LOG(DEBUG, "Using single-mempool tx free method");
 	else
-- 
2.18.0



More information about the stable mailing list