Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1235622lfc; Wed, 1 Jun 2022 12:36:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvPcYA5nfuvnVy1CUI5ofsJzF6dlyJHQ17EZEN8eG1/X12mjCcssNjVZX5dkBiaWSJXJxg X-Received: by 2002:a17:90b:4a8c:b0:1e2:f378:631d with SMTP id lp12-20020a17090b4a8c00b001e2f378631dmr1003623pjb.58.1654112190693; Wed, 01 Jun 2022 12:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654112190; cv=none; d=google.com; s=arc-20160816; b=01hHZddYWyKQ+6P8ppKKzEzpni2QHZVaAUqOhu8UxfEcYIBQDijyAvnDldvdMVeG44 4bLIrDQ8Yfz8Z9EGfdTaeC3yIVFlVHy0DltsDTWb7zvfYQBCsj6ePpqTmah35DAGlE1v qBQva6dR2XXfzO9oHukJmpgssCtQ3vSZyG4AOk/ccdQNL1L20KD7P0dqaHc9inSzRqla w46TrnxhWuVmiSkueAkx7X2hUweE2lFcns2sKZ0plUPUEVQ1u69We5txDtZtRmr5ffeo +ZzUaHpyn2lVATWpietqB/SZYk/r6u96E1Wp18KPJHHYdK3gdEQ0Kt5f38gFNmASju19 MnYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7yKbsAaRBxnFfxnHQsz2r5KMqANCbznDVvZ/VbavXuc=; b=rb4GRtuqiuv7xPS8ortzlmEuWwWpRWAs8ZrmNYz7kdP5bMEFZl7elV1yRoKnJZEzHB QBF3Q/9CDvHPWRDCYjQXE5dU3mPd4CAZJrlIu4xkfqdzw5WPbZiQ9VW/UvlcXsJtDhuj wGZbTo33S5a49SDevMeAPCVDtz4LcNxdlKEUS6qzbJnCwyXZoGUutzRbsNAYC3p51kdl ep60BYM1WGDD2uDOmvlu/8Ui7MDKRUDYy7UxFBr24izEfSHRD+KbjhJsdnGwXOKFhu3U FVnkSyqmWxxKt4KsZwqQb+kG5M3KQzRLuWaQC9RCT32/oCy+Z0KsrK3hHXzJ6y0fzRhM Fuow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AzbJ6r7p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g32-20020a635220000000b003fadd961503si3114788pgb.865.2022.06.01.12.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AzbJ6r7p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0FEAA1AEC67; Wed, 1 Jun 2022 12:05:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351503AbiFAJuj (ORCPT + 99 others); Wed, 1 Jun 2022 05:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351530AbiFAJuL (ORCPT ); Wed, 1 Jun 2022 05:50:11 -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 BD2DF3120E for ; Wed, 1 Jun 2022 02:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654077008; 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=7yKbsAaRBxnFfxnHQsz2r5KMqANCbznDVvZ/VbavXuc=; b=AzbJ6r7pmEgyNENfqGkSh83YUq3/j+X/kK1OIEOQjFFtPsMLD40rVLh8pWunP6S/p/GDda NioX+dWMZ97lWwHQgE7O7YuPNtmtbvlnVoqq+ll5nLJG+mehdpWJokbWEszOzLZD/FWTkn 1TBmzVqiA5Hk8fItlxjhiUG9j+OmaTM= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-341-pDVwfhhePC2urKRvVkt16g-1; Wed, 01 Jun 2022 05:50:07 -0400 X-MC-Unique: pDVwfhhePC2urKRvVkt16g-1 Received: by mail-qt1-f199.google.com with SMTP id i5-20020ac85c05000000b00304bbcc1b72so875011qti.17 for ; Wed, 01 Jun 2022 02:50:07 -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:content-transfer-encoding; bh=7yKbsAaRBxnFfxnHQsz2r5KMqANCbznDVvZ/VbavXuc=; b=5b8Xxd3vF5Kbf2lR2ROQS3+oOg3k1GRsJP0BW+xDWFcOV3hmXaAmyB92ttzTUSE5Ik a0omFoqXoThgIbzS6zW9HXz2jt0/CEvJOpk+c2XI12D9C9byuQYiX+Q8DeVCZTphAh65 /8WB6vV9dYKaVcXx9UQ1pnAuKOtlVj/GZoHyjIax1OpGbOpsL5/9jDThk1X9+0bzOtUj i+0GxKhQSa+SzGC93mH2bZKpGzJbhhf5MwdxeyziqgFzZzXxfcP9VGSAZ76iQgj0u1gE 2uvapszh5xAjUX2VM3FTpIv+eR3RIM35WpZUYVKBSOskcJZc90OSbE1Gxm1S70pLpA2j kxAQ== X-Gm-Message-State: AOAM5336gZtVPcHRHE+HESAWXCcHPO4WBaSZPQwsKNqt6iDuG9UB2YP6 C8oBOLA6398ffUe0bJWg1Mq482ffh4LJk3BGZvHNCAcJfZtn22DBj4Inm7Bd7cbiBAJCzprxeUX 2iZG/jCUIa0ORj5a/bG6pTRDYjiG62vSpG71jrFiY X-Received: by 2002:a05:620a:1a07:b0:6a5:dac2:6703 with SMTP id bk7-20020a05620a1a0700b006a5dac26703mr17515273qkb.522.1654077007238; Wed, 01 Jun 2022 02:50:07 -0700 (PDT) X-Received: by 2002:a05:620a:1a07:b0:6a5:dac2:6703 with SMTP id bk7-20020a05620a1a0700b006a5dac26703mr17515258qkb.522.1654077006995; Wed, 01 Jun 2022 02:50:06 -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: Wed, 1 Jun 2022 11:49:30 +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" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_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 Tue, May 31, 2022 at 10:19 PM Parav Pandit wrote: > > > > From: Jason Wang > > Sent: Sunday, May 29, 2022 11:39 PM > > > > On Fri, May 27, 2022 at 6:56 PM Michael S. Tsirkin wro= te: > > > > > > On Thu, May 26, 2022 at 12:54:32PM +0000, Parav Pandit wrote: > > > > > > > > > > > > > From: Eugenio P=C3=A9rez > > > > > Sent: Thursday, May 26, 2022 8:44 AM > > > > > > > > > Implement stop operation for vdpa_sim devices, so vhost-vdpa will > > > > > offer > > > > > > > > > > that backend feature and userspace can effectively stop the devic= e. > > > > > > > > > > > > > > > > > > > > This is a must before get virtqueue indexes (base) for live > > > > > migration, > > > > > > > > > > since the device could modify them after userland gets them. Ther= e > > > > > are > > > > > > > > > > individual ways to perform that action for some devices > > > > > > > > > > (VHOST_NET_SET_BACKEND, VHOST_VSOCK_SET_RUNNING, ...) but > > there > > > > > was no > > > > > > > > > > way to perform it for any vhost device (and, in particular, vhost= -vdpa). > > > > > > > > > > > > > > > > > > > > After the return of ioctl with stop !=3D 0, the device MUST finis= h > > > > > any > > > > > > > > > > pending operations like in flight requests. It must also preserve > > > > > all > > > > > > > > > > the necessary state (the virtqueue vring base plus the possible > > > > > device > > > > > > > > > > specific states) that is required for restoring in the future. Th= e > > > > > > > > > > device must not change its configuration after that point. > > > > > > > > > > > > > > > > > > > > After the return of ioctl with stop =3D=3D 0, the device can cont= inue > > > > > > > > > > processing buffers as long as typical conditions are met (vq is > > > > > enabled, > > > > > > > > > > DRIVER_OK status bit is enabled, etc). > > > > > > > > Just to be clear, we are adding vdpa level new ioctl() that doesn= =E2=80=99t map to > > any mechanism in the virtio spec. > > > > > > > > Why can't we use this ioctl() to indicate driver to start/stop the = device > > instead of driving it through the driver_ok? > > > > This is in the context of other discussion we had in the LM series. > > > > > > If there's something in the spec that does this then let's use that. > > > > Actually, we try to propose a independent feature here: > > > > https://lists.oasis-open.org/archives/virtio-dev/202111/msg00020.html > > > This will stop the device for all the operations. > Once the device is stopped, its state cannot be queried further as device= won't respond. > It has limited use case. > What we need is to stop non admin queue related portion of the device. > Still don't follow this, sorry. Adding the admin vq to the mix, this would stop a device of a device group, but not the whole virtqueue group. If the admin VQ is offered by the PF (since it's not exposed to the guest), it will continue accepting requests as normal. If it's exposed in the VF, I think the best bet is to shadow it, since guest and host requests could conflict. Since this is offered through vdpa, the device backend driver can route it to whatever method works better for the hardware. For example, to send an admin vq command to the PF. That's why it's important to keep the feature as self-contained and orthogonal to others as possible. > > Does it make sense to you? > > > > Thanks > > > > > Unfortunately the LM series seems to be stuck on moving bits around > > > with the admin virtqueue ... > > > > > > -- > > > MST > > > >