[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4F140DFB.60009@citrix.com>
Date: Mon, 16 Jan 2012 11:46:03 +0000
From: David Vrabel <david.vrabel@...rix.com>
To: Ian Campbell <Ian.Campbell@...rix.com>
CC: Paul Durrant <Paul.Durrant@...rix.com>,
"Wei Liu (Intern)" <wei.liu2@...rix.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>
Subject: 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists