From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9477C433F5 for ; Tue, 29 Mar 2022 05:17:20 +0000 (UTC) Received: from localhost ([::1]:58400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZ4EJ-0002bZ-EG for qemu-devel@archiver.kernel.org; Tue, 29 Mar 2022 01:17:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ4D1-0001rD-4i for qemu-devel@nongnu.org; Tue, 29 Mar 2022 01:15:59 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ4Cw-0002cC-Ut for qemu-devel@nongnu.org; Tue, 29 Mar 2022 01:15:57 -0400 Received: from dggpeml500020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KSHlg6yy1zCr8P; Tue, 29 Mar 2022 13:13:35 +0800 (CST) Received: from dggpeml100025.china.huawei.com (7.185.36.37) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 29 Mar 2022 13:15:48 +0800 Received: from dggpeml100016.china.huawei.com (7.185.36.216) by dggpeml100025.china.huawei.com (7.185.36.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 29 Mar 2022 13:15:47 +0800 Received: from dggpeml100016.china.huawei.com ([7.185.36.216]) by dggpeml100016.china.huawei.com ([7.185.36.216]) with mapi id 15.01.2308.021; Tue, 29 Mar 2022 13:15:47 +0800 To: Stefano Garzarella CC: Stefan Hajnoczi , Michael Tsirkin , Cornelia Huck , Paolo Bonzini , "Gonglei (Arei)" , Yechuan , Huangzhichao , qemu devel list Subject: RE: [PATCH v3 05/10] vdpa-dev: implement the realize interface Thread-Topic: [PATCH v3 05/10] vdpa-dev: implement the realize interface Thread-Index: AQHYO2HKNbgiltRNH0mkEivgf5l+b6zUbBWAgAFxh3A= Date: Tue, 29 Mar 2022 05:15:47 +0000 Message-ID: <2fd4698cd9a54e1a928e9e6aa18c1965@huawei.com> References: <20220319072012.525-1-longpeng2@huawei.com> <20220319072012.525-6-longpeng2@huawei.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.148.223] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.188; envelope-from=longpeng2@huawei.com; helo=szxga02-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" From: longpeng2--- via > -----Original Message----- > From: Stefano Garzarella [mailto:sgarzare@redhat.com] > Sent: Monday, March 28, 2022 11:00 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: Stefan Hajnoczi ; Michael Tsirkin ; > Cornelia Huck ; Paolo Bonzini ; > Gonglei (Arei) ; Yechuan ; > Huangzhichao ; qemu devel list > Subject: Re: [PATCH v3 05/10] vdpa-dev: implement the realize interface >=20 > On Sat, Mar 19, 2022 at 03:20:07PM +0800, Longpeng(Mike) wrote: > >From: Longpeng > > [snap] > > static void vhost_vdpa_device_unrealize(DeviceState *dev) > >@@ -66,6 +197,7 @@ static void vhost_vdpa_device_set_status(VirtIODevice= *vdev, > uint8_t status) > > static Property vhost_vdpa_device_properties[] =3D { > > DEFINE_PROP_STRING("vdpa-dev", VhostVdpaDevice, vdpa_dev), > > DEFINE_PROP_INT32("vdpa-dev-fd", VhostVdpaDevice, vdpa_dev_fd, -1), >=20 > Other vhost devices use the `vhostfd` property, maybe we should use the > same name. >=20 > If we go for this change, then maybe we also need to change `vdpa-dev` > to `vhostpath` or something like that >=20 Make sense. I prefer to use 'vhostdev' for the file path, just like the usage in Netdev= : -netdev type=3Dvhost-vdpa,vhostdev=3D/dev/vhost-vdpa-0,id=3Dvhostvdpa1 > Thanks, > Stefano >=20 > >+ DEFINE_PROP_UINT16("queue-size", VhostVdpaDevice, queue_size, 0), > > DEFINE_PROP_END_OF_LIST(), > > }; > > > >diff --git a/include/hw/virtio/vdpa-dev.h b/include/hw/virtio/vdpa-dev.h > >index 476bda0873..cf11abd0f7 100644 > >--- a/include/hw/virtio/vdpa-dev.h > >+++ b/include/hw/virtio/vdpa-dev.h > >@@ -28,6 +28,16 @@ struct VhostVdpaDevice { > > char *vdpa_dev; > > int vdpa_dev_fd; > > int32_t bootindex; > >+ uint32_t vdev_id; > >+ uint32_t num_queues; > >+ struct vhost_dev dev; > >+ struct vhost_vdpa vdpa; > >+ VirtQueue **virtqs; > >+ uint8_t *config; > >+ int config_size; > >+ uint16_t queue_size; > >+ bool started; > >+ int (*post_init)(VhostVdpaDevice *v, Error **errp); > > }; > > > > #endif > >-- > >2.23.0 > >