Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02DB9C43334 for ; Mon, 25 Jul 2022 02:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231846AbiGYC4h (ORCPT ); Sun, 24 Jul 2022 22:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbiGYC4e (ORCPT ); Sun, 24 Jul 2022 22:56:34 -0400 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56C602DC0; Sun, 24 Jul 2022 19:56:33 -0700 (PDT) Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-10d845dcf92so13175545fac.12; Sun, 24 Jul 2022 19:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:content-transfer-encoding :user-agent:mime-version; bh=RkTZsJeFpTvsU8WLmzUpFjjYsGgpgJ9z0JuXnV9nhHc=; b=XDJAd25Aj7lR3SnsNWPujqa+Ti6ob7Mcme4CT+GeW4qQSlDs6YzufPGDmlUvxESY5E lkNAc+lJl2OBGAzh+WjvbdjUutvJUbYfcJAYa4J5uhOVAvlMC0Yjza1PukmZ7ed8+nBZ ecvKC2OW0gH2SThastE8FEYG9T/tEn7xlAxT0GGX199J8W6YWfBGQizLIDatI8dG7KoN PDXA0rvftjeSpX5TDKrxHTtegGWPT6ITQmE0NToLl65jVl2QxmUNwyFQoO+YsxyILJft aI5YzzjrftYfqpeZ/rjvn97KZUqo0Ms8LkNyNFb1eRoRE+014lnecOnl9et4mnSM1TjF 1jkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date :content-transfer-encoding:user-agent:mime-version; bh=RkTZsJeFpTvsU8WLmzUpFjjYsGgpgJ9z0JuXnV9nhHc=; b=6ODN16AM/atpaQmRBHhz+R8niCDVfJdIGY+Tu/BHz7KSSMjnwXiMbq4YCm2ijz44hr zxQ9EMbSexO/pccthSJuPBX+Jffa31HsxsPnDH7g5bdqdjvZqnGOs06fk1McyBJWLpuc fuNu7qcnAH6yxusFhDgQ7vYBqvJv2g/I1Scg1ALmz3CxXXgPVVQ1SaQnmEH/frXBRtAb c+OHmw+mzFyzglRSCgzFRAKJ7cxxCKe+Z42qJxln6wN7NEHY2X3D3pfyCDQfzP3yu5zb DkXnBGBaqeXlymtyTs1KhtsExYKiQD8JtJ+Lh+XPMsx0n0lIohR1ThqeO5b5q3OYypse SzeA== X-Gm-Message-State: AJIora8GPe3XMylRS64JQ6N5sz/ep3Jdl1YYdwyXgJOX3btsxctn/JDL UA0WepJbeBVucnktcKHz8zA= X-Google-Smtp-Source: AGRyM1tUg/I8YjjOzxgRXEDrHXG370KaK00Hf/BJ0jKkcfCfSDrM/Ki42Ws3L6ppofjN04m2aS798Q== X-Received: by 2002:a05:6870:8984:b0:10d:d981:151f with SMTP id f4-20020a056870898400b0010dd981151fmr4046685oaq.212.1658717792740; Sun, 24 Jul 2022 19:56:32 -0700 (PDT) Received: from ?IPv6:2804:14c:71:96e6:64c:ef9b:3df0:9e8d? ([2804:14c:71:96e6:64c:ef9b:3df0:9e8d]) by smtp.gmail.com with ESMTPSA id d3-20020a056830004300b0061c7ce09091sm4484848otp.67.2022.07.24.19.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jul 2022 19:56:32 -0700 (PDT) Message-ID: Subject: Patch for 4.19 stable tree "net: usb: ax88179_178a needs FLAG_SEND_ZLP" From: Jose Alonso To: Greg Kroah-Hartman Cc: stable , "David S. Miller" , netdev Date: Sun, 24 Jul 2022 23:56:30 -0300 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For 4.19 stable tree: -------------------- From 36a15e1cb134c0395261ba1940762703f778438c Mon Sep 17 00:00:00 2001 From: Jose Alonso Date: Mon, 13 Jun 2022 15:32:44 -0300 Subject: net: usb: ax88179_178a needs FLAG_SEND_ZLP From: Jose Alonso commit 36a15e1cb134c0395261ba1940762703f778438c upstream. The extra byte inserted by usbnet.c when (length % dev->maxpacket =3D=3D 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D 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). =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Signed-off-by: Jose Alonso Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/ax88179_178a.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1706,7 +1706,7 @@ static const struct driver_info ax88179_info =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1719,7 +1719,7 @@ static const struct driver_info ax88178a_info =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1732,7 +1732,7 @@ static const struct driver_info cypress_GX3_info =3D = { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1745,7 +1745,7 @@ static const struct driver_info dlink_dub1312_info = =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1758,7 +1758,7 @@ static const struct driver_info sitecom_info =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1771,7 +1771,7 @@ static const struct driver_info samsung_info =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1784,7 +1784,7 @@ static const struct driver_info lenovo_info =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, }; @@ -1797,7 +1797,7 @@ static const struct driver_info belkin_info =3D { .link_reset =3D ax88179_link_reset, .reset =3D ax88179_reset, .stop =3D ax88179_stop, - .flags =3D FLAG_ETHER | FLAG_FRAMING_AX, + .flags =3D FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP, .rx_fixup =3D ax88179_rx_fixup, .tx_fixup =3D ax88179_tx_fixup, };