]> git.baikalelectronics.ru Git - kernel.git/commit
vmxnet3: prevent receive getting out of sequence on napi poll
authorNeil Horman <nhorman@tuxdriver.com>
Tue, 7 Jul 2015 18:02:18 +0000 (14:02 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Jul 2015 06:36:11 +0000 (23:36 -0700)
commit3140fd27d149ec1f4890705cce9422a543f2375a
tree7e3689eb1a23e1ff97a54f3748dc83add84d17e9
parent51ee35b5306912489d38d9f5b99aa186545ab07e
vmxnet3: prevent receive getting out of sequence on napi poll

vmxnet3's current napi path is built to count every rx descriptor we recieve,
and use that as a count of the napi budget.  That means its possible to return
from a napi poll halfway through recieving a fragmented packet accross multiple
dma descriptors.  If that happens, the next napi poll will start with the
descriptor ring in an improper state (e.g. the first descriptor we look at may
have the end-of-packet bit set), which will cause a BUG halt in the driver.

Fix the issue by only counting whole received packets in the napi poll and
returning that value, rather than the descriptor count.

Tested by the reporter and myself, successfully

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Shreyas Bhatewara <sbhatewara@vmware.com>
CC: "David S. Miller" <davem@davemloft.net>
Acked-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_drv.c