]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit0769636cb5b95665ebadcd1a41c46f331f5a397d
tree7e3689eb1a23e1ff97a54f3748dc83add84d17e9
parent974d7af5fcc295dcf8315255142b2fe44fd74b0c
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