Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8774764rwb; Tue, 13 Dec 2022 10:13:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FRAj+QRQn+OokpbTK5tRqUPqdlET+GKrusktftb/GTKMkplQXiXCKGotsdaQyXevJNljD X-Received: by 2002:a05:6402:294b:b0:461:ca30:653 with SMTP id ed11-20020a056402294b00b00461ca300653mr21347059edb.31.1670955222585; Tue, 13 Dec 2022 10:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670955222; cv=none; d=google.com; s=arc-20160816; b=ijwr5v2b9Yeeh/xoxbpdzolOx36NOhleMLF87T13EN1JIvnW+RRGIoOgvpKt3n6Un8 hHSJEwRTWUuRkXd7kE50eHqVsNVAe0qzImnvF2SEHcQP8UL818Dikqmmxb+GvJsjy04m JUpde0D/falJWjRxihMMGffeo62SgpaLGQZUudoZsjmSAlHU/DtV2hB7owmAHeBwC/Jp /BllnjwsUDm7+QY/nv44gS2DsZ7YFd782gNwAXjcZAeDN2jtnUfW2qFXdIj10vKGaNTM qb+dO4gOe71koGWbWC3KRvvzcM5XqRXFuhqDXoq82ggN1OaIPf2yXiRRW8dxH6Ilavya ON6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=MHaXp0mzcSuAY+PnbsFakfY5htA6vqOLH6b5U9mLwcc=; b=pGvBCVlMMJEgPgpShmJCy6MFG6FmlLFdIo9KslVnVyr1NQ6UKXfS2U1jelukPQGHqs wHqNIhY2cXYXrGe1IHdqOo+iMrzD3Zry6t0bWxaDWC/08nycTXGkkFsgPhZa/hNvPbSd mVoaW1Fp3CoT09V6lmts8Ohn2k4Q1fkc2AI+5J4WFcsxWNUWhJFotHbq4bXKNSJVpIgL ja7ARgOMtkc0tZLZ9GhSMhTgFBX4Tu48j4NI/waqHuZnOWSUz7i+s6RlRHImSfqgJJ76 C3xlRYohLH2afRLHwT7IvKS+hrmWO7ctp51bOoEaRGw4hqg35lbpkgptgtNyMLYj3pN6 l86Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eFJhfcBG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di4-20020a170906730400b007c0d6b34c2bsi9624643ejc.647.2022.12.13.10.13.25; Tue, 13 Dec 2022 10:13:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eFJhfcBG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236155AbiLMRlL (ORCPT + 72 others); Tue, 13 Dec 2022 12:41:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236121AbiLMRlH (ORCPT ); Tue, 13 Dec 2022 12:41:07 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD0223380; Tue, 13 Dec 2022 09:41:05 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id z26so6113276lfu.8; Tue, 13 Dec 2022 09:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=MHaXp0mzcSuAY+PnbsFakfY5htA6vqOLH6b5U9mLwcc=; b=eFJhfcBGzq8f6RGA6enz6RIwE8LfAwfADKdybqzk3CgbVYrvl01QdNWjemVZFcsE7M Y/MJUMX2XhFpU7lLjKx0tC+jeHa8+tQeR8GWsJ3mtZZKVjMeyk3TH3tADN6UgTeIE/re QnmiPbdtsP1jbBxzA6pza7vA93pzFGjZYTaEvUROCTUm2TW0+pG79wWrH/0qH7LOaebY uSCQvRVBUPzUdaqUzxfxodQmvWVNt587TVsZ6UPV9AVrnhlIhmPrrs+yvm8CdGDuL1Sq ddlWo1l4pv55OczEgyhluKwjJPXNMoT5Dk/Mho9Y4m8A4FywmYEO7/g/LwaF2iiToVlP lsXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MHaXp0mzcSuAY+PnbsFakfY5htA6vqOLH6b5U9mLwcc=; b=Q85q7rqS38xpFIS4mZdHClilcF5XgJ+2NtvoikWSw2oCLWp1vuZoGzclHnK3znZ7gg geONnOAhx1Cctji2Tnc/AorY//X9lI5JGz8ZnmG21Z367zYQhS2qqnNj3NVBWtX5U08f nfmHczANFyGQzcu/ARMlXsxYAspOTscMSAS8J/8rrsdl2kb6hIyztUb282TUuNVpZiH9 M6GDkrHh+GBFZvKEK7Ln/rW7CYxwD/tCRG6uyTMzkMTqKtaZ0hTD7lBpNKF4ydL7/k+4 EK0jv9sIr8RrKCJVfN78gT4+TGwzfAFWkRTzHN2y8zg9LGO9b31WAcK24CMVp6fVucEo qUGg== X-Gm-Message-State: ANoB5plD4lovsuFwjw3+6/qIQfuf0+9QSku0pzEPShI90AXTRrAVl5zF 7pW2HNlm+qqcE8m4GsxY+SxlMOPtbNFDiej+MQ== X-Received: by 2002:a05:6512:3907:b0:4aa:cd5c:4c52 with SMTP id a7-20020a056512390700b004aacd5c4c52mr26090068lfu.374.1670953263883; Tue, 13 Dec 2022 09:41:03 -0800 (PST) MIME-Version: 1.0 From: "Seija K." Date: Tue, 13 Dec 2022 12:40:52 -0500 Message-ID: Subject: [PATCH] net: Fix for packets being rejected in the xHCI controller's ring buffer To: =?UTF-8?Q?Bj=C3=B8rn_Mork?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a packet larger than MTU arrives in Linux from the modem, it is discarded with -EOVERFLOW error (Babble error). This is seen on USB3.0 and USB2.0 buses. This is because the MRU (Max Receive Size) is not a separate entity from the MTU (Max Transmit Size), and the received packets can be larger than those transmitted. Following the babble error, there was an endless supply of zero-length URBs that were rejected with -EPROTO (increasing the rx input error counter each time). This is only seen on USB3.0. These continue to come ad infinitum until the modem is shut down. There appears to be a bug in the core USB handling code in Linux that doesn't deal with network MTUs smaller than 1500 bytes well. By default, the dev->hard_mtu (the real MTU) is in lockstep with dev->rx_urb_size (essentially an MRU), and the latter is causing trouble. This has nothing to do with the modems; the issue can be reproduced by getting a USB-Ethernet dongle, setting the MTU to 1430, and pinging with size greater than 1406. Signed-off-by: Seija Kijin Co-Authored-By: TarAldarion --- drivers/net/usb/qmi_wwan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 554d4e2a84a4..39db53a74b5a 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -842,6 +842,13 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) } dev->net->netdev_ops = &qmi_wwan_netdev_ops; dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group; + /* LTE Networks don't always respect their own MTU on the receiving side; + * e.g. AT&T pushes 1430 MTU but still allows 1500 byte packets from + * far-end networks. Make the receive buffer large enough to accommodate + * them, and add four bytes so MTU does not equal MRU on network + * with 1500 MTU. Otherwise, usbnet_change_mtu() will change both. + */ + dev->rx_urb_size = ETH_DATA_LEN + 4; err: return status; } -- 2.38.2