[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-3.0-testing] [NET] back: fix synchronisation of access to deallocation buffer ring.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID e1a85211281f7f2097a3d400b0b3db90e5da2ff6 # Parent e8a45450a48dd588b8c0ba06a85dd3f5f5157f8e [NET] back: fix synchronisation of access to deallocation buffer ring. Must ensure ring is written to before producer index is incremented. Bug diagnosed by Ky Srinivasan <ksrinivasan@xxxxxxxxxx> Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> xen-unstable changeset: 10268:9f50b8c2de0ad641d7795613edc35d78240dab8c xen-unstable date: Mon Jun 5 15:14:58 2006 +0100 --- linux-2.6-xen-sparse/drivers/xen/netback/netback.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) diff -r e8a45450a48d -r e1a85211281f linux-2.6-xen-sparse/drivers/xen/netback/netback.c --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Mon Jun 05 10:44:07 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Mon Jun 05 15:15:45 2006 +0100 @@ -452,6 +452,9 @@ inline static void net_tx_action_dealloc dc = dealloc_cons; dp = dealloc_prod; + /* Ensure we see all indexes enqueued by netif_idx_release(). */ + smp_rmb(); + /* * Free up any grants we have finished using */ @@ -689,7 +692,10 @@ static void netif_idx_release(u16 pendin unsigned long flags; spin_lock_irqsave(&_lock, flags); - dealloc_ring[MASK_PEND_IDX(dealloc_prod++)] = pending_idx; + dealloc_ring[MASK_PEND_IDX(dealloc_prod)] = pending_idx; + /* Sync with net_tx_action_dealloc: insert idx /then/ incr producer. */ + smp_wmb(); + dealloc_prod++; spin_unlock_irqrestore(&_lock, flags); tasklet_schedule(&net_tx_tasklet); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |