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

Re: [Xen-devel] [RFC PATCH 3/6] netback: switch to NAPI + kthread model



On 16/01/12 11:09, Ian Campbell wrote:
> I think you'd want to keep moving the event pointer to
> handle wrap around, i.e. by keeping it always either far enough away or
> right behind. (I think "req_cons - 1" is probably the correct option
> BTW).

When using RING_FINAL_CHECK_FOR_REQUESTS() as-is you will get an
additional spurious event every 4 billion events.

Something like this would fix it.

#define RING_FINAL_CHECK_FOR_REQUESTS(_r, _work_to_do) do {
    (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r);
    if (_work_to_do) {
        /* ensure req_event is always in the past to avoid spurious
           interrupt on wrap-around. */
        (_r)->sring->req_event = (_r)->req_cons;
        break;
    }
    (_r)->sring->req_event = (_r)->req_cons + 1;
    mb();
    (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r);
} while (0)

And similarly for RING_FINAL_CHECK_FOR_RESPONSES().

David

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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