From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 779952BA1 for ; Thu, 7 Apr 2016 12:40:10 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 07 Apr 2016 03:40:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="953634232" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by fmsmga002.fm.intel.com with ESMTP; 07 Apr 2016 03:40:08 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.172]) by IRSMSX154.ger.corp.intel.com ([169.254.12.173]) with mapi id 14.03.0248.002; Thu, 7 Apr 2016 11:40:07 +0100 From: "Loftus, Ciara" To: Rich Lane , "dev@dpdk.org" CC: Tetsuya Mukawa , Yuanhan Liu Thread-Topic: [dpdk-dev] [PATCH] vhost: call rte_vhost_enable_guest_notification only on enabled queues Thread-Index: AQHRkGSQUGve1d9kgUaItfR/bCFr759+UTdQ Date: Thu, 7 Apr 2016 10:40:06 +0000 Message-ID: <74F120C019F4A64C9B78E802F6AD4CC24F863808@IRSMSX106.ger.corp.intel.com> References: <1459988946-5956-1-git-send-email-rich.lane@bigswitch.com> In-Reply-To: <1459988946-5956-1-git-send-email-rich.lane@bigswitch.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2ZlNDg4MzktM2I0OS00NDYyLWJhZDktMjNiODY3NWU2N2FiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjdIbEJjS3hWaEphTFlrMmsrcU1ad2RpSkoySFFhanpWWFE5YUJqb093Vms9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: call rte_vhost_enable_guest_notification only on enabled queues 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: Thu, 07 Apr 2016 10:40:10 -0000 >=20 > If the vhost PMD were configured with more queues than the guest, the old > code would segfault in rte_vhost_enable_guest_notification due to a NULL > virtqueue pointer. >=20 > Fixes: ee584e9710b9 ("vhost: add driver on top of the library") > Signed-off-by: Rich Lane > --- > drivers/net/vhost/rte_eth_vhost.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index b1eb082..310cbef 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -265,7 +265,6 @@ new_device(struct virtio_net *dev) > vq->device =3D dev; > vq->internal =3D internal; > vq->port =3D eth_dev->data->port_id; > - rte_vhost_enable_guest_notification(dev, vq- > >virtqueue_id, 0); > } > for (i =3D 0; i < eth_dev->data->nb_tx_queues; i++) { > vq =3D eth_dev->data->tx_queues[i]; > @@ -274,9 +273,11 @@ new_device(struct virtio_net *dev) > vq->device =3D dev; > vq->internal =3D internal; > vq->port =3D eth_dev->data->port_id; > - rte_vhost_enable_guest_notification(dev, vq- > >virtqueue_id, 0); > } >=20 > + for (i =3D 0; i < dev->virt_qp_nb * VIRTIO_QNUM; i++) > + rte_vhost_enable_guest_notification(dev, i, 0); > + > dev->flags |=3D VIRTIO_DEV_RUNNING; > dev->priv =3D eth_dev; > eth_dev->data->dev_link.link_status =3D ETH_LINK_UP; > -- > 1.9.1 I see the same issue, and verified that this patch solves it. Thanks! Tested-by: Ciara Loftus Thanks, Ciara