]> git.baikalelectronics.ru Git - kernel.git/commit
mv643xx_eth: OOM handling fixes
authorLennert Buytenhek <buytenh@wantstofly.org>
Wed, 29 Apr 2009 11:57:34 +0000 (11:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Apr 2009 00:24:17 +0000 (17:24 -0700)
commit85c40f6acabf91e83fcd88556f0fccfb884968fd
tree9b52363bc4eb6b97489a4913868dee0064e21249
parentab79f48d9231464f3a8510a0d787af32ea0beec3
mv643xx_eth: OOM handling fixes

Currently, when OOM occurs during rx ring refill, mv643xx_eth will get
into an infinite loop, due to the refill function setting the OOM bit
but not clearing the 'rx refill needed' bit for this queue, while the
calling function (the NAPI poll handler) will call the refill function
in a loop until the 'rx refill needed' bit goes off, without checking
the OOM bit.

This patch fixes this by checking the OOM bit in the NAPI poll handler
before attempting to do rx refill.  This means that once OOM occurs,
we won't try to do any memory allocations again until the next invocation
of the poll handler.

While we're at it, change the OOM flag to be a single bit instead of
one bit per receive queue since OOM is a system state rather than a
per-queue state, and cancel the OOM timer on entry to the NAPI poll
handler if it's running to prevent it from firing when we've already
come out of OOM.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mv643xx_eth.c