Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xen: update ring.h

Update include/xen/interface/io/ring.h to its newest version.

Switch the two improper use cases of RING_HAS_UNCONSUMED_RESPONSES() to
XEN_RING_NR_UNCONSUMED_RESPONSES() in order to avoid the nasty
XEN_RING_HAS_UNCONSUMED_IS_BOOL #define.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

+16 -7
+2 -2
drivers/net/xen-netfront.c
··· 866 866 867 867 spin_lock_irqsave(&queue->rx_cons_lock, flags); 868 868 queue->rx.rsp_cons = val; 869 - queue->rx_rsp_unconsumed = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx); 869 + queue->rx_rsp_unconsumed = XEN_RING_NR_UNCONSUMED_RESPONSES(&queue->rx); 870 870 spin_unlock_irqrestore(&queue->rx_cons_lock, flags); 871 871 } 872 872 ··· 1498 1498 return false; 1499 1499 1500 1500 spin_lock_irqsave(&queue->rx_cons_lock, flags); 1501 - work_queued = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx); 1501 + work_queued = XEN_RING_NR_UNCONSUMED_RESPONSES(&queue->rx); 1502 1502 if (work_queued > queue->rx_rsp_unconsumed) { 1503 1503 queue->rx_rsp_unconsumed = work_queued; 1504 1504 *eoi = 0;
+14 -5
include/xen/interface/io/ring.h
··· 72 72 * of the shared memory area (PAGE_SIZE, for instance). To initialise 73 73 * the front half: 74 74 * 75 - * mytag_front_ring_t front_ring; 76 - * SHARED_RING_INIT((mytag_sring_t *)shared_page); 77 - * FRONT_RING_INIT(&front_ring, (mytag_sring_t *)shared_page, PAGE_SIZE); 75 + * mytag_front_ring_t ring; 76 + * XEN_FRONT_RING_INIT(&ring, (mytag_sring_t *)shared_page, PAGE_SIZE); 78 77 * 79 78 * Initializing the back follows similarly (note that only the front 80 79 * initializes the shared ring): ··· 145 146 146 147 #define FRONT_RING_INIT(_r, _s, __size) FRONT_RING_ATTACH(_r, _s, 0, __size) 147 148 149 + #define XEN_FRONT_RING_INIT(r, s, size) do { \ 150 + SHARED_RING_INIT(s); \ 151 + FRONT_RING_INIT(r, s, size); \ 152 + } while (0) 153 + 148 154 #define BACK_RING_ATTACH(_r, _s, _i, __size) do { \ 149 155 (_r)->rsp_prod_pvt = (_i); \ 150 156 (_r)->req_cons = (_i); \ ··· 174 170 (RING_FREE_REQUESTS(_r) == 0) 175 171 176 172 /* Test if there are outstanding messages to be processed on a ring. */ 177 - #define RING_HAS_UNCONSUMED_RESPONSES(_r) \ 173 + #define XEN_RING_NR_UNCONSUMED_RESPONSES(_r) \ 178 174 ((_r)->sring->rsp_prod - (_r)->rsp_cons) 179 175 180 - #define RING_HAS_UNCONSUMED_REQUESTS(_r) ({ \ 176 + #define XEN_RING_NR_UNCONSUMED_REQUESTS(_r) ({ \ 181 177 unsigned int req = (_r)->sring->req_prod - (_r)->req_cons; \ 182 178 unsigned int rsp = RING_SIZE(_r) - \ 183 179 ((_r)->req_cons - (_r)->rsp_prod_pvt); \ 184 180 req < rsp ? req : rsp; \ 185 181 }) 182 + 183 + #define RING_HAS_UNCONSUMED_RESPONSES(_r) \ 184 + (!!XEN_RING_NR_UNCONSUMED_RESPONSES(_r)) 185 + #define RING_HAS_UNCONSUMED_REQUESTS(_r) \ 186 + (!!XEN_RING_NR_UNCONSUMED_REQUESTS(_r)) 186 187 187 188 /* Direct access to individual ring elements, by index. */ 188 189 #define RING_GET_REQUEST(_r, _idx) \