ia64/xen-unstable

changeset 245:ce6eb0deb0c7

bitkeeper revision 1.103 (3e5ce3edCqQ1qazfrrTapwLSJfBo_Q)

network.c, dev.c:
A few more network cleanups.
author kaf24@labyrinth.cl.cam.ac.uk
date Wed Feb 26 15:57:33 2003 +0000 (2003-02-26)
parents 0f0113d4cd89
children 0feeef527323 9e4c6336ab3b
files xen/net/dev.c xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c
line diff
     1.1 --- a/xen/net/dev.c	Wed Feb 26 14:23:24 2003 +0000
     1.2 +++ b/xen/net/dev.c	Wed Feb 26 15:57:33 2003 +0000
     1.3 @@ -38,7 +38,7 @@
     1.4  #define rtnl_lock() ((void)0)
     1.5  #define rtnl_unlock() ((void)0)
     1.6  
     1.7 -#if 1
     1.8 +#if 0
     1.9  #define DPRINTK(_f, _a...) printk(_f , ## _a)
    1.10  #else 
    1.11  #define DPRINTK(_f, _a...) ((void)0)
    1.12 @@ -742,8 +742,8 @@ static void net_tx_action(unsigned long 
    1.13  
    1.14          if ( (skb = alloc_skb_nodata(GFP_ATOMIC)) == NULL )
    1.15          {
    1.16 -            add_to_net_schedule_list_tail(vif);
    1.17              printk("Out of memory in net_tx_action()!\n");
    1.18 +            tx->status = RING_STATUS_BAD_PAGE;
    1.19              break;
    1.20          }
    1.21          
    1.22 @@ -769,8 +769,8 @@ static void net_tx_action(unsigned long 
    1.23          /* Transmit should always work, or the queue would be stopped. */
    1.24          if ( dev->hard_start_xmit(skb, dev) != 0 )
    1.25          {
    1.26 -            add_to_net_schedule_list_tail(vif);
    1.27              printk("Weird failure in hard_start_xmit!\n");
    1.28 +            kfree_skb(skb);
    1.29              break;
    1.30          }
    1.31      }
     2.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c	Wed Feb 26 14:23:24 2003 +0000
     2.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/network/network.c	Wed Feb 26 15:57:33 2003 +0000
     2.3 @@ -220,7 +220,7 @@ static void network_free_rx_buffers(stru
     2.4      for ( i = np->rx_idx; i != np->net_ring->rx_prod; i = RX_RING_INC(i) )
     2.5      {
     2.6          skb = np->rx_skb_ring[i];
     2.7 -        dev_kfree_skb(skb);
     2.8 +        dev_kfree_skb_any(skb);
     2.9      }
    2.10  }
    2.11  
    2.12 @@ -228,10 +228,10 @@ static int network_start_xmit(struct sk_
    2.13  {
    2.14      unsigned int i;
    2.15      struct net_private *np = (struct net_private *)dev->priv;
    2.16 -    
    2.17 +
    2.18      if ( np->tx_full )
    2.19      {
    2.20 -        printk(KERN_WARNING "%s: full queue wasn't stopped!\n", dev->name);
    2.21 +        printk(KERN_ALERT "%s: full queue wasn't stopped!\n", dev->name);
    2.22          netif_stop_queue(dev);
    2.23          return -ENOBUFS;
    2.24      }
    2.25 @@ -239,10 +239,11 @@ static int network_start_xmit(struct sk_
    2.26  
    2.27      if ( (((unsigned long)skb->data & ~PAGE_MASK) + skb->len) >= PAGE_SIZE )
    2.28      {
    2.29 -        struct sk_buff *new_skb = alloc_skb(RX_BUF_SIZE, GFP_KERNEL);
    2.30 +        struct sk_buff *new_skb = dev_alloc_skb(RX_BUF_SIZE);
    2.31 +        if ( new_skb == NULL ) return 1;
    2.32          skb_put(new_skb, skb->len);
    2.33          memcpy(new_skb->data, skb->data, skb->len);
    2.34 -        kfree_skb(skb);
    2.35 +        dev_kfree_skb(skb);
    2.36          skb = new_skb;
    2.37      }   
    2.38