xen/pvcalls: implement sendmsg

Send data to an active socket by copying data to the "out" ring. Take
the active socket out_mutex so that only one function can access the
ring at any given time.

If not enough room is available on the ring, rather than returning
immediately or sleep-waiting, spin for up to 5000 cycles. This small
optimization turns out to improve performance significantly.

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>
Tento commit je obsažen v:
Stefano Stabellini
2017-10-30 15:40:59 -07:00
odevzdal Boris Ostrovsky
rodič 9774c6cca2
revize 45ddce214a
2 změnil soubory, kde provedl 124 přidání a 0 odebrání

Zobrazit soubor

@@ -13,5 +13,8 @@ int pvcalls_front_listen(struct socket *sock, int backlog);
int pvcalls_front_accept(struct socket *sock,
struct socket *newsock,
int flags);
int pvcalls_front_sendmsg(struct socket *sock,
struct msghdr *msg,
size_t len);
#endif