direct-io.hg

changeset 13611:e19f9d6a2ff5

netfront: Better fix for netfront_tx_slot_available().
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Jan 25 16:58:21 2007 +0000 (2007-01-25)
parents fec1a6975588
children 9e4f61bb200e
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Jan 25 16:32:19 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Jan 25 16:58:21 2007 +0000
     1.3 @@ -613,11 +613,8 @@ static int network_open(struct net_devic
     1.4  
     1.5  static inline int netfront_tx_slot_available(struct netfront_info *np)
     1.6  {
     1.7 -	/* XXX Need to check we have enough grants for worst-case fragments. */
     1.8 -	if (gnttab_empty_grant_references(&np->gref_tx_head))
     1.9 -		return 0;
    1.10 -
    1.11 -	return RING_FREE_REQUESTS(&np->tx) >= MAX_SKB_FRAGS + 2;
    1.12 +	return ((np->tx.req_prod_pvt - np->tx.rsp_cons) <
    1.13 +		(TX_MAX_TARGET - MAX_SKB_FRAGS - 2));
    1.14  }
    1.15  
    1.16  static inline void network_maybe_wake_tx(struct net_device *dev)