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 48EAFA0524; Tue, 1 Jun 2021 09:51:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E791740041; Tue, 1 Jun 2021 09:51:42 +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 9A36740040 for ; Tue, 1 Jun 2021 09:51:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622533901; 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=odJd01Wh280t7pBwVgojrt6eMfb2rPg/XEvDMlQ5Sd4=; b=Ps9ZRWIs1ZnNM87CYmTVzAtgio/4aPT6oFDm4V2VUXgZuszdpTTTgEiNt9nyhChP5RYZs3 H1S99w0Tv3RltvqQR9vgqbMngVF0uWRXOoWVixTHefIus6eetOCH/HK5ZlDqsCo243zqH3 AJCy1Fa4+bMDXMB/HmbHRzzmkXSna5w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-440-2Wd0FdIrP0O_KWoXMX4jJA-1; Tue, 01 Jun 2021 03:51:39 -0400 X-MC-Unique: 2Wd0FdIrP0O_KWoXMX4jJA-1 Received: by mail-wr1-f70.google.com with SMTP id t14-20020adfe44e0000b029011851efa802so87438wrm.11 for ; Tue, 01 Jun 2021 00:51:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=odJd01Wh280t7pBwVgojrt6eMfb2rPg/XEvDMlQ5Sd4=; b=goRsRmfdoBWpp/RfM+NeUSAdKgxzdQu7IPrNmDcIrj7gt4LVoBVpBJPasa9rH9ixsj JuOe1oZiTlsrsGwzagN2TGjoSRpJl3xK7NaWvUawtLe9f9Urnp+x2TNlctZV5JU50PuP m7Uea/PTCHcOU2XIqi/dglsYBf/nUpQq54RUDqbxyUe93dL+Yc2gvg7agJ/Gzqb1aCu/ qwBzYTqQ1RsaxzlIOrEPlTO0G8NXX2dNLBmE+0d7n3Hb2y15phNowu+2MukoO5yci1Dv /gmZiW698ZMl/ujqkFb47jjE4/prFrypE84+hDfqsWtOb642iS14CRso+Etrnb/mY0Ji qrDw== X-Gm-Message-State: AOAM532I2RxIsP+VgQrGQw1k7bIT59On2V1z8EIf2Q+x6lCC6Mpf2gtf N/N/xSv3epleidxmmqxoKS9sbIkdFDTeGCji6+F2mMHxElGTHYee3cliQSnyF2FDEqDbVfVoKe/ WgsE= X-Received: by 2002:a05:600c:243:: with SMTP id 3mr584829wmj.35.1622533898170; Tue, 01 Jun 2021 00:51:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUlHeRPY+QllPrGLXcL/7oj/Vfhw5ZXfmdJNI0FOoJVw01NEhgJBcElLfP0mdfwLeOtFczUw== X-Received: by 2002:a05:600c:243:: with SMTP id 3mr584800wmj.35.1622533897931; Tue, 01 Jun 2021 00:51:37 -0700 (PDT) Received: from [192.168.1.205] (219-230-83-45.ftth.cust.kwaoo.net. [45.83.230.219]) by smtp.gmail.com with ESMTPSA id l13sm2172087wrv.57.2021.06.01.00.51.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Jun 2021 00:51:37 -0700 (PDT) To: Thierry Herbelot , dev@dpdk.org Cc: Thomas Monjalon , stable@dpdk.org, Maxime Coquelin , Chenbo Xia References: <20210528132038.26464-1-thierry.herbelot@6wind.com> From: Maxime Coquelin Message-ID: Date: Tue, 1 Jun 2021 09:51:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210528132038.26464-1-thierry.herbelot@6wind.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mcoqueli@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 kernel set features 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 5/28/21 3:20 PM, Thierry Herbelot wrote: > Restore the original code, where VHOST_SET_FEATURES is applied to > all vhostfds of the device. > > Fixes: cc0151b34dee ("net/virtio: add virtio-user features ops") > Cc: stable@dpdk.org > 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 ad46f10a9300..d65f89e1fc16 100644 > --- a/drivers/net/virtio/virtio_user/vhost_kernel.c > +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c > @@ -158,6 +158,8 @@ static int > vhost_kernel_set_features(struct virtio_user_dev *dev, uint64_t features) > { > struct vhost_kernel_data *data = dev->backend_data; > + uint32_t i; > + int ret; > > /* We don't need memory protection here */ > features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM); > @@ -166,7 +168,16 @@ vhost_kernel_set_features(struct virtio_user_dev *dev, uint64_t features) > features &= ~VHOST_KERNEL_HOST_OFFLOADS_MASK; > features &= ~(1ULL << VIRTIO_NET_F_MQ); > > - return vhost_kernel_ioctl(data->vhostfds[0], VHOST_SET_FEATURES, &features); > + for (i = 0; i < dev->max_queue_pairs; ++i) { > + if (data->vhostfds[i] < 0) > + continue; > + > + ret = vhost_kernel_ioctl(data->vhostfds[i], VHOST_SET_FEATURES, &features); > + if (ret < 0) > + return ret; > + } > + > + return 0; > } > > static int > Thanks for fixing it, it should be the last one... Except GET_FEATURES that was also queried for every queue pair, but I don't think it makes sense to query it and just drop the value read. What do you think? Reviewed-by: Maxime Coquelin Thanks, Maxime