qeth: enforce a rate limit for inbound scatter gather messages
under memory pressure scatter gather mode switching messages must be rate limited. Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
d0a34f98d1
commit
cde4603516
|
@ -2803,13 +2803,16 @@ qeth_queue_input_buffer(struct qeth_card *card, int index)
|
||||||
if (newcount < count) {
|
if (newcount < count) {
|
||||||
/* we are in memory shortage so we switch back to
|
/* we are in memory shortage so we switch back to
|
||||||
traditional skb allocation and drop packages */
|
traditional skb allocation and drop packages */
|
||||||
if (atomic_cmpxchg(&card->force_alloc_skb, 0, 1))
|
if (!atomic_read(&card->force_alloc_skb) &&
|
||||||
printk(KERN_WARNING
|
net_ratelimit())
|
||||||
"qeth: switch to alloc skb\n");
|
PRINT_WARN("Switch to alloc skb\n");
|
||||||
|
atomic_set(&card->force_alloc_skb, 3);
|
||||||
count = newcount;
|
count = newcount;
|
||||||
} else {
|
} else {
|
||||||
if (atomic_cmpxchg(&card->force_alloc_skb, 1, 0))
|
if ((atomic_read(&card->force_alloc_skb) == 1) &&
|
||||||
printk(KERN_WARNING "qeth: switch to sg\n");
|
net_ratelimit())
|
||||||
|
PRINT_WARN("Switch to sg\n");
|
||||||
|
atomic_add_unless(&card->force_alloc_skb, -1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue