Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6262840ioo; Thu, 2 Jun 2022 02:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhCCoNSfYKjtziWopDUkyZwA8mPhtftcXe/7+GkarcQUkycW8XSSK0wH26nEIWbVveuBCB X-Received: by 2002:a50:fe83:0:b0:42a:b5f4:8a52 with SMTP id d3-20020a50fe83000000b0042ab5f48a52mr4314056edt.105.1654162616529; Thu, 02 Jun 2022 02:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654162616; cv=none; d=google.com; s=arc-20160816; b=0WQ37yZqc1nRcMvrDoiGip+J/+THboPYC1sR3fhttyy6O3qiEzES99lBZ4w6fq/KfH uX0Xbquok+qLA/dE9Ka80dOQp1oVfoQ/tLurkl7JY6BvTa30MaabL/VtOH7dYmkD7tNu Ff9mak/nqlZijzokzX79R9mbvg0XQbZdy4Im8eEElCISHKZXD/tAbI4HzgcxNdlHpDhI 9psnvwdEIw8CD0h3ktK/+k/NoB5evyVGjCJQM3QUmCfNxPwpHOLQekmLXO4VISdDuOPu Tqabpee0v+JwGxpjknlxyfu/yGVYZbS9Pna7iVsyGgEujzW7u/Ir0kW3Tuz4RwD32xnh 2jqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EA4sjAo0s1UJhwaoiLkeLMjmAdZWjnEWcCJT8pCAuaE=; b=LkSHUt2nkr3Aq0ihO/5Zerw4xplNp8UGMX5pDHVhbCHzm7PdB+lnZ/dwSRsWSxHu6v ejoSru2p8io30msuUassfAlPUKyjOspt7zIyOQQxrQxZL71IEzMROD0gV+YQodGQSRwv 6mE+AxpO4pHA4g+3oO2lyYV55Glv++Xumw1qj7UPJmt7N5pjqnl3Refj904vEQmLwmOJ 36tAhbHgPbUHpRE+SFglGBwgfZvidzR2pdnpnsm03sK3YnsJDdisrFA+QjsX77s+YvM3 XZ5jOcMJq7OaBtdNGMWh5UgPeAl/KB469PlAYYg9hemB9f2TqAGW0ENM/wxAIr+74pi4 Slcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fIjSgMY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a05640242c200b0042dc11ce6b9si5381021edc.96.2022.06.02.02.36.30; Thu, 02 Jun 2022 02:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fIjSgMY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232637AbiFBI6b (ORCPT + 99 others); Thu, 2 Jun 2022 04:58:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232647AbiFBI61 (ORCPT ); Thu, 2 Jun 2022 04:58:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86C0C1F2322 for ; Thu, 2 Jun 2022 01:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654160300; 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: in-reply-to:in-reply-to:references:references; bh=EA4sjAo0s1UJhwaoiLkeLMjmAdZWjnEWcCJT8pCAuaE=; b=fIjSgMY9CNqSJwSskJwSv5bPvCdAjvwYapZku0k4pZNnIKIxN9hYJNytyFno7TqORW8RpX 9VJ+mA1iebuD1VkAZC9IsuCp96QAfkor/7V+4NPJtQuwhM63Hi3pRanzkbaeVsr5mY3xnr uFHobasZBHdbKDA8VVdMbq1XBNPNppA= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-413-NV-lMlMfMKWEiv_e8r7Hrg-1; Thu, 02 Jun 2022 04:58:19 -0400 X-MC-Unique: NV-lMlMfMKWEiv_e8r7Hrg-1 Received: by mail-qt1-f197.google.com with SMTP id m18-20020a05622a119200b00304b4e57cbfso3204674qtk.18 for ; Thu, 02 Jun 2022 01:58:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EA4sjAo0s1UJhwaoiLkeLMjmAdZWjnEWcCJT8pCAuaE=; b=BUYWoHyRs5cxL2JRNKPRBLeYhU4XlIVpssq5y/WzQOVb0AwfHhTJzfcFuJ7TbqDFK4 DbM0LkJDtDACjKEuTO06LapJBL6Qrxktc8+uQYlBRsOXCO4WwrvfXldEHn7bmwzhNbVw hGXuRPOTeMi3ul4QHYV/lxxuK6VcvF6O8H+83eMEtgRb2RK4W0E1RqMkn54WaYEzPMZ+ n++1MHhWay93/jA9/D1ElKINdPslkkUo1IbSTWdQ/BmagckoF0tLp38LKh9iiPQUVSAo RuhfmfeQXGn60uCOYjWVZlyue3q/MjIfJnPguE//zdumQUBWRit3jVgU0ltTeB5VLmgf PwMw== X-Gm-Message-State: AOAM530mbJurHWxrnRs2vDIBph4W/4RsH6Lhulk0g9OUHYKvNre+jWDP MPI7edivM75Kuu5HArE1PBZ2OtT8sENiGS1B4vnElVDkVDy1dEj/f0T8zCPB9hnHBmIlBuCdRrG xokdl6F1m+0jJz7eVfbh4YlqZGYqqFJ7jp9jshkqx X-Received: by 2002:a05:620a:1a07:b0:6a5:dac2:6703 with SMTP id bk7-20020a05620a1a0700b006a5dac26703mr2393926qkb.522.1654160299010; Thu, 02 Jun 2022 01:58:19 -0700 (PDT) X-Received: by 2002:a05:620a:1a07:b0:6a5:dac2:6703 with SMTP id bk7-20020a05620a1a0700b006a5dac26703mr2393906qkb.522.1654160298779; Thu, 02 Jun 2022 01:58:18 -0700 (PDT) MIME-Version: 1.0 References: <20220526124338.36247-1-eperezma@redhat.com> <20220527065442-mutt-send-email-mst@kernel.org> In-Reply-To: From: Eugenio Perez Martin Date: Thu, 2 Jun 2022 10:57:42 +0200 Message-ID: Subject: Re: [PATCH v4 0/4] Implement vdpasim stop operation To: Parav Pandit Cc: Jason Wang , "Michael S. Tsirkin" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "martinh@xilinx.com" , Stefano Garzarella , "martinpo@xilinx.com" , "lvivier@redhat.com" , "pabloc@xilinx.com" , Eli Cohen , Dan Carpenter , Xie Yongji , Christophe JAILLET , Zhang Min , Wu Zongyong , "lulu@redhat.com" , Zhu Lingshan , "Piotr.Uminski@intel.com" , Si-Wei Liu , "ecree.xilinx@gmail.com" , "gautam.dawar@amd.com" , "habetsm.xilinx@gmail.com" , "tanuj.kamde@amd.com" , "hanand@xilinx.com" , "dinang@xilinx.com" , Longpeng Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 2, 2022 at 4:59 AM Parav Pandit wrote: > > > > From: Jason Wang > > Sent: Wednesday, June 1, 2022 10:00 PM > > > > On Thu, Jun 2, 2022 at 2:58 AM Parav Pandit wrote: > > > > > > > > > > From: Jason Wang > > > > Sent: Tuesday, May 31, 2022 10:42 PM > > > > > > > > Well, the ability to query the virtqueue state was proposed as > > > > another feature (Eugenio, please correct me). This should be > > > > sufficient for making virtio-net to be live migrated. > > > > > > > The device is stopped, it won't answer to this special vq config done here. > > > > This depends on the definition of the stop. Any query to the device state > > should be allowed otherwise it's meaningless for us. > > > > > Programming all of these using cfg registers doesn't scale for on-chip > > memory and for the speed. > > > > Well, they are orthogonal and what I want to say is, we should first define > > the semantics of stop and state of the virtqueue. > > > > Such a facility could be accessed by either transport specific method or admin > > virtqueue, it totally depends on the hardware architecture of the vendor. > > > I find it hard to believe that a vendor can implement a CVQ but not AQ and chose to expose tens of hundreds of registers. > But maybe, it fits some specific hw. > > I like to learn the advantages of such method other than simplicity. > > We can clearly that we are shifting away from such PCI registers with SIOV, IMS and other scalable solutions. > virtio drifting in reverse direction by introducing more registers as transport. > I expect it to an optional transport like AQ. > > > > > > > Next would be to program hundreds of statistics of the 64 VQs through a > > giant PCI config space register in some busy polling scheme. > > > > We don't need giant config space, and this method has been implemented > > by some vDPA vendors. > > > There are tens of 64-bit counters per VQs. These needs to programmed on destination side. > Programming these via registers requires exposing them on the registers. > In one of the proposals, I see them being queried via CVQ from the device. > > Programming them via cfg registers requires large cfg space or synchronous programming until receiving ACK from it. > This means one entry at a time... > > Programming them via CVQ needs replicate and align cmd values etc on all device types. All duplicate and hard to maintain. > I think this discussion should be moved to the proposals on virtio-comment. In the vdpa context, they should be covered. This one is about exposing the basic facility of stopping and resuming a device to userland, and it fits equally well if the device implements it via cfg registers, via admin vq, via channel I/O, or via whatever transport the vdpa backend prefers. To ask for the state is already covered in the vhost layer, and this proposal does not affect it. Given the flexibility of vdpa, we can even ask vq state using backend-specific methods, cache it (knowing that there will be no change of them until resume or DRIVER_OK), and expose them to qemu using config space interface or any other batch method. Same as with the enable_vq problem. And the same applies to stats. And we maintain compatibility with all vendor-specific control plane. Would that work for devices that cannot or does not want to expose them via config space? Thanks! > > > > > > > I can clearly see how all these are inefficient for faster LM. > > > We need an efficient AQ to proceed with at minimum. > > > > I'm fine with admin virtqueue, but the stop and state are orthogonal to that. > > And using admin virtqueue for stop/state will be more natural if we use > > admin virtqueue as a transport. > Ok. > We should have defined it bit earlier that all vendors can use. :(