Re: [Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-09-08 Thread Stefano Stabellini
On Mon, 14 Aug 2017, Boris Ostrovsky wrote: > On 07/31/2017 06:57 PM, Stefano Stabellini wrote: > > Introduce a waitqueue to allow only one outstanding accept command at > > any given time and to implement polling on the passive socket. Introduce > > a flags field to keep track of in-flight accept

Re: [Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-09-08 Thread Stefano Stabellini
On Mon, 14 Aug 2017, Boris Ostrovsky wrote: > > > + > > > +ret = bedata->rsp[req_id].ret; > > > > You can just return bedata->rsp[req_id].ret; > > Or maybe not. The slot may get reused by the time you get to the end. Right! > > > > -boris > > > > > +/* read ret, then set this rsp slot

Re: [Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-08-14 Thread Boris Ostrovsky
+ +ret = bedata->rsp[req_id].ret; You can just return bedata->rsp[req_id].ret; Or maybe not. The slot may get reused by the time you get to the end. -boris -boris +/* read ret, then set this rsp slot to be reused */ +smp_mb(); +WRITE_ONCE(bedata->rsp[req_id].req_id, PVC

Re: [Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-08-14 Thread Boris Ostrovsky
On 07/31/2017 06:57 PM, Stefano Stabellini wrote: Introduce a waitqueue to allow only one outstanding accept command at any given time and to implement polling on the passive socket. Introduce a flags field to keep track of in-flight accept and poll commands. Send PVCALLS_ACCEPT to the backend

[Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-07-31 Thread Stefano Stabellini
Introduce a waitqueue to allow only one outstanding accept command at any given time and to implement polling on the passive socket. Introduce a flags field to keep track of in-flight accept and poll commands. Send PVCALLS_ACCEPT to the backend. Allocate a new active socket. Make sure that only on