--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c 2006-10-26 08:46:06.000000000 -0600 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c 2006-11-06 10:26:24.000000000 -0700 @@ -815,6 +815,7 @@ static void tx_add_credit(netif_t *netif) { unsigned long max_burst; + unsigned long max_credit; /* * Allow a burst big enough to transmit a jumbo packet of up to 128kB. @@ -823,10 +824,10 @@ max_burst = RING_GET_REQUEST(&netif->tx, netif->tx.req_cons)->size; max_burst = min(max_burst, 131072UL); max_burst = max(max_burst, netif->credit_bytes); + max_credit = max(netif->remaining_credit + netif->credit_bytes, + netif->credit_bytes); - netif->remaining_credit = min(netif->remaining_credit + - netif->credit_bytes, - max_burst); + netif->remaining_credit = min(max_credit, max_burst); } static void tx_credit_callback(unsigned long data)