[dpdk-dev] [RFC PATCH 7/7] lib/librte_vhost: Add vhost-user implementation

Tetsuya Mukawa mukawa at igel.co.jp
Fri Nov 14 05:41:27 CET 2014


(2014/11/14 9:07), Xie, Huawei wrote:
>> +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 more clear.
Thanks, let's change implementation simpler as much as possible.
>
> 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 DPDK cuse driver. It requires maintenance effort
> and extra kernel module;
>      Btw, your framework to allow dynamically register different vhost driver is nice!
I assume some customers still need to use QEMU under 2.0.
But it's okay for me to remove vhost-cuse implementation.
What is you and intel plan?

>   * If two drivers are simultaneously accessing the device list, we could add lock.
Also we may need to remove some global variables that cannot be shared
between drivers.
To remove global variable, we may be possible to save these variable in ctx.

Thanks,
Tetsuya



More information about the dev mailing list