Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5774110ioo; Wed, 1 Jun 2022 12:17:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn/xJhfFKOqOmdGmj0JUJeS98gjXoNrkjLeVRbWMn1FaojB/GbO/tDHSEUsAAaBp+s6oit X-Received: by 2002:a17:903:32d2:b0:166:3747:8461 with SMTP id i18-20020a17090332d200b0016637478461mr1016630plr.30.1654111042865; Wed, 01 Jun 2022 12:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654111042; cv=none; d=google.com; s=arc-20160816; b=DVlZditg4/f80AnmxOi93zoDDRUeSNEa4csG0BCB0X7xmDKTWrMsYFPcrUh4Vj8YFg kf0SdQRZQetwIVXeChxhrCjrefXA708hXH+WPBWuKOIDuOh6Pim2+roE8kKQ5r8gzYGU OpnRyyECyMzmW9eAODFPQFRMPZV5jQJD8PCRqeeUTY5eyRiNhkJcP1Yvvaz0loh3EDaV OyrxEbG5Z8UAgX6tkGxicV/oVsUJedCNK8XgkGH34b55Cr+09cnAjn4K/sYaeWCSRlpx OgroFLxUCOOuLJdnh4tVo9fgfrFiTGnhYt1DSphSTEJhpbAP4lfXgKAmpdyF9ieHCPZ4 dcBQ== 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=WB1eoNVPIkOVFlU558AybWrSuZCEkhfGeXbR5VK67Ks=; b=PHuk8aLnVxa19QqCJQ38MJzbHd2204nqDg4U8xFU5Ro4jSJhDuvl4dA6nxjVlDvb9Z nzpCJvDBwClj0W8WjfTSBBy4CqPAJY0CvhhJBQz+uRQncDChTUL8sFxMx9cLlQK+Zr9V KniyywM81qcZaKdWY5H7lW1XiKr+QZb4lSu0IIVpphI9UrcqtOz2MHTB7zqRSpT/oiBT lwMuO4ag7W1rSXcapbyB+HnFoz9lXRMq6sVVv2OuCFQBFCZeSQvhZCNmcrhYmmNueP89 POVzo/mv40BcDy5arEFiMRNT+J8GUU3xp8T8LMSfR7gypO7MH05e7vElHRwR2afwSufB ohIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NHE1ikkm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id h4-20020a170902748400b0015838c0eedbsi2772347pll.506.2022.06.01.12.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:17:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NHE1ikkm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 7845414CDFB; Wed, 1 Jun 2022 11:54:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234941AbiFACmo (ORCPT + 99 others); Tue, 31 May 2022 22:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233771AbiFACmk (ORCPT ); Tue, 31 May 2022 22:42:40 -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 C81A15AA56 for ; Tue, 31 May 2022 19:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654051353; 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=WB1eoNVPIkOVFlU558AybWrSuZCEkhfGeXbR5VK67Ks=; b=NHE1ikkm1SqttpepD2MDmc585dJinB41vZ2tcwdaEv/sI4gKKMlAOMAj4HkI/XTDhmh4bg KkdFI+ut/FHtSVA6Rir9TgGpwlnpCsEZ/pDH/XcGjaXf3JlSlR/plmvBU+i/BWJoQzSQOn QBWgA7giRS1YmYwx+gsQEf1ZoExpOIQ= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-180-iMikUp3UOfm6UmrQ0LTtFA-1; Tue, 31 May 2022 22:42:29 -0400 X-MC-Unique: iMikUp3UOfm6UmrQ0LTtFA-1 Received: by mail-lf1-f69.google.com with SMTP id c6-20020a056512104600b00477b25bfdf8so212195lfb.9 for ; Tue, 31 May 2022 19:42:25 -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=WB1eoNVPIkOVFlU558AybWrSuZCEkhfGeXbR5VK67Ks=; b=VDY5D6vtmef/6jiMh58XSod3KYgeW02iIroxI2qIEQIyyqyud0dEVJAJnk27CxS/MJ USB8igiBp6jR5S35wUbsYjhi4A0XsvxOsfnQKxNy52fwIvlLe8oJSAU7bBcJuz9xGF7T lNGfyQcIwPTXGSPF4KG8ti7CC3q4CpU+ux0cpcRIuOwF5s9Jlk8n+mv3DingpDZqCubE +KKBKMN4F+A9mQ0343jR6weGd7ujATHdDD+oMs7ROSbqAioVX8creL0aJ3tFdwhiQW+X lKAvtKddmuFMMq/qZBRcyamT/osfbWNwuK+hkdzVoc114k1rkXc1+wWsudWZqF/AkQ7N EAjw== X-Gm-Message-State: AOAM533Cfeko871Sj6kVJ3ycEcZizgidVVCLETrWmgSwnfuP3mjGbR0F YJrvlfKRLv7nUtUemepqFhMdWxu+TXC9HZM03KEJ0J/iKRXk+uq9FgpcLwzOypkyMh4YqBtLCYP 8dBQnqT5L9mEHDtXKEBtNrRSjMKEvvJGc3YW4VhNh X-Received: by 2002:a05:6512:c0e:b0:478:5a91:20bb with SMTP id z14-20020a0565120c0e00b004785a9120bbmr39100842lfu.587.1654051344057; Tue, 31 May 2022 19:42:24 -0700 (PDT) X-Received: by 2002:a05:6512:c0e:b0:478:5a91:20bb with SMTP id z14-20020a0565120c0e00b004785a9120bbmr39100798lfu.587.1654051343791; Tue, 31 May 2022 19:42:23 -0700 (PDT) MIME-Version: 1.0 References: <20220526124338.36247-1-eperezma@redhat.com> <20220527065442-mutt-send-email-mst@kernel.org> In-Reply-To: From: Jason Wang Date: Wed, 1 Jun 2022 10:42:12 +0800 Message-ID: Subject: Re: [PATCH v4 0/4] Implement vdpasim stop operation To: Parav Pandit Cc: "Michael S. Tsirkin" , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , "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 Wed, Jun 1, 2022 at 4:19 AM 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. 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. https://lists.oasis-open.org/archives/virtio-comment/202103/msg00008.html > 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. See above. Thanks > > > Does it make sense to you? > > > > Thanks > > > > > Unfortunately the LM series seems to be stuck on moving bits around > > > with the admin virtqueue ... > > > > > > -- > > > MST > > > >