[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] XenBus: Don't wait for producer to fill the ring if the ring



>>> On 17.05.17 at 16:57, <anshul.makkar@xxxxxxxxxx> wrote:
> The condition to check for if there is space in the ring buffer
>     also becomes true if the buffer is full, thus consumer waits for
>     the producer to fill the buffer eventhough it is already full.
> 
>     To resolve the situation, check if the buffer is full and then
>     break from the loop.
>     e.g case: prod = 1272, cons = 248.
> 
>     Signed-off-by: Anshul Makkar <anshul.makkar@xxxxxxxxxx>

Please avoid indenting the entire commit message.

> --- a/tools/firmware/hvmloader/xenbus.c
> +++ b/tools/firmware/hvmloader/xenbus.c
> @@ -141,7 +141,18 @@ static void ring_read(char *data, uint32_t len)
>          /* Don't overrun the producer pointer */
>          while ( (part = MASK_XENSTORE_IDX(rings->rsp_prod -
>                                            rings->rsp_cons)) == 0 )
> +        {
> +            /* don't wait for producer to fill the ring if it is already 
> full.
> +             * Condition happens when you write string > 1K into the ring.
> +             * eg case prod=1272 cons=248.
> +             */

Comment style.

> +            if ( !(XENSTORE_RING_SIZE - (rings->rsp_prod - rings->rsp_cons)) 
> )

Is this any different from

           if ( rings->rsp_prod - rings->rsp_cons == XENSTORE_RING_SIZE  )

?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.