• Stefano Stabellini's avatar
    xen/pvcalls: implement poll command · 5842c835
    Stefano Stabellini authored
    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: default avatarStefano Stabellini <stefano@aporeto.com>
    Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
    CC: boris.ostrovsky@oracle.com
    CC: jgross@suse.com
    Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
    5842c835
pvcalls-front.c 28.9 KB