From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id F06E11B32D; Mon, 12 Feb 2018 04:18:46 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2018 19:18:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,499,1511856000"; d="scan'208";a="26853855" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by orsmga003.jf.intel.com with ESMTP; 11 Feb 2018 19:18:44 -0800 From: Jianfeng Tan To: dev@dpdk.org Cc: yliu@fridaylinux.org, maxime.coquelin@redhat.com, tiwei.bie@intel.com, Jianfeng Tan , stable@dpdk.org Date: Mon, 12 Feb 2018 03:20:27 +0000 Message-Id: <1518405628-23976-3-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518405628-23976-1-git-send-email-jianfeng.tan@intel.com> References: <1518405628-23976-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH 2/3] net/virtio-user: fix not working with vhost kernel 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: Mon, 12 Feb 2018 03:18:47 -0000 After reset owner in below patch, we failed to set owner before sending further vhost messages. It is OK with vhost user implemented DPDK/VPP/Contrail, but it sees "Operation not permitted" error when used with vhost kernel. We fix this by setting owner every time the device is started. Fixes: 0d6a8752ac9d ("net/virtio-user: fix crash as features change") Cc: stable@dpdk.org Signed-off-by: Jianfeng Tan --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 3b5f737..b5809ee 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -99,6 +99,9 @@ virtio_user_start_device(struct virtio_user_dev *dev) uint64_t features; int ret; + /* Do not check return as already done in init, or reset in stop */ + dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL); + /* Step 0: tell vhost to create queues */ if (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0) goto error; @@ -332,6 +335,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, PMD_INIT_LOG(ERR, "backend set up fails"); return -1; } + if (dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL) < 0) { PMD_INIT_LOG(ERR, "set_owner fails: %s", strerror(errno)); return -1; -- 2.7.4