Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-07 Thread Yongji Xie
On Wed, Jul 7, 2021 at 4:53 PM Stefan Hajnoczi wrote: > > On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > > +static bool vduse_validate_config(struct vduse_dev_config *config) > > +{ > > The name field needs to be NUL terminated? > I think so. > > + case VDUSE_CREATE_DEV: { >

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-07 Thread Stefan Hajnoczi
On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > +static bool vduse_validate_config(struct vduse_dev_config *config) > +{ The name field needs to be NUL terminated? > + case VDUSE_CREATE_DEV: { > + struct vduse_dev_config config; > + unsigned long size =

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-01 Thread Jason Wang
在 2021/7/1 下午6:26, Yongji Xie 写道: On Thu, Jul 1, 2021 at 3:55 PM Jason Wang wrote: 在 2021/7/1 下午2:50, Yongji Xie 写道: On Wed, Jun 30, 2021 at 5:51 PM Stefan Hajnoczi wrote: On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote:

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-01 Thread Yongji Xie
On Thu, Jul 1, 2021 at 3:55 PM Jason Wang wrote: > > > 在 2021/7/1 下午2:50, Yongji Xie 写道: > > On Wed, Jun 30, 2021 at 5:51 PM Stefan Hajnoczi wrote: > >> On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: > >>> On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi > >>> wrote: > On Tue,

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-01 Thread Jason Wang
在 2021/7/1 下午2:50, Yongji Xie 写道: On Wed, Jun 30, 2021 at 5:51 PM Stefan Hajnoczi wrote: On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote: On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: +/* ioctls */ + +struct

Re: Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-07-01 Thread Yongji Xie
On Wed, Jun 30, 2021 at 5:51 PM Stefan Hajnoczi wrote: > > On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: > > On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > > > > +/* ioctls */ > > > > + > > > >

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-30 Thread Stefan Hajnoczi
On Tue, Jun 29, 2021 at 10:59:51AM +0800, Yongji Xie wrote: > On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote: > > > > On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > > > +/* ioctls */ > > > + > > > +struct vduse_dev_config { > > > + char name[VDUSE_NAME_MAX]; /* vduse

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-28 Thread Jason Wang
在 2021/6/29 上午11:56, Yongji Xie 写道: On Tue, Jun 29, 2021 at 11:29 AM Jason Wang wrote: 在 2021/6/29 上午10:26, Yongji Xie 写道: On Mon, Jun 28, 2021 at 12:40 PM Jason Wang wrote: 在 2021/6/25 下午12:19, Yongji Xie 写道: 2b) for set_status(): simply relay the message to userspace, reply is no

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-28 Thread Yongji Xie
On Tue, Jun 29, 2021 at 11:29 AM Jason Wang wrote: > > > 在 2021/6/29 上午10:26, Yongji Xie 写道: > > On Mon, Jun 28, 2021 at 12:40 PM Jason Wang wrote: > >> > >> 在 2021/6/25 下午12:19, Yongji Xie 写道: > 2b) for set_status(): simply relay the message to userspace, reply is no > needed.

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-28 Thread Jason Wang
在 2021/6/29 上午10:26, Yongji Xie 写道: On Mon, Jun 28, 2021 at 12:40 PM Jason Wang wrote: 在 2021/6/25 下午12:19, Yongji Xie 写道: 2b) for set_status(): simply relay the message to userspace, reply is no needed. Userspace will use a command to update the status when the datapath is stop. The the

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-28 Thread Yongji Xie
On Mon, Jun 28, 2021 at 9:02 PM Stefan Hajnoczi wrote: > > On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > > diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h > > new file mode 100644 > > index ..f21b2e51b5c8 > > --- /dev/null > > +++

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-28 Thread Yongji Xie
On Mon, Jun 28, 2021 at 12:40 PM Jason Wang wrote: > > > 在 2021/6/25 下午12:19, Yongji Xie 写道: > >> 2b) for set_status(): simply relay the message to userspace, reply is no > >> needed. Userspace will use a command to update the status when the > >> datapath is stop. The the status could be fetched

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-28 Thread Stefan Hajnoczi
On Tue, Jun 15, 2021 at 10:13:30PM +0800, Xie Yongji wrote: > diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h > new file mode 100644 > index ..f21b2e51b5c8 > --- /dev/null > +++ b/include/uapi/linux/vduse.h > @@ -0,0 +1,143 @@ > +/* SPDX-License-Identifier: GPL-2.0

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-27 Thread Jason Wang
在 2021/6/25 下午12:19, Yongji Xie 写道: 2b) for set_status(): simply relay the message to userspace, reply is no needed. Userspace will use a command to update the status when the datapath is stop. The the status could be fetched via get_stats(). 2b looks more spec complaint. Looks good to me.

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-24 Thread Yongji Xie
On Fri, Jun 25, 2021 at 11:09 AM Jason Wang wrote: > > > 在 2021/6/24 下午5:16, Yongji Xie 写道: > > On Thu, Jun 24, 2021 at 4:14 PM Jason Wang wrote: > >> > >> 在 2021/6/24 下午12:46, Yongji Xie 写道: > So we need to deal with both FEATURES_OK and reset, but probably not > DRIVER_OK. > >

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-24 Thread Jason Wang
在 2021/6/24 下午5:16, Yongji Xie 写道: On Thu, Jun 24, 2021 at 4:14 PM Jason Wang wrote: 在 2021/6/24 下午12:46, Yongji Xie 写道: So we need to deal with both FEATURES_OK and reset, but probably not DRIVER_OK. OK, I see. Thanks for the explanation. One more question is how about clearing the

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-24 Thread Yongji Xie
On Thu, Jun 24, 2021 at 4:14 PM Jason Wang wrote: > > > 在 2021/6/24 下午12:46, Yongji Xie 写道: > >> So we need to deal with both FEATURES_OK and reset, but probably not > >> DRIVER_OK. > >> > > OK, I see. Thanks for the explanation. One more question is how about > > clearing the corresponding

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-24 Thread Jason Wang
在 2021/6/24 下午12:46, Yongji Xie 写道: So we need to deal with both FEATURES_OK and reset, but probably not DRIVER_OK. OK, I see. Thanks for the explanation. One more question is how about clearing the corresponding status bit in get_status() rather than making set_status() fail. Since the spec

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-23 Thread Yongji Xie
On Thu, Jun 24, 2021 at 11:35 AM Jason Wang wrote: > > > 在 2021/6/23 下午1:50, Yongji Xie 写道: > > On Wed, Jun 23, 2021 at 11:31 AM Jason Wang wrote: > >> > >> 在 2021/6/22 下午4:14, Yongji Xie 写道: > >>> On Tue, Jun 22, 2021 at 3:50 PM Jason Wang wrote: > 在 2021/6/22 下午3:22, Yongji Xie 写道: >

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-23 Thread Jason Wang
在 2021/6/23 下午1:50, Yongji Xie 写道: On Wed, Jun 23, 2021 at 11:31 AM Jason Wang wrote: 在 2021/6/22 下午4:14, Yongji Xie 写道: On Tue, Jun 22, 2021 at 3:50 PM Jason Wang wrote: 在 2021/6/22 下午3:22, Yongji Xie 写道: We need fix a way to propagate the error to the userspace. E.g if we want to stop

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-22 Thread Yongji Xie
On Wed, Jun 23, 2021 at 11:31 AM Jason Wang wrote: > > > 在 2021/6/22 下午4:14, Yongji Xie 写道: > > On Tue, Jun 22, 2021 at 3:50 PM Jason Wang wrote: > >> > >> 在 2021/6/22 下午3:22, Yongji Xie 写道: > We need fix a way to propagate the error to the userspace. > > E.g if we want to stop

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-22 Thread Jason Wang
在 2021/6/22 下午4:14, Yongji Xie 写道: On Tue, Jun 22, 2021 at 3:50 PM Jason Wang wrote: 在 2021/6/22 下午3:22, Yongji Xie 写道: We need fix a way to propagate the error to the userspace. E.g if we want to stop the deivce, we will delay the status reset until we get respose from the userspace? I

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-22 Thread Yongji Xie
On Tue, Jun 22, 2021 at 3:50 PM Jason Wang wrote: > > > 在 2021/6/22 下午3:22, Yongji Xie 写道: > >> We need fix a way to propagate the error to the userspace. > >> > >> E.g if we want to stop the deivce, we will delay the status reset until > >> we get respose from the userspace? > >> > > I didn't

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-22 Thread Jason Wang
在 2021/6/22 下午3:22, Yongji Xie 写道: We need fix a way to propagate the error to the userspace. E.g if we want to stop the deivce, we will delay the status reset until we get respose from the userspace? I didn't get how to delay the status reset. And should it be a DoS that we want to fix if

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-22 Thread Yongji Xie
.On Tue, Jun 22, 2021 at 1:07 PM Jason Wang wrote: > > > 在 2021/6/21 下午6:41, Yongji Xie 写道: > > On Mon, Jun 21, 2021 at 5:14 PM Jason Wang wrote: > >> > >> 在 2021/6/15 下午10:13, Xie Yongji 写道: > >>> This VDUSE driver enables implementing vDPA devices in userspace. > >>> The vDPA device's control

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-21 Thread Jason Wang
在 2021/6/21 下午6:41, Yongji Xie 写道: On Mon, Jun 21, 2021 at 5:14 PM Jason Wang wrote: 在 2021/6/15 下午10:13, Xie Yongji 写道: This VDUSE driver enables implementing vDPA devices in userspace. The vDPA device's control path is handled in kernel and the data path is handled in userspace. A

Re: Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-21 Thread Yongji Xie
On Mon, Jun 21, 2021 at 5:14 PM Jason Wang wrote: > > > 在 2021/6/15 下午10:13, Xie Yongji 写道: > > This VDUSE driver enables implementing vDPA devices in userspace. > > The vDPA device's control path is handled in kernel and the data > > path is handled in userspace. > > > > A message mechnism is

Re: [PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-21 Thread Jason Wang
在 2021/6/15 下午10:13, Xie Yongji 写道: This VDUSE driver enables implementing vDPA devices in userspace. The vDPA device's control path is handled in kernel and the data path is handled in userspace. A message mechnism is used by VDUSE driver to forward some control messages such as

[PATCH v8 09/10] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-06-15 Thread Xie Yongji
This VDUSE driver enables implementing vDPA devices in userspace. The vDPA device's control path is handled in kernel and the data path is handled in userspace. A message mechnism is used by VDUSE driver to forward some control messages such as starting/stopping datapath to userspace. Userspace