Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932590AbaBFNiJ (ORCPT ); Thu, 6 Feb 2014 08:38:09 -0500 Received: from mx0.aculab.com ([213.249.233.131]:49596 "HELO mx0.aculab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756241AbaBFNiH convert rfc822-to-8bit (ORCPT ); Thu, 6 Feb 2014 08:38:07 -0500 From: David Laight To: "'Emil Goode'" , "David S. Miller" , Ming Lei , Mark Brown , Jeff Kirsher , Glen Turner CC: "linux-usb@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] net: asix: fix bad header length bug Thread-Topic: [PATCH] net: asix: fix bad header length bug Thread-Index: AQHPIzp49jIHqyBVlkS9F+g2/ALCs5qoMl1Q Date: Thu, 6 Feb 2014 13:37:12 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6B98CA@AcuExch.aculab.com> References: <1391691384-8486-1-git-send-email-emilgoode@gmail.com> In-Reply-To: <1391691384-8486-1-git-send-email-emilgoode@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. 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 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/