From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 151FB682E for ; Fri, 14 Nov 2014 00:59:14 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 13 Nov 2014 16:09:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,381,1413270000"; d="scan'208";a="622103127" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2014 16:07:06 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 14 Nov 2014 08:07:05 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.86]) with mapi id 14.03.0195.001; Fri, 14 Nov 2014 08:07:03 +0800 From: "Xie, Huawei" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC PATCH 7/7] lib/librte_vhost: Add vhost-user implementation Thread-Index: AQHP+bM0EY35oOvLwky/6ev38FZEmJxfQ2sw Date: Fri, 14 Nov 2014 00:07:02 +0000 Message-ID: References: <1415272471-3299-1-git-send-email-mukawa@igel.co.jp> <1415272471-3299-8-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1415272471-3299-8-git-send-email-mukawa@igel.co.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "nakajima.yoshihiro@lab.ntt.co.jp" , "masutani.hitoshi@lab.ntt.co.jp" Subject: Re: [dpdk-dev] [RFC PATCH 7/7] lib/librte_vhost: Add vhost-user implementation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2014 23:59:15 -0000 > +struct vhost_device_user_ctx { > + int *fds; > + int fd_num; > + struct vhost_driver *drv; > +}; > + > /* > * Structure used to identify device context. > */ > @@ -83,6 +89,7 @@ struct vhost_device_ctx { > vhost_driver_type_t type; /* driver type. */ > uint64_t fh; /* Populated with fi->fh to track the > device index. */ > union { > + struct vhost_device_user_ctx user; > struct vhost_device_cuse_ctx cdev; > }; > }; Tetsuya: It is ok we define the enum ctx, but so far I don't see absolute necessity = to have user ctx. Will send out RFC patch of my implementation today or next day to make it m= ore clear. I don't understand why we keep two device lists. * in real case, will we allow to register two drivers? Besides, we have the open question whether we still need to keep the D= PDK cuse driver. It requires maintenance effort and extra kernel module; Btw, your framework to allow dynamically register different vhost driv= er is nice! * If two drivers are simultaneously accessing the device list, we could a= dd lock. =20 > +user_get_device(struct vhost_device_ctx ctx) > +user_add_config_ll_entry(struct virtio_net_config_ll *new_ll_dev) > +user_rm_config_ll_entry(struct virtio_net_config_ll *ll_dev, struct > +user_get_config_ll_root(void) > +user_init_device(struct vhost_device_ctx ctx, struct virtio_net *dev)