diff options
author | Stefano Stabellini <sstabellini@kernel.org> | 2017-10-30 23:41:01 +0100 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-10-31 14:05:53 +0100 |
commit | 5842c83596fcfa742978ec2840440ab56c7fdf79 (patch) | |
tree | d86c13c0e4f2ebcd0a305d7c89ee6412fe59a8cf /drivers/xen/pvcalls-front.h | |
parent | xen/pvcalls: implement recvmsg (diff) | |
download | linux-5842c83596fcfa742978ec2840440ab56c7fdf79.tar.xz linux-5842c83596fcfa742978ec2840440ab56c7fdf79.zip |
xen/pvcalls: implement poll command
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 waitqueue.
If no accepts are inflight, send PVCALLS_POLL to the backend. If we have
outstanding POLL requests awaiting for a response use the inflight_req
waitqueue: inflight_req is awaken when a new response is received; on
wakeup we check whether the POLL response is arrived by looking at the
PVCALLS_FLAG_POLL_RET flag. We set the flag from
pvcalls_front_event_handler, if the response was for a POLL command.
In pvcalls_front_event_handler, get the struct sock_mapping from the
poll id (we previously converted struct sock_mapping* to uintptr_t and
used it as id).
Signed-off-by: Stefano Stabellini <stefano@aporeto.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: boris.ostrovsky@oracle.com
CC: jgross@suse.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/pvcalls-front.h')
-rw-r--r-- | drivers/xen/pvcalls-front.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/xen/pvcalls-front.h b/drivers/xen/pvcalls-front.h index de24041e9a86..25e05b8f2d72 100644 --- a/drivers/xen/pvcalls-front.h +++ b/drivers/xen/pvcalls-front.h @@ -20,5 +20,8 @@ int pvcalls_front_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, int flags); +unsigned int pvcalls_front_poll(struct file *file, + struct socket *sock, + poll_table *wait); #endif |