From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id B674123D for ; Mon, 30 Jul 2018 18:16:14 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkApi-00009D-CD; Mon, 30 Jul 2018 16:15:42 +0000 From: Christian Ehrhardt To: Ferruh Yigit Cc: Richard Walsh , Jerin Jacob , dpdk stable Date: Mon, 30 Jul 2018 18:11:35 +0200 Message-Id: <20180730161342.16566-50-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/thunderx: fix build with gcc optimization on' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:16:14 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From dfe938c95301462ea6c29b02f2afcfe24baf9c8e Mon Sep 17 00:00:00 2001 From: Ferruh Yigit 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 Signed-off-by: Ferruh Yigit Acked-by: Jerin Jacob --- 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 99fcd516b..4ab1bfbe6 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -883,7 +883,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; @@ -904,6 +904,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.17.1