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

Re: [Xen-devel] [Problem] about src/xen/include/public/io/ring.h



On Thu, Apr 11, 2013 at 03:46:25PM +0800, éç wrote:
>  I means, in ring.h,
> The macro for unconsumed response is :
>  207#define RING_HAS_UNCONSUMED_RESPONSES(_r)
> \
>  208    ((_r)->sring->rsp_prod - (_r)->rsp_cons)
> 
> *Should the macro for unconsumed request be written like this:*
>  #define RING_HAS_UNCONSUMED_REQUESTS(_r)                               \
>      ((_r)->sring->req_prod - (_r)->req_cons)
> 

Please don't top post.

It is close to that in the code:

#define RING_HAS_UNCONSUMED_REQUESTS(_r)                                \
    ({                                                                  \
        unsigned int req = (_r)->sring->req_prod - (_r)->req_cons;      \
        unsigned int rsp = RING_SIZE(_r) -                              \
                           ((_r)->req_cons - (_r)->rsp_prod_pvt);       \
        req < rsp ? req : rsp;                                          \
    })

Can you figure out why it has the check against resp_cons and rsp_prod_pvt ?

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

 


Rackspace

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