FreddyXin / ax88179_178a

ASIX AX88179_178A Linux Driver Source Code
12 stars 12 forks source link

1000Mbps failing (100Mbps working) #5

Open pauloppenheim opened 11 years ago

pauloppenheim commented 11 years ago

Upon boot / plug, the device connects and negotiates correctly, but then fails to even be able to query DNS reliably.

Cheap example:

paul@host:~$ sudo ethtool -s eth0 speed 1000 duplex full autoneg off
paul@host:~$ timeout 10.0s whois yahoo.com | head
Interrupted by signal 15...
Terminated
paul@host:~$ sudo ethtool -s eth0 speed 100 duplex full autoneg off
paul@host:~$ timeout 10.0s whois yahoo.com | head

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

   Server Name:
...

My hardware is a Dell XPS 13 "Developer Edition" Ubuntu machine, an "ultrabook" with no built-in Ethernet. I appear to not be the only one with this hardware and this same issue:

I have tried reasonably fresh builds of kernel 3.11, both from mainline and from Ubuntu Saucy.

paul@host:~$ uname -a
Linux host 3.11.0-5-generic #11 SMP Fri Sep 6 15:48:07 PDT 2013 x86_64 x86_64 x86_64 GNU/Linux

paul@host:~$ lspci
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation QS77 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)

paul@host:~$ lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 003: ID 0b95:1790 ASIX Electronics Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1bcf:288f Sunplus Innovation Technology Inc. 
Bus 002 Device 003: ID 8087:07da Intel Corp. 

Please let me know if there is any more data I could provide that would be useful.

Thank you for maintaining this driver! It seems like it might be growing in importance as more ultrabooks get produced without ethernet.

graingert commented 11 years ago

This is a duplicate of #1

pauloppenheim commented 11 years ago

I'm moderately sure this is not a duplicate. That issue reports seeing malformed packets; this issue is not seeing any packets aside from DNS UDP with bad CRC (but apparently correct data?). Issue #1 reports problems with linux kernels 3.5 to 3.9 and resolution with 3.10; this issue appears with kernel 3.11. From a user level they appear superficially similar, however from a driver level I would not make that assumption.

ghost commented 11 years ago

I'm having the same issue with the both the same laptop (and others) with the same adapter. What can I do to help diagnose and correct this issue?

On Wed, Sep 25, 2013 at 2:02 PM, Paul Oppenheim notifications@github.comwrote:

I'm moderately sure this is not a duplicate. That issue reports seeing malformed packets; this issue is not seeing any packets aside from DNS UDP with bad CRC (but apparently correct data?). Issue #1https://github.com/FreddyXin/ax88179_178a/issues/1reports problems with linux kernels 3.5 to 3.9 and resolution with 3.10; this issue appears with kernel 3.11. From a user level they appear superficially similar, however from a driver level I would not make that assumption.

— Reply to this email directly or view it on GitHubhttps://github.com/FreddyXin/ax88179_178a/issues/5#issuecomment-25124551 .

sciurus commented 11 years ago

I also have problems with a Dell XPS 13 running 64-bit Ubuntu 13.10. When connected at 1Gbps, I get large numbers of dropped packets (identified by rx-drp in netstat output). If I use ethtool to force 100Mbps, I stop dropping packets.

$ uname -a
Linux tullock 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$ lsusb | grep ASIX
Bus 004 Device 007: ID 0b95:1790 ASIX Electronics Corp. 
mmason56 commented 11 years ago

There's a bug in the asix.h header file. These two lines:

define AX_RXHDR_CRC_ERR 0x80000000

define AX_RXHDR_DROP_ERR 0x40000000

should be:

define AX_RXHDR_CRC_ERR 0x20000000

define AX_RXHDR_MII_ERR 0x40000000

define AX_RXHDR_DROP_ERR 0x80000000

We got this fix from ASIX a few weeks ago. 1Gbps was unusable (lots of dropped packets) until we made this change. Looks like the GitHub version needs to be updated.

pauloppenheim commented 11 years ago

Commenter @mmason56 - you have no other activity on github besides this comment. Do you have a way to verify the information you have presented?

I have applied the changes, and the #define changes do solve the problem. I can't imagine how these changes would possibly be dangerous, but I am not a kernel expert, and this code runs privileged. Through your contact with ASIX, could you ask them to comment on this issue from an account of an ASIX employee?

For those following the issue, CRC and DROP are self-explanatory, but MII is ethernet specific. It refers to "Media Independent Interface", and more info is available on Wikipedia. Naturally, if a dropped packet (common occurrence) is thought to be a CRC error (uncommon occurrence), the interface would not work for very long. This explains the symptoms of my original problem very well, so aside from ASIX verification on patch authenticity, I consider this issue solved.

GodfatherOfBandwidth commented 10 years ago

I cannot vouch for the person who suggested the changes to the code, but I can say that it fixed the issue. The evidence seems to point to it being safe to roll into the code.

jekkel commented 10 years ago

Seems the above fix made its way into linux kernel line v3.12.

zyphlar commented 10 years ago

(a) is this confirmed fixed, @pauloppenheim ? (b) is your adapter the Dell-branded one here? They don't mention Linux compatibility... http://accessories.us.dell.com/sna/productdetail.aspx?c=us&l=en&s=bsd&cs=04&sku=331-9318

pauloppenheim commented 10 years ago

Yes, this fix works, and @jekkel is correct that a variation of the patch has been applied in kernel 3.12. Here's the submission: https://lkml.org/lkml/2013/10/22/32 along with some other interesting patches in that same time frame: https://lkml.org/lkml/2013/10/24/28 https://lkml.org/lkml/2013/12/13/129

As with all kernel modules, one caveat is that this requires a make clean && make && make install after every kernel update the distro makes, which can be hard to remember.

AX_RXHDR_MII_ERR is not used in the source, so it is not necessary (but is good for reference I suppose).

I am not using the Dell branded adapter. I have two cheap USB 3 gigabit adapters (Rosewill and some other brand I have not heard of before), and both of them have the asix chipset.

The issue would be closed, but the patch has not been made in this repo yet, so this bug is still useful to note to those who would use this source driver in older kernels.