From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 08A5FA0C3F; Thu, 15 Apr 2021 14:48:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73969162267; Thu, 15 Apr 2021 14:48:11 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 9FC68162264 for ; Thu, 15 Apr 2021 14:48:09 +0200 (CEST) IronPort-SDR: l337t6POKeVwYlIfYNAkmmVUQXfItcQ7301xJe8n6CBuW5UQtP+9oNmWto2qua901pnNK1xyyW P2mYo4JzA3rw== X-IronPort-AV: E=McAfee;i="6200,9189,9955"; a="280158014" X-IronPort-AV: E=Sophos;i="5.82,225,1613462400"; d="scan'208";a="280158014" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 05:48:07 -0700 IronPort-SDR: 9Vt7fLnN4DxNMM/8705rLuR02Hql8YREniV/AGtmy+Q7C0AzcQvmBFSy4srYBrno5Bq2PHAAOe VK8AZR3EWCXw== X-IronPort-AV: E=Sophos;i="5.82,225,1613462400"; d="scan'208";a="384008708" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.204.163]) ([10.213.204.163]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 05:48:02 -0700 To: Maxime Coquelin , Thierry Herbelot , dev@dpdk.org Cc: Thomas Monjalon , Chenbo Xia References: <20210408123729.9884-1-thierry.herbelot@6wind.com> <50803007-9628-e23c-001f-77d8fee3b571@redhat.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Thu, 15 Apr 2021 13:48:01 +0100 MIME-Version: 1.0 In-Reply-To: <50803007-9628-e23c-001f-77d8fee3b571@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix vhost_kernel_set_owner for multi-queue devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/13/2021 9:45 AM, Maxime Coquelin wrote: > Hi Thierry, > > On 4/8/21 2:37 PM, Thierry Herbelot wrote: >> Restore the original code, where VHOST_SET_OWNER is applied to >> all vhostfds of the device. >> >> Fixes: 06856cabb89b0 ("net/virtio: add virtio-user ops to set owner") >> Cc: Maxime Coquelin >> Cc: Chenbo Xia >> Signed-off-by: Thierry Herbelot >> --- >> drivers/net/virtio/virtio_user/vhost_kernel.c | 13 ++++++++++++- >> 1 file changed, 12 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c >> index 768db55a6c1f..58e66bb7b4ae 100644 >> --- a/drivers/net/virtio/virtio_user/vhost_kernel.c >> +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c >> @@ -101,9 +101,20 @@ vhost_kernel_ioctl(int fd, uint64_t request, void *arg) >> static int >> vhost_kernel_set_owner(struct virtio_user_dev *dev) >> { >> + int ret; >> + uint32_t i; >> struct vhost_kernel_data *data = dev->backend_data; >> >> - return vhost_kernel_ioctl(data->vhostfds[0], VHOST_SET_OWNER, NULL); >> + for (i = 0; i < dev->max_queue_pairs; ++i) { >> + if (data->vhostfds[i] < 0) >> + continue; >> + >> + ret = vhost_kernel_ioctl(data->vhostfds[i], VHOST_SET_OWNER, NULL); >> + if (ret < 0) >> + return ret; >> + } >> + >> + return 0; >> } >> >> static int >> > > Thanks for the fix, we indeed have to set owner for all the queue pairs. > > Reviewed-by: Maxime Coquelin > Applied to dpdk-next-net/main, thanks.