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 E1594A0524; Tue, 13 Apr 2021 10:45:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C986B160CA9; Tue, 13 Apr 2021 10:45:45 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 5D255160C9F for ; Tue, 13 Apr 2021 10:45:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618303543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wol2BYUbLeTeOce9jK+u2/29WeDpqqgN/QE5jBjXUJw=; b=DUc7qaZa25PrzFPC0nmIHaANtq0aXgRoNS9LkKJm2t+yXOdS53Gfqznq8wR9/krvQomRwm YMZJ7UthPLISTAw26/DJ8P21Te69CU0rlursHYcN/GwuCJaHpP1wayx25CMfy8K0TpmjkJ 0pdEYsfxzrh8Kqn64IBAxzMwErI+4Mo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-c2YzpgUaMIuA7_LAiD0akg-1; Tue, 13 Apr 2021 04:45:41 -0400 X-MC-Unique: c2YzpgUaMIuA7_LAiD0akg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F470802B40; Tue, 13 Apr 2021 08:45:40 +0000 (UTC) Received: from [10.36.110.28] (unknown [10.36.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 367696F985; Tue, 13 Apr 2021 08:45:39 +0000 (UTC) To: Thierry Herbelot , dev@dpdk.org Cc: Thomas Monjalon , Chenbo Xia References: <20210408123729.9884-1-thierry.herbelot@6wind.com> From: Maxime Coquelin Message-ID: <50803007-9628-e23c-001f-77d8fee3b571@redhat.com> Date: Tue, 13 Apr 2021 10:45:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210408123729.9884-1-thierry.herbelot@6wind.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 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" 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 Thanks, Maxime