ia64/xen-unstable

changeset 13617:42aaf08dd20e

netfront: Check availability of grant references in start_xmit().
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Thu Jan 25 12:24:43 2007 +0000 (2007-01-25)
parents ee1febe317f7
children d6d27c649fd6
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 11:58:00 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Jan 25 12:24:43 2007 +0000
     1.3 @@ -613,6 +613,10 @@ 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  }
    1.13