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 56EC25909 for ; Fri, 12 Sep 2014 05:50:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 11 Sep 2014 20:55:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,510,1406617200"; d="scan'208";a="601812499" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2014 20:55:56 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 11 Sep 2014 20:55:56 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 11 Sep 2014 20:55:56 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.192]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.204]) with mapi id 14.03.0195.001; Fri, 12 Sep 2014 11:55:55 +0800 From: "Ouyang, Changchun" To: "damarion@cisco.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated Thread-Index: AQHPzg9XFQd5rn5u9U6XhDhTU1x4WJv83T5A Date: Fri, 12 Sep 2014 03:55:54 +0000 Message-ID: References: <1410474308-17744-1-git-send-email-damarion@cisco.com> In-Reply-To: <1410474308-17744-1-git-send-email-damarion@cisco.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated 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: Fri, 12 Sep 2014 03:50:42 -0000 Hi > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of > damarion@cisco.com > Sent: Friday, September 12, 2014 6:25 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is = not > negotiated >=20 > From: Damjan Marion >=20 > If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL >=20 > Signed-off-by: Damjan Marion > --- > lib/librte_pmd_virtio/virtio_rxtx.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_pmd_virtio/virtio_rxtx.c > b/lib/librte_pmd_virtio/virtio_rxtx.c > index 0b10108..8cb635e 100644 > --- a/lib/librte_pmd_virtio/virtio_rxtx.c > +++ b/lib/librte_pmd_virtio/virtio_rxtx.c > @@ -328,8 +328,10 @@ virtio_dev_cq_start(struct rte_eth_dev *dev) > struct virtio_hw *hw > =3D VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private); >=20 > - virtio_dev_vring_start(hw->cvq, VTNET_CQ); > - VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq); > + if (hw->cvq) { > + virtio_dev_vring_start(hw->cvq, VTNET_CQ); > + VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq); > + } > } >=20 > void > -- > 2.1.0 Acked-by: Changchun Ouyang