Commit 36a15e1c authored by Jose Alonso's avatar Jose Alonso Committed by David S. Miller

net: usb: ax88179_178a needs FLAG_SEND_ZLP

The extra byte inserted by usbnet.c when
 (length % dev->maxpacket == 0) is causing problems to device.

This patch sets FLAG_SEND_ZLP to avoid this.

Tested with: 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet

Problems observed:
======================================================================
1) Using ssh/sshfs. The remote sshd daemon can abort with the message:
   "message authentication code incorrect"
   This happens because the tcp message sent is corrupted during the
   USB "Bulk out". The device calculate the tcp checksum and send a
   valid tcp message to the remote sshd. Then the encryption detects
   the error and aborts.
2) NETDEV WATCHDOG: ... (ax88179_178a): transmit queue 0 timed out
3) Stop normal work without any log message.
   The "Bulk in" continue receiving packets normally.
   The host sends "Bulk out" and the device responds with -ECONNRESET.
   (The netusb.c code tx_complete ignore -ECONNRESET)
Under normal conditions these errors take days to happen and in
intense usage take hours.

A test with ping gives packet loss, showing that something is wrong:
ping -4 -s 462 {destination}	# 462 = 512 - 42 - 8
Not all packets fail.
My guess is that the device tries to find another packet starting
at the extra byte and will fail or not depending on the next
bytes (old buffer content).
======================================================================
Signed-off-by: default avatarJose Alonso <joalonsof@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 371de1aa
...@@ -1750,7 +1750,7 @@ static const struct driver_info ax88179_info = { ...@@ -1750,7 +1750,7 @@ static const struct driver_info ax88179_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1763,7 +1763,7 @@ static const struct driver_info ax88178a_info = { ...@@ -1763,7 +1763,7 @@ static const struct driver_info ax88178a_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1776,7 +1776,7 @@ static const struct driver_info cypress_GX3_info = { ...@@ -1776,7 +1776,7 @@ static const struct driver_info cypress_GX3_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1789,7 +1789,7 @@ static const struct driver_info dlink_dub1312_info = { ...@@ -1789,7 +1789,7 @@ static const struct driver_info dlink_dub1312_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1802,7 +1802,7 @@ static const struct driver_info sitecom_info = { ...@@ -1802,7 +1802,7 @@ static const struct driver_info sitecom_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1815,7 +1815,7 @@ static const struct driver_info samsung_info = { ...@@ -1815,7 +1815,7 @@ static const struct driver_info samsung_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1828,7 +1828,7 @@ static const struct driver_info lenovo_info = { ...@@ -1828,7 +1828,7 @@ static const struct driver_info lenovo_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1841,7 +1841,7 @@ static const struct driver_info belkin_info = { ...@@ -1841,7 +1841,7 @@ static const struct driver_info belkin_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1854,7 +1854,7 @@ static const struct driver_info toshiba_info = { ...@@ -1854,7 +1854,7 @@ static const struct driver_info toshiba_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1867,7 +1867,7 @@ static const struct driver_info mct_info = { ...@@ -1867,7 +1867,7 @@ static const struct driver_info mct_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1880,7 +1880,7 @@ static const struct driver_info at_umc2000_info = { ...@@ -1880,7 +1880,7 @@ static const struct driver_info at_umc2000_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1893,7 +1893,7 @@ static const struct driver_info at_umc200_info = { ...@@ -1893,7 +1893,7 @@ static const struct driver_info at_umc200_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
...@@ -1906,7 +1906,7 @@ static const struct driver_info at_umc2000sp_info = { ...@@ -1906,7 +1906,7 @@ static const struct driver_info at_umc2000sp_info = {
.link_reset = ax88179_link_reset, .link_reset = ax88179_link_reset,
.reset = ax88179_reset, .reset = ax88179_reset,
.stop = ax88179_stop, .stop = ax88179_stop,
.flags = FLAG_ETHER | FLAG_FRAMING_AX, .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
.rx_fixup = ax88179_rx_fixup, .rx_fixup = ax88179_rx_fixup,
.tx_fixup = ax88179_tx_fixup, .tx_fixup = ax88179_tx_fixup,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment