ia64/xen-unstable

changeset 10830:5848356af8da

Revert previous changeset. Needs more review.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Jul 27 14:06:15 2006 +0100 (2006-07-27)
parents b40cb6db44e4
children 2d73714911c2 f2eb2089c9eb
files linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/interface.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Thu Jul 27 13:52:02 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Thu Jul 27 14:06:15 2006 +0100
     1.3 @@ -87,7 +87,7 @@ typedef struct netif_st {
     1.4  
     1.5  	/* Miscellaneous private stuff. */
     1.6  	enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
     1.7 -
     1.8 +	int active;
     1.9  	struct list_head list;  /* scheduling list */
    1.10  	atomic_t         refcnt;
    1.11  	struct net_device *dev;
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Thu Jul 27 13:52:02 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Thu Jul 27 14:06:15 2006 +0100
     2.3 @@ -37,7 +37,9 @@
     2.4  static void __netif_up(netif_t *netif)
     2.5  {
     2.6  	struct net_device *dev = netif->dev;
     2.7 -	netif_carrier_on(dev);
     2.8 +	netif_tx_lock_bh(dev);
     2.9 +	netif->active = 1;
    2.10 +	netif_tx_unlock_bh(dev);
    2.11  	enable_irq(netif->irq);
    2.12  	netif_schedule_work(netif);
    2.13  }
    2.14 @@ -47,7 +49,7 @@ static void __netif_down(netif_t *netif)
    2.15  	struct net_device *dev = netif->dev;
    2.16  	disable_irq(netif->irq);
    2.17  	netif_tx_lock_bh(dev);
    2.18 -	netif_carrier_off(dev);
    2.19 +	netif->active = 0;
    2.20  	netif_tx_unlock_bh(dev);
    2.21  	netif_deschedule_work(netif);
    2.22  }
    2.23 @@ -91,8 +93,6 @@ netif_t *netif_alloc(domid_t domid, unsi
    2.24  		return ERR_PTR(-ENOMEM);
    2.25  	}
    2.26  
    2.27 -	netif_carrier_off(dev);
    2.28 -
    2.29  	netif = netdev_priv(dev);
    2.30  	memset(netif, 0, sizeof(*netif));
    2.31  	netif->domid  = domid;
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Jul 27 13:52:02 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Jul 27 14:06:15 2006 +0100
     3.3 @@ -143,7 +143,7 @@ int netif_be_start_xmit(struct sk_buff *
     3.4  	BUG_ON(skb->dev != dev);
     3.5  
     3.6  	/* Drop the packet if the target domain has no receive buffers. */
     3.7 -	if (unlikely(!netif_carrier_ok(dev)) ||
     3.8 +	if (!netif->active || 
     3.9  	    (netif->rx_req_cons_peek == netif->rx.sring->req_prod) ||
    3.10  	    ((netif->rx_req_cons_peek - netif->rx.rsp_prod_pvt) ==
    3.11  	     NET_RX_RING_SIZE))
    3.12 @@ -404,8 +404,7 @@ static void add_to_net_schedule_list_tai
    3.13  		return;
    3.14  
    3.15  	spin_lock_irq(&net_schedule_list_lock);
    3.16 -	if (!__on_net_schedule_list(netif) &&
    3.17 -	    likely(netif_carrier_ok(netif->dev))) {
    3.18 +	if (!__on_net_schedule_list(netif) && netif->active) {
    3.19  		list_add_tail(&netif->list, &net_schedule_list);
    3.20  		netif_get(netif);
    3.21  	}