From: Emil Goode <emilgoode@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "David S. Miller" <davem@davemloft.net>,
Ming Lei <ming.lei@canonical.com>,
Mark Brown <broonie@linaro.org>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
Glen Turner <gdt@gdt.id.au>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: asix: fix bad header length bug
Date: Thu, 6 Feb 2014 16:02:26 +0100 [thread overview]
Message-ID: <20140206150226.GA5251@lianli> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D0F6B98CA@AcuExch.aculab.com>
Hello David,
Thank's for the review.
On Thu, Feb 06, 2014 at 01:37:12PM +0000, David Laight wrote:
> From: Emil Goode
> > The AX88772B occasionally send rx packets that cross urb boundaries
> > and the remaining partial packet is sent with no header.
> > When the buffer with a partial packet is of less number of octets
> > than the value of hard_header_len the buffer is discarded by the
> > usbnet module. This is causing dropped packages and error messages
> > in dmesg.
> >
> > This can be reproduced by using ping with a packet size
> > between 1965-1976.
>
> I think this can affect other USB ethernet drivers.
> Probably most of the ones that explicitly set rx_urb_len.
>
> The ax88179_178a driver sets massive 20k receive urb.
The ax88179_178a has it's own bind function, so I believe it's
not affected by this change.
> I've seen over 10k of data in a single urb, dunno if it
> can actually generate more than 20k - possibly if the usb3 link
> is loaded with other traffic.
> It would be much more efficient for it to use an aligned 4k urb
> and then merge the fragment into skbs.
>
> Once you've set:
> + dev->net->hard_header_len = 0; /* Partial packets have no header */
> try setting the mtu to a multiple of 1k.
I tried setting the mtu to 2000 and when using ping with a large enough
packet size to fill the urb to rx_urb_size all packages are dropped.
> There is a very odd check in usbnet_change_mtu() that tries to stop the
> receive urb_length being a multiple of the usb packet size.
This is very odd indeed!
>
> This code looks as though it is hoping that the usb controller will discard
> any full length bulk messages after finding a short buffer.
> I suspect that might be just wishful thinking!
>
> David
>
>
>
prev parent reply other threads:[~2014-02-06 15:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 12:56 [PATCH] net: asix: fix bad header length bug Emil Goode
2014-02-06 13:19 ` Igor Gnatenko
2014-02-06 15:28 ` David Laight
2014-02-06 22:41 ` Emil Goode
2014-02-07 9:38 ` Bjørn Mork
2014-02-07 13:53 ` Emil Goode
2014-02-07 14:40 ` David Laight
2014-02-06 13:37 ` David Laight
2014-02-06 15:02 ` Emil Goode [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140206150226.GA5251@lianli \
--to=emilgoode@gmail.com \
--cc=David.Laight@ACULAB.COM \
--cc=broonie@linaro.org \
--cc=davem@davemloft.net \
--cc=gdt@gdt.id.au \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).