ia64/xen-unstable

changeset 672:48a3323d8b93

bitkeeper revision 1.387 (3f283841sxL_1BFf_Dks40SWU9PRqg)

dev.c:
Fix possible subtle race in new network tx code.
author kaf24@scramble.cl.cam.ac.uk
date Wed Jul 30 21:27:29 2003 +0000 (2003-07-30)
parents 15a6d4d70e86
children 3b0deaef4953
files xen/net/dev.c
line diff
     1.1 --- a/xen/net/dev.c	Wed Jul 30 20:38:09 2003 +0000
     1.2 +++ b/xen/net/dev.c	Wed Jul 30 21:27:29 2003 +0000
     1.3 @@ -836,6 +836,12 @@ static void tx_skb_release(struct sk_buf
     1.4      __make_tx_response(vif, skb->guest_id, RING_STATUS_OK);
     1.5      spin_unlock_irqrestore(&vif->tx_lock, flags);
     1.6  
     1.7 +    /*
     1.8 +     * Checks below must happen after the above response is posted.
     1.9 +     * This avoids a possible race with a guest OS on another CPU.
    1.10 +     */
    1.11 +    smp_rmb();
    1.12 +
    1.13      if ( (vif->tx_cons == vif->tx_prod) && get_tx_bufs(vif) )
    1.14      {
    1.15          add_to_net_schedule_list_tail(vif);