Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-09-12 Thread Stefano Stabellini
On Tue, 12 Sep 2017, Stefano Stabellini wrote: > On Tue, 12 Sep 2017, Boris Ostrovsky wrote: > > On 09/12/2017 06:17 PM, Stefano Stabellini wrote: > > > On Tue, 12 Sep 2017, Boris Ostrovsky wrote: > > > + > > > +unsigned int pvcalls_front_poll(struct file *file, struct socket > > >

Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-09-12 Thread Stefano Stabellini
On Tue, 12 Sep 2017, Boris Ostrovsky wrote: > On 09/12/2017 06:17 PM, Stefano Stabellini wrote: > > On Tue, 12 Sep 2017, Boris Ostrovsky wrote: > > + > > +unsigned int pvcalls_front_poll(struct file *file, struct socket *sock, > > + poll_table *wait) >

Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-09-12 Thread Boris Ostrovsky
On 09/12/2017 06:17 PM, Stefano Stabellini wrote: > On Tue, 12 Sep 2017, Boris Ostrovsky wrote: > + > +unsigned int pvcalls_front_poll(struct file *file, struct socket *sock, > +poll_table *wait) > +{ > + struct pvcalls_bedata *bedata; > + struct

Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-09-12 Thread Stefano Stabellini
On Tue, 12 Sep 2017, Boris Ostrovsky wrote: > >>> + > >>> +unsigned int pvcalls_front_poll(struct file *file, struct socket *sock, > >>> +poll_table *wait) > >>> +{ > >>> + struct pvcalls_bedata *bedata; > >>> + struct sock_mapping *map; > >>> + > >>> + if

Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-09-12 Thread Boris Ostrovsky
>>> + >>> +unsigned int pvcalls_front_poll(struct file *file, struct socket *sock, >>> + poll_table *wait) >>> +{ >>> + struct pvcalls_bedata *bedata; >>> + struct sock_mapping *map; >>> + >>> + if (!pvcalls_front_dev) >>> + return POLLNVAL; >>> + bedata

Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-09-08 Thread Stefano Stabellini
On Tue, 15 Aug 2017, Boris Ostrovsky wrote: > > @@ -736,6 +755,104 @@ int pvcalls_front_accept(struct socket *sock, struct > > socket *newsock, int flags) > > return ret; > > } > > > > +static unsigned int pvcalls_front_poll_passive(struct file *file, > > +

Re: [Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-08-15 Thread Boris Ostrovsky
On 07/31/2017 06:57 PM, Stefano Stabellini wrote: > For active sockets, check the indexes and use the inflight_conn_req > waitqueue to wait. > > For passive sockets if an accept is outstanding > (PVCALLS_FLAG_ACCEPT_INFLIGHT), check if it has been answered by looking > at bedata->rsp[req_id]. If

[Xen-devel] [PATCH v3 11/13] xen/pvcalls: implement poll command

2017-07-31 Thread Stefano Stabellini
For active sockets, check the indexes and use the inflight_conn_req waitqueue to wait. For passive sockets if an accept is outstanding (PVCALLS_FLAG_ACCEPT_INFLIGHT), check if it has been answered by looking at bedata->rsp[req_id]. If so, return POLLIN. Otherwise use the inflight_accept_req