mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
[NET] back: Fix bug in 12262:ac2097d71e06dbbf77279af10d6ae7359d921ab0.
Pointed out by Jan Beulich. Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
f8e7741960
commit
3e7ce38dce
1 file changed
+3
-1
@@ -825,7 +825,9 @@ static void tx_add_credit(netif_t *netif)
|
||||
max_burst = max(max_burst, netif->credit_bytes);
|
||||
|
||||
/* Take care that adding a new chunk of credit doesn't wrap to zero. */
|
||||
max_credit = max(netif->remaining_credit + netif->credit_bytes, ~0UL);
|
||||
max_credit = netif->remaining_credit + netif->credit_bytes;
|
||||
if (max_credit < netif->remaining_credit)
|
||||
max_credit = ULONG_MAX; /* wrapped: clamp to ULONG_MAX */
|
||||
|
||||
netif->remaining_credit = min(max_credit, max_burst);
|
||||
}
|
||||
|
||||