From: kfraser@localhost.localdomain Date: Thu, 25 Jan 2007 16:58:21 +0000 (+0000) Subject: netfront: Better fix for netfront_tx_slot_available(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15371^2~47 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a802ad78c37b3ce53ae66e3a0188f9f12c5c76a0;p=xen.git netfront: Better fix for netfront_tx_slot_available(). Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 01ccb15b72..f54cc84b89 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -613,11 +613,8 @@ static int network_open(struct net_device *dev) static inline int netfront_tx_slot_available(struct netfront_info *np) { - /* XXX Need to check we have enough grants for worst-case fragments. */ - if (gnttab_empty_grant_references(&np->gref_tx_head)) - return 0; - - return RING_FREE_REQUESTS(&np->tx) >= MAX_SKB_FRAGS + 2; + return ((np->tx.req_prod_pvt - np->tx.rsp_cons) < + (TX_MAX_TARGET - MAX_SKB_FRAGS - 2)); } static inline void network_maybe_wake_tx(struct net_device *dev)