From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] virtio: fix crashes in virtio stats functions Date: Thu, 24 Dec 2015 11:48:41 +0800 Message-ID: <20151224034841.GZ18863@yliu-dev.sh.intel.com> References: <1450863919-29684-1-git-send-email-bernard.iremonger@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Bernard Iremonger Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4D690594B for ; Thu, 24 Dec 2015 04:47:10 +0100 (CET) Content-Disposition: inline In-Reply-To: <1450863919-29684-1-git-send-email-bernard.iremonger@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Dec 23, 2015 at 09:45:19AM +0000, Bernard Iremonger wrote: > This initialisation of nb_rx_queues and nb_tx_queues has been removed > from eth_virtio_dev_init. > > The nb_rx_queues and nb_tx_queues were being initialised in eth_virtio_dev_init > before the tx_queues and rx_queues arrays were allocated. > > The arrays are allocated when the ethdev port is configured and the > nb_tx_queues and nb_rx_queues are initialised. > > If any of the following functions were called before the ethdev > port was configured there was a segmentation fault because > rx_queues and tx_queues were NULL: > > rte_eth_stats_get > rte_eth_stats_reset > rte_eth_xstats_get > rte_eth_xstats_reset > > Fixes: 823ad647950a ("virtio: support multiple queues") > Signed-off-by: Bernard Iremonger Acked-by: Yuanhan Liu Thanks. --yliu