Must ensure ring is written to before producer index is incremented.
Bug diagnosed by Ky Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 10268:
9f50b8c2de0ad641d7795613edc35d78240dab8c
xen-unstable date: Mon Jun 5 15:14:58 2006 +0100
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
*/
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);