numam-dpdk/drivers/net/thunderx
Ferruh Yigit d90141961b net/thunderx: fix build with gcc optimization on
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: 7413feee66 ("net/thunderx: add device start/stop and close")
Cc: stable@dpdk.org

Reported-by: Richard Walsh <richard.walsh@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-07-03 01:35:58 +02:00
..
base net/thunderx: add support for hardware first skip feature 2018-07-03 01:35:58 +02:00
Makefile drivers/net: build Cavium NIC PMDs with meson 2018-01-30 21:58:59 +01:00
meson.build drivers/net: build Cavium NIC PMDs with meson 2018-01-30 21:58:59 +01:00
nicvf_ethdev.c net/thunderx: fix build with gcc optimization on 2018-07-03 01:35:58 +02:00
nicvf_ethdev.h net/thunderx: add support for hardware first skip feature 2018-07-03 01:35:58 +02:00
nicvf_logs.h net/thunderx: implement dynamic logging 2018-01-16 18:47:49 +01:00
nicvf_rxtx.c ethdev: separate driver APIs 2018-01-22 01:26:49 +01:00
nicvf_rxtx.h ethdev: separate driver APIs 2018-01-22 01:26:49 +01:00
nicvf_struct.h net/thunderx: add support for hardware first skip feature 2018-07-03 01:35:58 +02:00
nicvf_svf.c drivers: use SPDX tag for Cavium copyright files 2018-01-09 16:19:01 +01:00
nicvf_svf.h drivers: use SPDX tag for Cavium copyright files 2018-01-09 16:19:01 +01:00
rte_pmd_thunderx_version.map drivers/net: build Cavium NIC PMDs with meson 2018-01-30 21:58:59 +01:00