Re: [Xen-devel] [PATCH v4 12/18] xen/pvcalls: implement poll command

2017-06-21 Thread Stefano Stabellini
On Wed, 21 Jun 2017, Boris Ostrovsky wrote: > >>> + > >>> + mappass->reqcopy = *req; > >>> + icsk = inet_csk(mappass->sock->sk); > >>> + queue = &icsk->icsk_accept_queue; > >>> + spin_lock(&queue->rskq_lock); > >>> + data = queue->rskq_accept_head != NULL; > >>> + spin_unlock(&queue->rskq_lock); >

Re: [Xen-devel] [PATCH v4 12/18] xen/pvcalls: implement poll command

2017-06-21 Thread Boris Ostrovsky
>>> + >>> + mappass->reqcopy = *req; >>> + icsk = inet_csk(mappass->sock->sk); >>> + queue = &icsk->icsk_accept_queue; >>> + spin_lock(&queue->rskq_lock); >>> + data = queue->rskq_accept_head != NULL; >>> + spin_unlock(&queue->rskq_lock); >> What is the purpose of the queue lock here?

Re: [Xen-devel] [PATCH v4 12/18] xen/pvcalls: implement poll command

2017-06-21 Thread Stefano Stabellini
On Tue, 20 Jun 2017, Boris Ostrovsky wrote: > > @@ -499,6 +521,55 @@ static int pvcalls_back_accept(struct xenbus_device > > *dev, > > static int pvcalls_back_poll(struct xenbus_device *dev, > > struct xen_pvcalls_request *req) > > { > > + struct pvcalls_fedata *fedata

Re: [Xen-devel] [PATCH v4 12/18] xen/pvcalls: implement poll command

2017-06-20 Thread Boris Ostrovsky
> @@ -499,6 +521,55 @@ static int pvcalls_back_accept(struct xenbus_device *dev, > static int pvcalls_back_poll(struct xenbus_device *dev, >struct xen_pvcalls_request *req) > { > + struct pvcalls_fedata *fedata; > + struct sockpass_mapping *mappass; > + st

[Xen-devel] [PATCH v4 12/18] xen/pvcalls: implement poll command

2017-06-15 Thread Stefano Stabellini
Implement poll on passive sockets by requesting a delayed response with mappass->reqcopy, and reply back when there is data on the passive socket. Poll on active socket is unimplemented as by the spec, as the frontend should just wait for events and check the indexes on the indexes page. Only sup