Message ID | 20230609092127.170673-3-eperezma@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp830114vqr; Fri, 9 Jun 2023 02:59:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E/MHhG9bcafBzWNDCK3omOqjRJb4/0fC7CajdC56cJtB0MxtCYIxcjlQILsd7Bs8pJNnB X-Received: by 2002:a05:6358:c02f:b0:129:c6d0:20ac with SMTP id ez47-20020a056358c02f00b00129c6d020acmr706685rwb.31.1686304741544; Fri, 09 Jun 2023 02:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686304741; cv=none; d=google.com; s=arc-20160816; b=Av3TSCXF7D5jOKs8GRDx8vk1lYzder5k9oMEoIP0GL9od1TBjmjhkewmN7Bqu/4h+J yHrrEmk9bRIEoTgjb1zNdyo3oKZPiLH7Ko8hdun0ymre97XOC1ULR3Y7V+vw56q2MU9j 2ww8AEczeLSK5ZvkOFYNi/QaIsnVDtKjAhVH35ZfzeyN62gxLLRqTES/hqaQULzgWUwQ HghhlmFGcxEu5OKsV5OAGsCDkvlMPGL3aZVvgCCZSMQq16rYWnVqMaMBTZMlvsLQaJzP Ax3eYRUokNaTEL1uwtJ6w6qKM+uOd4mRxTTFddjKArZZUt/qFBYZtOFSJAyAUIKpXHJE TifQ== 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=BSYu94PSBBeau34XT4dGzInntObCc6c7/xjwJmmjNHA=; b=LizBdkEWnGh4VsEwo5cgszbTOQS2F9b+4S1HI+94jtA6wS4tkTC+1fN/8bOqZQAizl JHzlabjGPkacJJfUGCk0JlHbvu81IWltA9xR9swpqYVS5/nk9hQ6L4L+03fBW7mOR0iU tI5xFQ4uMU7hpcu+oUVe0L2lK6IGC88LVygUIQUA1CLxbFcvwpZ2H4nstwWWSLyDxiCy kiAlhJrhREnwPHSl5Tn9aIiksjMxMLYpQSmwbkNsl8MKSZBFYrm9jVHBPL6W5yKBklyT mu0gL1Q9g7pQ4ZXrz1dDO4S4EuLA8NU2Qd3iOe26noT17MUq2Ybsm4s3zBcVIqwPaKlK KK8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HQJlwRNS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r21-20020a632b15000000b0051b32aa267asi2348619pgr.671.2023.06.09.02.58.48; Fri, 09 Jun 2023 02:59:01 -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=HQJlwRNS; 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 S241131AbjFIJbi (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 05:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241474AbjFIJbQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 05:31:16 -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 ESMTPS id 3F0376EAE for <linux-kernel@vger.kernel.org>; Fri, 9 Jun 2023 02:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686302700; 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=BSYu94PSBBeau34XT4dGzInntObCc6c7/xjwJmmjNHA=; b=HQJlwRNSDdOttwjngS6GaFluxSjDRTLzruecnjXuDkI7NQ7ZXgP83FNk7WT2sgKJRtQLhJ iKsDY2kyxYdI6N1qc/p9tdcrnT/sgTasBG6ez6SpPN9nrjIeW/kLpWwLxWjNlkdT4XnELh vwFV2s1B4jFmyJMeF6sHuRDjk6Krvtg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-xyILRbHZOBWmGloccysoMQ-1; Fri, 09 Jun 2023 05:21:40 -0400 X-MC-Unique: xyILRbHZOBWmGloccysoMQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B03985A5A8; Fri, 9 Jun 2023 09:21:39 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86DD420268C6; Fri, 9 Jun 2023 09:21:36 +0000 (UTC) From: =?utf-8?q?Eugenio_P=C3=A9rez?= <eperezma@redhat.com> To: mst@redhat.com, Jason Wang <jasowang@redhat.com> Cc: Zhu Lingshan <lingshan.zhu@intel.com>, virtualization@lists.linux-foundation.org, "Gonglei (Arei)" <arei.gonglei@huawei.com>, longpeng2@huawei.com, Lei Yang <leiyang@redhat.com>, Parav Pandit <parav@mellanox.com>, Gautam Dawar <gdawar@xilinx.com>, Dragos Tatulea <dtatulea@nvidia.com>, Laurent Vivier <lvivier@redhat.com>, linux-api@vger.kernel.org, Liuxiangdong <liuxiangdong5@huawei.com>, linux-kernel@vger.kernel.org, alvaro.karsz@solid-run.com, Shannon Nelson <snelson@pensando.io>, Stefano Garzarella <sgarzare@redhat.com>, Cindy Lu <lulu@redhat.com>, si-wei.liu@oracle.com, Harpreet Singh Anand <hanand@xilinx.com> Subject: [PATCH v2 2/4] vdpa: accept VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK backend feature Date: Fri, 9 Jun 2023 11:21:25 +0200 Message-Id: <20230609092127.170673-3-eperezma@redhat.com> In-Reply-To: <20230609092127.170673-1-eperezma@redhat.com> References: <20230609092127.170673-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 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: <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?1768218680734076196?= X-GMAIL-MSGID: =?utf-8?q?1768218680734076196?= |
Series |
Add VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK flag to vdpa backend
|
|
Commit Message
Eugenio Perez Martin
June 9, 2023, 9:21 a.m. UTC
Accepting VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK backend feature if userland sets it. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Shannon Nelson <shannon.nelson@amd.com> --- drivers/vhost/vdpa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Fri, Jun 09, 2023 at 11:21:25AM +0200, Eugenio Pérez wrote: > Accepting VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK backend feature if > userland sets it. > > Signed-off-by: Eugenio Pérez <eperezma@redhat.com> > Acked-by: Shannon Nelson <shannon.nelson@amd.com> I don't get it, so all vdpa devices accept this automatically? Should this not be up to the parent? > --- > drivers/vhost/vdpa.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index bf77924d5b60..a3204406b73d 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -680,7 +680,8 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep, > return -EFAULT; > if (features & ~(VHOST_VDPA_BACKEND_FEATURES | > BIT_ULL(VHOST_BACKEND_F_SUSPEND) | > - BIT_ULL(VHOST_BACKEND_F_RESUME))) > + BIT_ULL(VHOST_BACKEND_F_RESUME) | > + BIT_ULL(VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK))) > return -EOPNOTSUPP; > if ((features & BIT_ULL(VHOST_BACKEND_F_SUSPEND)) && > !vhost_vdpa_can_suspend(v)) > -- > 2.31.1
On Fri, Jun 9, 2023 at 6:13 PM Michael S. Tsirkin <mst@redhat.com> wrote: > > On Fri, Jun 09, 2023 at 11:21:25AM +0200, Eugenio Pérez wrote: > > Accepting VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK backend feature if > > userland sets it. > > > > Signed-off-by: Eugenio Pérez <eperezma@redhat.com> > > Acked-by: Shannon Nelson <shannon.nelson@amd.com> > > I don't get it, so all vdpa devices accept this automatically? > Should this not be up to the parent? > At the moment I don't see a reason why if a parent offers this feature, it could reject it afterwards. However I think we can add a fail if userland acks the backend feature but the parent does not offer it however. Would it work to add such fail in vdpa frontend and move it to the backend if and when any parent driver needs it in the future? Thanks! > > --- > > drivers/vhost/vdpa.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > > index bf77924d5b60..a3204406b73d 100644 > > --- a/drivers/vhost/vdpa.c > > +++ b/drivers/vhost/vdpa.c > > @@ -680,7 +680,8 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep, > > return -EFAULT; > > if (features & ~(VHOST_VDPA_BACKEND_FEATURES | > > BIT_ULL(VHOST_BACKEND_F_SUSPEND) | > > - BIT_ULL(VHOST_BACKEND_F_RESUME))) > > + BIT_ULL(VHOST_BACKEND_F_RESUME) | > > + BIT_ULL(VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK))) > > return -EOPNOTSUPP; > > if ((features & BIT_ULL(VHOST_BACKEND_F_SUSPEND)) && > > !vhost_vdpa_can_suspend(v)) > > -- > > 2.31.1 >
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index bf77924d5b60..a3204406b73d 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -680,7 +680,8 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep, return -EFAULT; if (features & ~(VHOST_VDPA_BACKEND_FEATURES | BIT_ULL(VHOST_BACKEND_F_SUSPEND) | - BIT_ULL(VHOST_BACKEND_F_RESUME))) + BIT_ULL(VHOST_BACKEND_F_RESUME) | + BIT_ULL(VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK))) return -EOPNOTSUPP; if ((features & BIT_ULL(VHOST_BACKEND_F_SUSPEND)) && !vhost_vdpa_can_suspend(v))