[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 7 Jul 2015 14:26:39 -0400
From: Neil Horman <nhorman@...driver.com>
To: Andy Gospodarek <gospo@...ulusnetworks.com>
Cc: netdev@...r.kernel.org, Shreyas Bhatewara <sbhatewara@...are.com>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] vmxnet3: prevent receive getting out of sequence on napi
poll
On Tue, Jul 07, 2015 at 02:10:50PM -0400, Andy Gospodarek wrote:
> On Tue, Jul 07, 2015 at 02:02:18PM -0400, Neil Horman wrote:
> > 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@...driver.com>
> > CC: Shreyas Bhatewara <sbhatewara@...are.com>
> > CC: "David S. Miller" <davem@...emloft.net>
>
> Looks good. I'm now curious how widespread something like this might be
> for drivers that use a similar EOP marker....
>
Thats a fair question, though It manifests pretty clearly in any driver that
does any sort of strict state checking. I think several drivers just punt if
they see an EOP desriptor before an SOP descriptor, toss it and keep going, so
you might loose a few extra frames while the driver drains the queue.
> Acked-by: Andy Gospodarek <gospo@...ulusnetworks.com>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists