From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 195621B171 for ; Tue, 23 Jan 2018 10:50:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 01:50:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,400,1511856000"; d="scan'208";a="11906896" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by orsmga007.jf.intel.com with ESMTP; 23 Jan 2018 01:50:52 -0800 From: Jianfeng Tan To: dev@dpdk.org Cc: yliu@fridaylinux.org, maxime.coquelin@redhat.com, Jianfeng Tan Date: Tue, 23 Jan 2018 09:52:43 +0000 Message-Id: <1516701163-132843-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH v2] 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:50:58 -0000 Since commit 59fe5e17d930 ("vhost: propagate set features handling error"), vhost does not allow to set different features without reset. The virito-user driver fails to reset the device in below commit. To fix, we send the reset message as stopping the device. Fixes: c12a26ee209e ("net/virtio-user: fix not properly reset device") Reported-by: Lei Yao Reported-by: Tiwei Bie Signed-off-by: Jianfeng Tan --- v2: Correct commit reference number format. drivers/net/virtio/virtio_user/virtio_user_dev.c | 5 +++++ 1 file changed, 5 insertions(+) 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 = 0; i < dev->max_queue_pairs; ++i) dev->ops->enable_qp(dev, i, 0); + 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; } -- 2.7.4