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 14005A0524; Tue, 1 Jun 2021 09:54:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DE62410EE; Tue, 1 Jun 2021 09:54:06 +0200 (CEST) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id 55D0140041 for ; Tue, 1 Jun 2021 09:54:05 +0200 (CEST) Received: by mail-wm1-f53.google.com with SMTP id f20-20020a05600c4e94b0290181f6edda88so907400wmq.2 for ; Tue, 01 Jun 2021 00:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SZnPLFP1cldlRjHcupj0rJqDaGsCjetrCWPmqpQpvb0=; b=Y0pnnnX0hdM9R8F/FwxiWSwkhxv6TumAiUj2WYECKKJyD/iz2pBydp646dXIi7IgZc eeHrlBuSh5EYbx2jgQNMmbxmQb3ym/Lyl/3Y4oANNjXg/y4WE+jcG9MKletxKKMK+70s 4RdA56e89MGGU7cbcPFNLfcpCFbhHXIrwU0BxyN1GBQoFTZCWDJ9NwTVD5SzFtZvj3l8 d4Zt2S9PHQFbO2FTfNrTI4Zic3BsaFa0s8RKWQbFJN0mls3AORzRf8EMTB4Q2r8lUZCx 6BNL7pr6LiIplt3pmSt4KFxXDzn3/LVancgASkxpkj4f2A2j2prBySTzHeApTWIM8pyp yOTA== 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=SZnPLFP1cldlRjHcupj0rJqDaGsCjetrCWPmqpQpvb0=; b=TahRfuJttVtlZ/Hw4QzHAuSAqgeyfh4LttXgRnERYtCjBsHKa1sEVaT4GsBqAfWS6u qvSm9DnpKIADKOR0+Cb2hvVBSS9jKfWDXf/E/zV2bEAe/n5ZE8yulNByoy02aDPz1OcF HFWrT9abRYL/YbNFUhaXPwSxbERrsHtu5tHv9ZiBP2WaHIFnQ6HQuBYxJGulEslTTxvJ j9MHZ0T1ecN44k6UhgyXFFQRkAJege1OLLSRVdgbwEJtSist1F3WHjv6IIZG82W/27zN yPXYOAEuxjxNL0vlGT6a6u/ipbYHDS2y7ut0nWUaIIz1CeiFM83OrIsi+j2Nbq96893M 3+zw== X-Gm-Message-State: AOAM533UUr52g8nzy2NDH3Ptb7hsj5c8kiI5UyJ58AfTaA22t9/K9pQy uccY+mYdAfE1iToljpB5k/+G X-Google-Smtp-Source: ABdhPJz/UA75XGsFUma3l48iVHSgU2LSPWB1QaOqKtiT+BhdcoYb4mMXNpcva1ofLGygCanMgbXGIQ== X-Received: by 2002:a05:600c:19d4:: with SMTP id u20mr25422902wmq.91.1622534045132; Tue, 01 Jun 2021 00:54:05 -0700 (PDT) Received: from [10.16.0.39] (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id s1sm1728075wmj.8.2021.06.01.00.54.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Jun 2021 00:54:04 -0700 (PDT) To: Maxime Coquelin , dev@dpdk.org Cc: Thomas Monjalon , stable@dpdk.org, Maxime Coquelin , Chenbo Xia References: <20210528132038.26464-1-thierry.herbelot@6wind.com> From: Thierry Herbelot Message-ID: <6991cb8d-9965-766a-53cf-c79c6d8b5bd6@6wind.com> Date: Tue, 1 Jun 2021 09:54:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: 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 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" Hello Maxime, On 6/1/21 9:51 AM, Maxime Coquelin wrote: > > > 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? Indeed, GET_FEATURES returns a single value: let's assume the value for the first queue pair is the right one. Thierry > > Reviewed-by: Maxime Coquelin > > Thanks, > Maxime > -- Thierry Herbelot Senior Software Engineer Tel: +33 1 39 30 92 61 http://www.6wind.com/ Follow us: https://www.linkedin.com/company/6wind/ https://twitter.com/6WINDsoftware https://www.youtube.com/user/6windsoftware