Message ID | 56c045ac70e44e7d80f3f9e901deae3d7485b2a1.1666082013.git.sebastien.boeuf@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1849684wrs; Tue, 18 Oct 2022 02:04:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WuujMUsSG3m6+jDBbUiT8LgyJWuW8Dx+5HxBFqyy2Y6P0RxPhYgz7Cs0WwJYEC/EPKqSL X-Received: by 2002:a17:907:7f05:b0:78d:e869:f2fe with SMTP id qf5-20020a1709077f0500b0078de869f2femr1477765ejc.684.1666083851207; Tue, 18 Oct 2022 02:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666083851; cv=none; d=google.com; s=arc-20160816; b=ayM6sPRdKLjmIabkxuZME3EWkwm8qoGdoZQ8UUmzHqiovuyCyHTjn2vkIutCOQSHn2 cWoyelSVoZY4vQFew1UZTxbogO4OpyJ2bwjGXYoR+Fnnz01h5dHoK60+r6UsrKHACr9v HAyG4nzlOYf7Uui3bQnUHHqNHWuS1B3QMiwze3IybxW2YX17K/3DOJIzCLYgVtQDJ0Ym YL+laXEsUdO+CsJC3rI3G2/ICVlmRrExw2ryNWVWmspj2/Xgjd+A8SbeIDmtvBLsS9xt mPDs2NWoNJqSMsYQbmhqle/pIt0S5ce+IzP8gHSkNVy2C13UyfUiON3p7AyFmgUFn8h4 DlTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FyhY/8syAmv1FOjt3RsBJ+gOvlbuX8cadnh6tpus/2I=; b=GcwMrxP0T0hrgnhLl9qJOMzYLtQbkbdaROv8SBOxY3HZ8VOsiJX8wwN2/tYIO9CMdx m/sxAEbXXm2ThRwqdd/aXVK49CLmZcpY1JQREPaipnyYlucDT/IigP56e0y1qi6hj8Zy u2RqwApbRYGNLR8DihQUkum09Lr/g5sDGuR7Jp6B1q1ARNO3aspJ8iaJXkRtCA3kELXs BwNuOYmuaQg2yRiFz+6G4FKU3DFFYQt2KvmoUE3xpjcIY6DGy1Bw6HvSu2bCsr1GhFz9 9EQ+RuzlTY/jkU3FmIEKEBc8ydwSEvLX1nHhccCrhWElvUi+og6+dmhgAGklRJOlkoJ5 9MoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G2co5r0G; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020aa7dbd2000000b00447d6f244c6si9796555edt.248.2022.10.18.02.03.46; Tue, 18 Oct 2022 02:04:11 -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=@intel.com header.s=Intel header.b=G2co5r0G; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbiJRIic (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Tue, 18 Oct 2022 04:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbiJRIiV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Oct 2022 04:38:21 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C91769F773 for <linux-kernel@vger.kernel.org>; Tue, 18 Oct 2022 01:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666082296; x=1697618296; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PL0A8+uYcphH0sIJRwXwGnLqTPe3EEcbUoVnkmTTq0Q=; b=G2co5r0GCuLEe7+tygjD5t455Tjk+9n4WGRgvg0HGN3s6R7eXNB6Ic8f LE5Keykfo8lHhuuwi49RMlKzgrYavRuIB2LX3XFNsAJQjK4hPza9sCAGZ 398qzHQ2nCb+PoKt2o6T1nywo6ndDScV9xdO+rxmzIUlJ379Sgct5G09X Fz22WBnQAYxs9dDaSOxeJ9712flzGnKdSMXoqOB6dpTd803hY4oWVT04G pYnfD4fdxeNNY48HOALmbLFKm4Att1mzcia0VOMeta5sxrupWE4W3RZjc XRYVpDOP2YgbhL9/xBDEPoq6rFHZgmHpmD1jL7WtLp8sM1pHf8Ye0ZelU A==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="368069143" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="368069143" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 01:38:15 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="753951155" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="753951155" Received: from aboyhan-mobl1.ger.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.26.192]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 01:38:13 -0700 From: sebastien.boeuf@intel.com To: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com, sebastien.boeuf@intel.com Subject: [PATCH v4 4/4] vdpa_sim: Implement resume vdpa op Date: Tue, 18 Oct 2022 10:37:27 +0200 Message-Id: <56c045ac70e44e7d80f3f9e901deae3d7485b2a1.1666082013.git.sebastien.boeuf@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1666082013.git.sebastien.boeuf@intel.com> References: <cover.1666082013.git.sebastien.boeuf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LOTS_OF_MONEY, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747015540163004197?= X-GMAIL-MSGID: =?utf-8?q?1747015540163004197?= |
Series |
vdpa: Add resume operation
|
|
Commit Message
Boeuf, Sebastien
Oct. 18, 2022, 8:37 a.m. UTC
From: Sebastien Boeuf <sebastien.boeuf@intel.com> Implement resume operation for vdpa_sim devices, so vhost-vdpa will offer that backend feature and userspace can effectively resume the device. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Comments
Hi, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mst-vhost/linux-next] [also build test WARNING on linus/master v6.1-rc1 next-20221018] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/sebastien-boeuf-intel-com/vdpa-Add-resume-operation/20221018-163858 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next patch link: https://lore.kernel.org/r/56c045ac70e44e7d80f3f9e901deae3d7485b2a1.1666082013.git.sebastien.boeuf%40intel.com patch subject: [PATCH v4 4/4] vdpa_sim: Implement resume vdpa op config: x86_64-allyesconfig compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/63349eb63715840620ea16e0098110ad5883b901 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review sebastien-boeuf-intel-com/vdpa-Add-resume-operation/20221018-163858 git checkout 63349eb63715840620ea16e0098110ad5883b901 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/vdpa/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_resume': >> drivers/vdpa/vdpa_sim/vdpa_sim.c:533:13: warning: unused variable 'i' [-Wunused-variable] 533 | int i; | ^ vim +/i +533 drivers/vdpa/vdpa_sim/vdpa_sim.c 529 530 static int vdpasim_resume(struct vdpa_device *vdpa) 531 { 532 struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > 533 int i; 534 535 spin_lock(&vdpasim->lock); 536 vdpasim->running = true; 537 spin_unlock(&vdpasim->lock); 538 539 return 0; 540 } 541
On Tue, Oct 18, 2022 at 10:38 AM <sebastien.boeuf@intel.com> wrote: > > From: Sebastien Boeuf <sebastien.boeuf@intel.com> > > Implement resume operation for vdpa_sim devices, so vhost-vdpa will > offer that backend feature and userspace can effectively resume the > device. > > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> > --- > drivers/vdpa/vdpa_sim/vdpa_sim.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c > index b071f0d842fb..05e3802fb746 100644 > --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c > +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c > @@ -527,6 +527,18 @@ static int vdpasim_suspend(struct vdpa_device *vdpa) > return 0; > } > > +static int vdpasim_resume(struct vdpa_device *vdpa) > +{ > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + int i; > + > + spin_lock(&vdpasim->lock); > + vdpasim->running = true; > + spin_unlock(&vdpasim->lock); > + > + return 0; > +} > + To never kick at resuming is not the right thing to do :). Maybe to store in the vdpasim_virtqueue if it was kicked during the suspend window? Thanks! > static size_t vdpasim_get_config_size(struct vdpa_device *vdpa) > { > struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > @@ -717,6 +729,7 @@ static const struct vdpa_config_ops vdpasim_config_ops = { > .set_status = vdpasim_set_status, > .reset = vdpasim_reset, > .suspend = vdpasim_suspend, > + .resume = vdpasim_resume, > .get_config_size = vdpasim_get_config_size, > .get_config = vdpasim_get_config, > .set_config = vdpasim_set_config, > @@ -750,6 +763,7 @@ static const struct vdpa_config_ops vdpasim_batch_config_ops = { > .set_status = vdpasim_set_status, > .reset = vdpasim_reset, > .suspend = vdpasim_suspend, > + .resume = vdpasim_resume, > .get_config_size = vdpasim_get_config_size, > .get_config = vdpasim_get_config, > .set_config = vdpasim_set_config, > -- > 2.34.1 > > --------------------------------------------------------------------- > Intel Corporation SAS (French simplified joint stock company) > Registered headquarters: "Les Montalets"- 2, rue de Paris, > 92196 Meudon Cedex, France > Registration Number: 302 456 199 R.C.S. NANTERRE > Capital: 5 208 026.16 Euros > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. >
On Wed, 2022-10-19 at 11:31 +0200, Eugenio Perez Martin wrote: > On Tue, Oct 18, 2022 at 10:38 AM <sebastien.boeuf@intel.com> wrote: > > > > From: Sebastien Boeuf <sebastien.boeuf@intel.com> > > > > Implement resume operation for vdpa_sim devices, so vhost-vdpa will > > offer that backend feature and userspace can effectively resume the > > device. > > > > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> > > --- > > drivers/vdpa/vdpa_sim/vdpa_sim.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c > > b/drivers/vdpa/vdpa_sim/vdpa_sim.c > > index b071f0d842fb..05e3802fb746 100644 > > --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c > > +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c > > @@ -527,6 +527,18 @@ static int vdpasim_suspend(struct vdpa_device > > *vdpa) > > return 0; > > } > > > > +static int vdpasim_resume(struct vdpa_device *vdpa) > > +{ > > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > > + int i; > > + > > + spin_lock(&vdpasim->lock); > > + vdpasim->running = true; > > + spin_unlock(&vdpasim->lock); > > + > > + return 0; > > +} > > + > > To never kick at resuming is not the right thing to do :). > > Maybe to store in the vdpasim_virtqueue if it was kicked during the > suspend window? > > Thanks! Let's hear what Michael think about this approach? I just want to make sure we're all on the same page before I send the next version :) Thanks, Sebastien > > > > > static size_t vdpasim_get_config_size(struct vdpa_device *vdpa) > > { > > struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > > @@ -717,6 +729,7 @@ static const struct vdpa_config_ops > > vdpasim_config_ops = { > > .set_status = vdpasim_set_status, > > .reset = vdpasim_reset, > > .suspend = vdpasim_suspend, > > + .resume = vdpasim_resume, > > .get_config_size = vdpasim_get_config_size, > > .get_config = vdpasim_get_config, > > .set_config = vdpasim_set_config, > > @@ -750,6 +763,7 @@ static const struct vdpa_config_ops > > vdpasim_batch_config_ops = { > > .set_status = vdpasim_set_status, > > .reset = vdpasim_reset, > > .suspend = vdpasim_suspend, > > + .resume = vdpasim_resume, > > .get_config_size = vdpasim_get_config_size, > > .get_config = vdpasim_get_config, > > .set_config = vdpasim_set_config, > > -- > > 2.34.1 > > > > ------------------------------------------------------------------- > > -- > > Intel Corporation SAS (French simplified joint stock company) > > Registered headquarters: "Les Montalets"- 2, rue de Paris, > > 92196 Meudon Cedex, France > > Registration Number: 302 456 199 R.C.S. NANTERRE > > Capital: 5 208 026.16 Euros > > > > This e-mail and any attachments may contain confidential material > > for > > the sole use of the intended recipient(s). Any review or > > distribution > > by others is strictly prohibited. If you are not the intended > > recipient, please contact the sender and delete all copies. > > > --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index b071f0d842fb..05e3802fb746 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -527,6 +527,18 @@ static int vdpasim_suspend(struct vdpa_device *vdpa) return 0; } +static int vdpasim_resume(struct vdpa_device *vdpa) +{ + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + int i; + + spin_lock(&vdpasim->lock); + vdpasim->running = true; + spin_unlock(&vdpasim->lock); + + return 0; +} + static size_t vdpasim_get_config_size(struct vdpa_device *vdpa) { struct vdpasim *vdpasim = vdpa_to_sim(vdpa); @@ -717,6 +729,7 @@ static const struct vdpa_config_ops vdpasim_config_ops = { .set_status = vdpasim_set_status, .reset = vdpasim_reset, .suspend = vdpasim_suspend, + .resume = vdpasim_resume, .get_config_size = vdpasim_get_config_size, .get_config = vdpasim_get_config, .set_config = vdpasim_set_config, @@ -750,6 +763,7 @@ static const struct vdpa_config_ops vdpasim_batch_config_ops = { .set_status = vdpasim_set_status, .reset = vdpasim_reset, .suspend = vdpasim_suspend, + .resume = vdpasim_resume, .get_config_size = vdpasim_get_config_size, .get_config = vdpasim_get_config, .set_config = vdpasim_set_config,