]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 21:29:59 +0000 (13:29 -0800)
commite9ed6c09a7dd1b3a8ff28f1684769190b3ccaec2
tree43a8032098114f9366c0e638acc990162f1c1d18
parent34c18d120cf30789ae74a3a7017b89e91dcadab6
vmxnet3: prevent receive getting out of sequence on napi poll

Orabug: 25639933

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>
(cherry picked from commit 0769636cb5b95665ebadcd1a41c46f331f5a397d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/vmxnet3/vmxnet3_drv.c