diff options
Diffstat (limited to 'drivers/net/xen-netback/netback.c')
-rw-r--r-- | drivers/net/xen-netback/netback.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 1049c34e7d43..72ee1c305cc4 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -687,6 +687,7 @@ static void tx_add_credit(struct xenvif_queue *queue) | |||
687 | max_credit = ULONG_MAX; /* wrapped: clamp to ULONG_MAX */ | 687 | max_credit = ULONG_MAX; /* wrapped: clamp to ULONG_MAX */ |
688 | 688 | ||
689 | queue->remaining_credit = min(max_credit, max_burst); | 689 | queue->remaining_credit = min(max_credit, max_burst); |
690 | queue->rate_limited = false; | ||
690 | } | 691 | } |
691 | 692 | ||
692 | void xenvif_tx_credit_callback(unsigned long data) | 693 | void xenvif_tx_credit_callback(unsigned long data) |
@@ -1184,8 +1185,10 @@ static bool tx_credit_exceeded(struct xenvif_queue *queue, unsigned size) | |||
1184 | msecs_to_jiffies(queue->credit_usec / 1000); | 1185 | msecs_to_jiffies(queue->credit_usec / 1000); |
1185 | 1186 | ||
1186 | /* Timer could already be pending in rare cases. */ | 1187 | /* Timer could already be pending in rare cases. */ |
1187 | if (timer_pending(&queue->credit_timeout)) | 1188 | if (timer_pending(&queue->credit_timeout)) { |
1189 | queue->rate_limited = true; | ||
1188 | return true; | 1190 | return true; |
1191 | } | ||
1189 | 1192 | ||
1190 | /* Passed the point where we can replenish credit? */ | 1193 | /* Passed the point where we can replenish credit? */ |
1191 | if (time_after_eq64(now, next_credit)) { | 1194 | if (time_after_eq64(now, next_credit)) { |
@@ -1200,6 +1203,7 @@ static bool tx_credit_exceeded(struct xenvif_queue *queue, unsigned size) | |||
1200 | mod_timer(&queue->credit_timeout, | 1203 | mod_timer(&queue->credit_timeout, |
1201 | next_credit); | 1204 | next_credit); |
1202 | queue->credit_window_start = next_credit; | 1205 | queue->credit_window_start = next_credit; |
1206 | queue->rate_limited = true; | ||
1203 | 1207 | ||
1204 | return true; | 1208 | return true; |
1205 | } | 1209 | } |