ia64/xen-unstable

changeset 1023:954ecd91a328

bitkeeper revision 1.663 (3ff58ac4D8RzCiwFJ0MJJhOM1a2XgA)

dev.c:
Small cleanups and fixes to Xen networking.
author kaf24@scramble.cl.cam.ac.uk
date Fri Jan 02 15:14:12 2004 +0000 (2004-01-02)
parents 18dbe6d9d3dc
children 8d970a3b60cc
files xen/net/dev.c
line diff
     1.1 --- a/xen/net/dev.c	Wed Dec 31 18:59:39 2003 +0000
     1.2 +++ b/xen/net/dev.c	Fri Jan 02 15:14:12 2004 +0000
     1.3 @@ -592,6 +592,7 @@ int netif_rx(struct sk_buff *skb)
     1.4  
     1.5      skb->next = skb_queue[cpu].rx;
     1.6      skb_queue[cpu].rx = skb;
     1.7 +    skb_queue[cpu].rx_qlen++;
     1.8  
     1.9      local_irq_restore(flags);
    1.10  
    1.11 @@ -680,26 +681,26 @@ static int __on_net_schedule_list(net_vi
    1.12  
    1.13  static void remove_from_net_schedule_list(net_vif_t *vif)
    1.14  {
    1.15 -    unsigned long flags;
    1.16 -    spin_lock_irqsave(&net_schedule_list_lock, flags);
    1.17 +    spin_lock(&net_schedule_list_lock);
    1.18      ASSERT(__on_net_schedule_list(vif));
    1.19      list_del(&vif->list);
    1.20      vif->list.next = NULL;
    1.21      put_vif(vif);
    1.22 -    spin_unlock_irqrestore(&net_schedule_list_lock, flags);
    1.23 +    spin_unlock(&net_schedule_list_lock);
    1.24  }
    1.25  
    1.26  static void add_to_net_schedule_list_tail(net_vif_t *vif)
    1.27  {
    1.28 -    unsigned long flags;
    1.29 -    if ( __on_net_schedule_list(vif) ) return;
    1.30 -    spin_lock_irqsave(&net_schedule_list_lock, flags);
    1.31 -    if ( !__on_net_schedule_list(vif) )
    1.32 +    if ( __on_net_schedule_list(vif) )
    1.33 +        return;
    1.34 +
    1.35 +    spin_lock(&net_schedule_list_lock);
    1.36 +    if ( likely(!__on_net_schedule_list(vif)) )
    1.37      {
    1.38          list_add_tail(&vif->list, &net_schedule_list);
    1.39          get_vif(vif);
    1.40      }
    1.41 -    spin_unlock_irqrestore(&net_schedule_list_lock, flags);
    1.42 +    spin_unlock(&net_schedule_list_lock);
    1.43  }
    1.44  
    1.45