From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 297AAC00140 for ; Tue, 26 Jul 2022 19:52:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8785D40881; Tue, 26 Jul 2022 19:52:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8785D40881 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AaIRRL94 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QcJ2KG9BRPo6; Tue, 26 Jul 2022 19:52:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0F8AE40872; Tue, 26 Jul 2022 19:52:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0F8AE40872 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AE0EFC0033; Tue, 26 Jul 2022 19:52:12 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7C57AC002D for ; Tue, 26 Jul 2022 19:52:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 439008131E for ; Tue, 26 Jul 2022 19:52:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 439008131E Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AaIRRL94 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tiK-a9CJEbRC for ; Tue, 26 Jul 2022 19:52:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2309A80D7E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2309A80D7E for ; Tue, 26 Jul 2022 19:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658865127; 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=6CZKvjEOWarDPKvw674EQUQEiUqD5ev91Kf4ytKkJWM=; b=AaIRRL94sgYbEcAwlWyBWRhGcmTLUeqbiNWHNdYp2rDSEh6cPZzkn5in4lxNDJVWyT56zj gocn4BvLPK63SUJF65A+FYy2GcLZKvs86bUtQ1av9vhB5ATtBoV4D+NaJPAulfNbNeVzMk hEBRIUUgn2jHUyAtG44AREGBwJZx9Ho= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-53-LH7Dze15MAiOGasdiXL0Lw-1; Tue, 26 Jul 2022 15:52:06 -0400 X-MC-Unique: LH7Dze15MAiOGasdiXL0Lw-1 Received: by mail-wm1-f71.google.com with SMTP id v67-20020a1cac46000000b003a2be9fa09cso8049659wme.3 for ; Tue, 26 Jul 2022 12:52:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=6CZKvjEOWarDPKvw674EQUQEiUqD5ev91Kf4ytKkJWM=; b=PBETurxJYaehSNl7kA8obIvbTHYcrmCnZZtnVqkzcMmLMfn8zUG8jP5hHyvlmByhLZ x5wf0XDb/ogldZ+WG3vLg34MgbVMNwuwa1FCsrfvLafUvkXQ09Yj5ckK29wfFQwNEAC3 ze58M3Di47NWbCryutK7yu2lsmi6pK0VSPnz8Je1SbMRdIkUbQe6VjtoQBLDJbdBFE28 +R0umjb89hpoPWYBgDVWAg88V2d0Y6Qg1cbnSLMwEAMRjUWrjCGIxb8zR/J5XH8jmr8x teb+fwJG5H/uIQ6cF1d+sLFoASgpqUuNN6ADMXU2Jl7GNt38WMh3VI0C40VRJPhhq6z0 0O5g== X-Gm-Message-State: AJIora/R28hQrtXI3CaOZx17Elew+K+QextPxmmxdHPUGZ8yNFH+C6KK 827JlTsg3WNz133NadItvSyU8yoi3uO/HTXtWGA1K0hDXo6TnJQD6D6gZ/mv3dOqmxBPi4NyWZZ vcavkkbT4W4+UDA1h78x8/gSfGUfY2IPwuhxLY1CF3g== X-Received: by 2002:a5d:46c7:0:b0:21e:3c82:2df with SMTP id g7-20020a5d46c7000000b0021e3c8202dfmr12145049wrs.519.1658865125315; Tue, 26 Jul 2022 12:52:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDBuORhAbQFR+DTzJRgUoP8PjptZcpyG6r4ergrYBtY3opWPHGede0qqU+ohFSqoQtmnZbzA== X-Received: by 2002:a5d:46c7:0:b0:21e:3c82:2df with SMTP id g7-20020a5d46c7000000b0021e3c8202dfmr12145024wrs.519.1658865124814; Tue, 26 Jul 2022 12:52:04 -0700 (PDT) Received: from redhat.com ([2a06:c701:7424:0:3d16:86dc:de54:5671]) by smtp.gmail.com with ESMTPSA id i6-20020a5d5226000000b0021d6d9c0bd9sm15158827wra.82.2022.07.26.12.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 12:52:04 -0700 (PDT) Date: Tue, 26 Jul 2022 15:52:01 -0400 From: "Michael S. Tsirkin" To: Parav Pandit Subject: Re: [PATCH V3 5/6] vDPA: answer num of queue pairs = 1 to userspace when VIRTIO_NET_F_MQ == 0 Message-ID: <20220726154930-mutt-send-email-mst@kernel.org> References: <20220701132826.8132-6-lingshan.zhu@intel.com> <00c1f5e8-e58d-5af7-cc6b-b29398e17c8b@intel.com> <1246d2f1-2822-0edb-cd57-efc4015f05a2@intel.com> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "xieyongji@bytedance.com" , "gautam.dawar@amd.com" , "Zhu, Lingshan" X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" T24gVHVlLCBKdWwgMjYsIDIwMjIgYXQgMDM6NTY6MzJQTSArMDAwMCwgUGFyYXYgUGFuZGl0IHdy b3RlOgo+IAo+ID4gRnJvbTogWmh1LCBMaW5nc2hhbiA8bGluZ3NoYW4uemh1QGludGVsLmNvbT4K PiA+IFNlbnQ6IFR1ZXNkYXksIEp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XZpY2UgaGFzIG9uZSBWUSBwYWlyLgoKWWVzIHRoYXQncyBmaW5lLiBBbmQgaWYg d2UganVzdCBkaWRuJ3QgcmV0dXJuIGFueXRoaW5nIHdpdGhvdXQgTVEgdGhhdAp3b3VsZCBiZSBm aW5lLiAgQnV0IElJVUMgbmV0bGluayByZXBvcnRzIHRoZSAjIG9mIHBhaXJzIHJlZ2FyZGxlc3Ms IGl0Cmp1c3QgcHV0cyAwIHRoZXJlLgoKLS0gCk1TVAoKX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18KVmlydHVhbGl6YXRpb24gbWFpbGluZyBsaXN0ClZpcnR1 YWxpemF0aW9uQGxpc3RzLmxpbnV4LWZvdW5kYXRpb24ub3JnCmh0dHBzOi8vbGlzdHMubGludXhm b3VuZGF0aW9uLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3ZpcnR1YWxpemF0aW9u From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E538C00140 for ; Tue, 26 Jul 2022 19:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231840AbiGZTwL (ORCPT ); Tue, 26 Jul 2022 15:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbiGZTwK (ORCPT ); Tue, 26 Jul 2022 15:52:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD5F73134F for ; Tue, 26 Jul 2022 12:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658865127; 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=6CZKvjEOWarDPKvw674EQUQEiUqD5ev91Kf4ytKkJWM=; b=AaIRRL94sgYbEcAwlWyBWRhGcmTLUeqbiNWHNdYp2rDSEh6cPZzkn5in4lxNDJVWyT56zj gocn4BvLPK63SUJF65A+FYy2GcLZKvs86bUtQ1av9vhB5ATtBoV4D+NaJPAulfNbNeVzMk hEBRIUUgn2jHUyAtG44AREGBwJZx9Ho= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-2tZaqe4yNI22gjLtvItaig-1; Tue, 26 Jul 2022 15:52:06 -0400 X-MC-Unique: 2tZaqe4yNI22gjLtvItaig-1 Received: by mail-wm1-f71.google.com with SMTP id i184-20020a1c3bc1000000b003a026f48333so8041268wma.4 for ; Tue, 26 Jul 2022 12:52:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=6CZKvjEOWarDPKvw674EQUQEiUqD5ev91Kf4ytKkJWM=; b=vBIL4n9YHFP46OmHtFqXPwhZkVc0EZcr0YNLo5Hx/dtTKryypO24BDL3s7c8VvbRes Zw4C1fLQB/5FXNIV7HSjItaN05MR2RTsSQa4AVw6Y75isEjear7lW3x+nKpEmjAUdhw8 dm744tGqHgbbznxHkT0yBKwOz4rmOU036dV2mYkcZ+NmAyULW54+dTzdY2aCTZh2UNP3 tFFNngUg0IIsHQYKSYYa0LJx2NvhFdnDO8NbzOxUBGCLARB9jKGlA8vqkuMtGtUnoiIY hQG0TJsjVrBfEF8Ysm1yfzjBc0BwvVuW4B1PY2KiTmPntrmBhuoNhpwqUBxM7uY09ioq ZOkg== X-Gm-Message-State: AJIora8zkw4QomR/kEN/j18nlvsMGAipvqrJvxQm3t3o5hr70GLUeneM bS2MmzDV4mCzthHzEtdYee6xEs9L7ujph0DPtt1BESXlJhPqVhwkIKwQzz4jr6G7Bu1EDkSdnCo aYm7Fx7SmgmRa7Rln X-Received: by 2002:a5d:46c7:0:b0:21e:3c82:2df with SMTP id g7-20020a5d46c7000000b0021e3c8202dfmr12145050wrs.519.1658865125315; Tue, 26 Jul 2022 12:52:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDBuORhAbQFR+DTzJRgUoP8PjptZcpyG6r4ergrYBtY3opWPHGede0qqU+ohFSqoQtmnZbzA== X-Received: by 2002:a5d:46c7:0:b0:21e:3c82:2df with SMTP id g7-20020a5d46c7000000b0021e3c8202dfmr12145024wrs.519.1658865124814; Tue, 26 Jul 2022 12:52:04 -0700 (PDT) Received: from redhat.com ([2a06:c701:7424:0:3d16:86dc:de54:5671]) by smtp.gmail.com with ESMTPSA id i6-20020a5d5226000000b0021d6d9c0bd9sm15158827wra.82.2022.07.26.12.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 12:52:04 -0700 (PDT) Date: Tue, 26 Jul 2022 15:52:01 -0400 From: "Michael S. Tsirkin" To: Parav Pandit Cc: "Zhu, Lingshan" , "jasowang@redhat.com" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "xieyongji@bytedance.com" , "gautam.dawar@amd.com" Subject: Re: [PATCH V3 5/6] vDPA: answer num of queue pairs = 1 to userspace when VIRTIO_NET_F_MQ == 0 Message-ID: <20220726154930-mutt-send-email-mst@kernel.org> References: <20220701132826.8132-6-lingshan.zhu@intel.com> <00c1f5e8-e58d-5af7-cc6b-b29398e17c8b@intel.com> <1246d2f1-2822-0edb-cd57-efc4015f05a2@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jul 26, 2022 at 03:56:32PM +0000, Parav Pandit wrote: > > > From: Zhu, Lingshan > > Sent: Tuesday, July 12, 2022 11:46 PM > > > When the user space which invokes netlink commands, detects that _MQ > > is not supported, hence it takes max_queue_pair = 1 by itself. > > I think the kernel module have all necessary information and it is the only > > one which have precise information of a device, so it should answer precisely > > than let the user space guess. The kernel module should be reliable than stay > > silent, leave the question to the user space tool. > Kernel is reliable. It doesn’t expose a config space field if the field doesn’t exist regardless of field should have default or no default. > User space should not guess either. User space gets to see if _MQ present/not present. If _MQ present than get reliable data from kernel. > If _MQ not present, it means this device has one VQ pair. Yes that's fine. And if we just didn't return anything without MQ that would be fine. But IIUC netlink reports the # of pairs regardless, it just puts 0 there. -- MST