From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D60CB5A9D for ; Wed, 23 Dec 2015 13:56:14 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 23 Dec 2015 04:56:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,468,1444719600"; d="scan'208";a="622745381" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by FMSMGA003.fm.intel.com with ESMTP; 23 Dec 2015 04:56:13 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX109.ger.corp.intel.com (163.33.3.23) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 23 Dec 2015 12:56:12 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.203]) by irsmsx155.ger.corp.intel.com ([169.254.14.190]) with mapi id 14.03.0248.002; Wed, 23 Dec 2015 12:56:11 +0000 From: "Ananyev, Konstantin" To: "Iremonger, Bernard" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] virtio: fix crashes in virtio stats functions Thread-Index: AQHRPWbFM09bRN5hfU2a3lYJuX8yMZ7Yh31w Date: Wed, 23 Dec 2015 12:56:11 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836AD8034@irsmsx105.ger.corp.intel.com> References: <1450863919-29684-1-git-send-email-bernard.iremonger@intel.com> In-Reply-To: <1450863919-29684-1-git-send-email-bernard.iremonger@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] virtio: fix crashes in virtio stats functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 12:56:15 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bernard Iremonger > Sent: Wednesday, December 23, 2015 9:45 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] virtio: fix crashes in virtio stats functions >=20 > This initialisation of nb_rx_queues and nb_tx_queues has been removed > from eth_virtio_dev_init. >=20 > The nb_rx_queues and nb_tx_queues were being initialised in eth_virtio_de= v_init > before the tx_queues and rx_queues arrays were allocated. >=20 > The arrays are allocated when the ethdev port is configured and the > nb_tx_queues and nb_rx_queues are initialised. >=20 > 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: >=20 > rte_eth_stats_get > rte_eth_stats_reset > rte_eth_xstats_get > rte_eth_xstats_reset >=20 > Fixes: 823ad647950a ("virtio: support multiple queues") > Signed-off-by: Bernard Iremonger > --- > drivers/net/virtio/virtio_ethdev.c | 3 --- > 1 file changed, 3 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virt= io_ethdev.c > index d928339..5ef0752 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1378,9 +1378,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > hw->max_tx_queues =3D 1; > } >=20 > - eth_dev->data->nb_rx_queues =3D hw->max_rx_queues; > - eth_dev->data->nb_tx_queues =3D hw->max_tx_queues; > - > PMD_INIT_LOG(DEBUG, "hw->max_rx_queues=3D%d hw->max_tx_queues=3D%d", > hw->max_rx_queues, hw->max_tx_queues); > PMD_INIT_LOG(DEBUG, "port %d vendorID=3D0x%x deviceID=3D0x%x", > -- Acked-by: Konstantin Ananyev > 2.6.3