Re: [Xen-devel] [PATCH v4 09/13] xen/pvcalls: implement sendmsg

2017-10-06 Thread Stefano Stabellini
On Fri, 22 Sep 2017, Boris Ostrovsky wrote: > > +static bool pvcalls_front_write_todo(struct sock_mapping *map) > > +{ > > + struct pvcalls_data_intf *intf = map->active.ring; > > + RING_IDX cons, prod, size = XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER); > > + int32_t error; > > + > > + cons = i

Re: [Xen-devel] [PATCH v4 09/13] xen/pvcalls: implement sendmsg

2017-09-22 Thread Boris Ostrovsky
> +static bool pvcalls_front_write_todo(struct sock_mapping *map) > +{ > + struct pvcalls_data_intf *intf = map->active.ring; > + RING_IDX cons, prod, size = XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER); > + int32_t error; > + > + cons = intf->out_cons; > + prod = intf->out_prod; > +

[Xen-devel] [PATCH v4 09/13] xen/pvcalls: implement sendmsg

2017-09-15 Thread Stefano Stabellini
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