ia64/xen-unstable

changeset 1410:ba2029aefdd6

bitkeeper revision 1.916 (40ace8647EX7Ec0I9wi_dpD-FSQWzA)

Bug fix to network backednd, and some tracing.
author kaf24@scramble.cl.cam.ac.uk
date Thu May 20 17:18:28 2004 +0000 (2004-05-20)
parents 24e6ea32ed3c
children 7843b8fd800f 35bd92e934cb
files xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c
line diff
     1.1 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c	Wed May 19 16:49:57 2004 +0000
     1.2 +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/netif/backend/main.c	Thu May 20 17:18:28 2004 +0000
     1.3 @@ -328,14 +328,14 @@ static int __on_net_schedule_list(netif_
     1.4  
     1.5  static void remove_from_net_schedule_list(netif_t *netif)
     1.6  {
     1.7 -    spin_lock(&net_schedule_list_lock);
     1.8 +    spin_lock_irq(&net_schedule_list_lock);
     1.9      if ( likely(__on_net_schedule_list(netif)) )
    1.10      {
    1.11          list_del(&netif->list);
    1.12          netif->list.next = NULL;
    1.13          netif_put(netif);
    1.14      }
    1.15 -    spin_unlock(&net_schedule_list_lock);
    1.16 +    spin_unlock_irq(&net_schedule_list_lock);
    1.17  }
    1.18  
    1.19  static void add_to_net_schedule_list_tail(netif_t *netif)
    1.20 @@ -343,13 +343,13 @@ static void add_to_net_schedule_list_tai
    1.21      if ( __on_net_schedule_list(netif) )
    1.22          return;
    1.23  
    1.24 -    spin_lock(&net_schedule_list_lock);
    1.25 +    spin_lock_irq(&net_schedule_list_lock);
    1.26      if ( !__on_net_schedule_list(netif) && (netif->status == CONNECTED) )
    1.27      {
    1.28          list_add_tail(&netif->list, &net_schedule_list);
    1.29          netif_get(netif);
    1.30      }
    1.31 -    spin_unlock(&net_schedule_list_lock);
    1.32 +    spin_unlock_irq(&net_schedule_list_lock);
    1.33  }
    1.34  
    1.35  static inline void netif_schedule_work(netif_t *netif)
    1.36 @@ -702,6 +702,35 @@ static int make_rx_response(netif_t     
    1.37      return (i == netif->rx->event);
    1.38  }
    1.39  
    1.40 +static void netif_be_dbg(int irq, void *dev_id, struct pt_regs *regs)
    1.41 +{
    1.42 +    struct list_head *ent;
    1.43 +    netif_t *netif;
    1.44 +    int i = 0;
    1.45 +
    1.46 +    printk(KERN_ALERT "netif_schedule_list:\n");
    1.47 +    spin_lock_irq(&net_schedule_list_lock);
    1.48 +
    1.49 +    list_for_each ( ent, &net_schedule_list )
    1.50 +    {
    1.51 +        netif = list_entry(ent, netif_t, list);
    1.52 +        printk(KERN_ALERT " %d: private(rx_req_cons=%08x rx_resp_prod=%08x\n",
    1.53 +               i, netif->rx_req_cons, netif->rx_resp_prod);               
    1.54 +        printk(KERN_ALERT "   tx_req_cons=%08x tx_resp_prod=%08x)\n",
    1.55 +               netif->tx_req_cons, netif->tx_resp_prod);
    1.56 +        printk(KERN_ALERT "   shared(rx_req_prod=%08x rx_resp_prod=%08x\n",
    1.57 +               netif->rx->req_prod, netif->rx->resp_prod);
    1.58 +        printk(KERN_ALERT "   rx_event=%08x tx_req_prod=%08x\n",
    1.59 +               netif->rx->event, netif->tx->req_prod);
    1.60 +        printk(KERN_ALERT "   tx_resp_prod=%08x, tx_event=%08x)\n",
    1.61 +               netif->tx->resp_prod, netif->tx->event);
    1.62 +        i++;
    1.63 +    }
    1.64 +
    1.65 +    spin_unlock_irq(&net_schedule_list_lock);
    1.66 +    printk(KERN_ALERT " ** End of netif_schedule_list **\n");
    1.67 +}
    1.68 +
    1.69  static int __init init_module(void)
    1.70  {
    1.71      int i;
    1.72 @@ -727,6 +756,10 @@ static int __init init_module(void)
    1.73  
    1.74      netif_ctrlif_init();
    1.75  
    1.76 +    (void)request_irq(bind_virq_to_irq(VIRQ_DEBUG),
    1.77 +                      netif_be_dbg, SA_SHIRQ, 
    1.78 +                      "net-be-dbg", NULL);
    1.79 +
    1.80      return 0;
    1.81  }
    1.82