]> git.lizzy.rs Git - plan9front.git/commit
ether8169: deal with kernel memory exhaution
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 7 Jan 2018 23:23:26 +0000 (00:23 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 7 Jan 2018 23:23:26 +0000 (00:23 +0100)
commitacb206859deafd32c5ef1901560dc13be2c0d280
tree58b5478b622d702f171af73a6d616a8c951e17d5
parent069230cd621ae5b3b9ab6e1a31eb6250fc86e30b
ether8169: deal with kernel memory exhaution

when kernel memory is exhausted, rtl8169replenish() can fail
to plant more receive descriptors and rtl8169receive() would
run over the receive tail and crash on the nil ctlr->rb[x].

rtl8169receive() is called on "Receive Descriptor Unavailable"
and "Packet Underrun" so we will try to replenish descriptors
in the beginning first in case memory was exhausted and memory
is available again and make sure not to run over the tail.
sys/src/9/pc/ether8169.c