From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3AF07A48B for ; Tue, 23 Jan 2018 10:47:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 01:47:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,400,1511856000"; d="scan'208";a="21872326" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 23 Jan 2018 01:47:40 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Jan 2018 01:47:39 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Jan 2018 01:47:39 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Tue, 23 Jan 2018 17:47:37 +0800 From: "Tan, Jianfeng" To: "dev@dpdk.org" CC: "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" Thread-Topic: [PATCH] net/virtio-user: fix segfault as features change Thread-Index: AQHTlC7s/zmk7jHVSEuVNw1Po/HjQKOBNZ6w Date: Tue, 23 Jan 2018 09:47:37 +0000 Message-ID: References: <1516700843-131786-1-git-send-email-jianfeng.tan@intel.com> In-Reply-To: <1516700843-131786-1-git-send-email-jianfeng.tan@intel.com> Accept-Language: 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] net/virtio-user: fix segfault as features change X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 09:47:41 -0000 Correct yuanhan's email :-) > -----Original Message----- > From: Tan, Jianfeng > Sent: Tuesday, January 23, 2018 5:47 PM > To: dev@dpdk.org > Cc: yuanhan.liu@linux.intel.com; maxime.coquelin@redhat.com; Tan, > Jianfeng > Subject: [PATCH] net/virtio-user: fix segfault as features change >=20 > Since commit 59fe5e17d93 ("vhost: propagate set features handling error")= , > vhost does not allow to set different features without reset. >=20 > The virito-user driver fails to reset the device in below commit. >=20 > To fix, we send the reset message as stopping the device. >=20 > Fixes: c12a26ee209e ("net/virtio-user: fix not properly reset device") >=20 > Reported-by: Lei Yao > Reported-by: Tiwei Bie > Signed-off-by: Jianfeng Tan > --- > drivers/net/virtio/virtio_user/virtio_user_dev.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c > b/drivers/net/virtio/virtio_user/virtio_user_dev.c > index 7a70c18..3b5f737 100644 > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c > @@ -142,6 +142,11 @@ int virtio_user_stop_device(struct virtio_user_dev > *dev) > for (i =3D 0; i < dev->max_queue_pairs; ++i) > dev->ops->enable_qp(dev, i, 0); >=20 > + if (dev->ops->send_request(dev, VHOST_USER_RESET_OWNER, > NULL) < 0) { > + PMD_DRV_LOG(INFO, "Failed to reset the device\n"); > + return -1; > + } > + > return 0; > } >=20 > -- > 2.7.4