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 0C40DA0A02 for ; Tue, 1 Jun 2021 09:51:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA3E1410EE; Tue, 1 Jun 2021 09:51:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id CFFEB40041 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=1622533900; 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=Nd6VZX2SkmjaIlbShh+yY5yOkJvNgOfBl5I8aktrwaHynmwX/a0kdr6eGebZDpdNrneRth g0fGXTESrWOdz8Y/t7CKiOkLCVoG1Azb+JHJYIQ7KRcVMjGcW72qOguYyc9i1dp9k7OMwh LGRvi7L5VE+OxMEGtppl+oMtAWcWBl0= 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-291-9skxRANhOt2T1SVukfFVqQ-1; Tue, 01 Jun 2021 03:51:39 -0400 X-MC-Unique: 9skxRANhOt2T1SVukfFVqQ-1 Received: by mail-wr1-f70.google.com with SMTP id y11-20020adfe6cb0000b0290114d1db9b88so3651931wrm.19 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=XOOuUQAtnsqe8gObaXBldXsqwg0221Q7XnBa/bj6WeDkW+KVGCbyV/gVTJM5Y1eVwE n+mmdkZ7WFjd+xXX8ozube7/KjEN2zr6dZ1xVqahEmvH5MrbmktE14AuzAcD6Zr3LABP st+xSKonUIJkiwUPR7dlicrYZMr5lcNrUN8pZ0umitEtGXUdUb6oOWP6Xt2JGJn0xEWf dWexeD/v2D2mT40UtyRSeHcU6dtz3SNcGz1oorsguRg5aYLLFuEbE1JWhGn0tZGuYrH6 LUNp+KxCr9Zjc53DjyrXd7UoZraRJNVQK+gMETP/vyGEo3CpLG5WksGDO4gicxlxkvz8 j1/g== X-Gm-Message-State: AOAM533EQmhXRram40sD5TriK1CpihLY3lKk/hv51vRGIk4HDZHDXvVX jjr9UpVilOoequtXT37EscvYL1Pu558kEj2gUBs04NTOPSgDVnZ6+e15vs4vwQ8fVVS5c67OOdP 3cRXM+5w= X-Received: by 2002:a05:600c:243:: with SMTP id 3mr584816wmj.35.1622533898108; 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-stable] [PATCH] net/virtio: fix kernel set features for multi-queue devices X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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