]> xenbits.xensource.com Git - people/aperard/xtf.git/commitdiff
xenbus: Don't wait if the response ring is full
authorJulien Grall <jgrall@amazon.com>
Thu, 9 Jul 2020 18:46:47 +0000 (19:46 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 10 Jul 2020 10:54:36 +0000 (11:54 +0100)
XenStore response can be bigger than the response ring. In this case,
it is possible to have the ring full (e.g cons = 19 and prod = 1043).

However, XTF will consider that there is no data and therefore wait for
more input. This will result to block indefinitely as the ring is full.

This can be solved by avoiding to mask the difference between prod and
cons.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
common/xenbus.c

index 24fff48723728fafb1cca26860727b3a748ea455..f3bb30ac693f43a9261e046c065995ec3c5fa7ec 100644 (file)
@@ -75,7 +75,7 @@ static void xenbus_read(void *data, size_t len)
         uint32_t prod = ACCESS_ONCE(xb_ring->rsp_prod);
         uint32_t cons = ACCESS_ONCE(xb_ring->rsp_cons);
 
-        part = mask_xenbus_idx(prod - cons);
+        part = prod - cons;
 
         /* No data?  Kick xenstored and wait for it to produce some data. */
         if ( !part )