Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8796025rwb; Tue, 13 Dec 2022 10:30:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf4HDPIG2+p7bVHe1mnMFZBeJ3yb1iPIay5dx6PExB4WavTygzRxdZK6oj/wvBqTQzA421mc X-Received: by 2002:a05:6a20:2d23:b0:ac:19cf:1553 with SMTP id g35-20020a056a202d2300b000ac19cf1553mr26567065pzl.61.1670956200155; Tue, 13 Dec 2022 10:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670956200; cv=none; d=google.com; s=arc-20160816; b=1HRi82u0ix6LpRnNZ8wg2CzESJSvSJp2BHZwGzIXTkPeYxPSUvNL+xSNgRMxs+7F86 F8y7qiagQoNf4qQLiiNNkDYBwLSRErkArcWcXkMIiWzfa18LR33FpyRqlsqBwssKwktQ bfAuu0pBTJNZ9cZmU0JC+UaHXyWPK3TXgQrRCvzkk9pcJmDrEgmp/lr91rxqzpIPlhdO oZmLJfGZStqH0/lyjTiUeRvILtmeucN6tphr4JzepdSTAn2MHoV5zBRoIBcA86Bw+M90 mKEKKJfgZED64Q1VuPV2XxzhkjlPOssGufKCjyavnvF1VzauBNBGSDoUJod4qIulh4rU FTGg== 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:in-reply-to :references:mime-version:dkim-signature; bh=TwSscO4PEOQF6eSJjMD8VMf0/HEneWx4N+6zCukP0wU=; b=g4FXCHMUmfJ/m7VrC3LGw72x4ZClipSAg35Z0GOReCkVISEJZqK42J9GUwe/hFzrk+ QhswaRrJSJdOkuaPyZeftqAa29Wg5JPo2HDFk7YgdTegOroj6yKHI4ytQXsILltpuoLo eSHmxNkbQ6Bl/uVvIn+lOk1l3xczobFo8gntUGXGZsF3LEIROOIAo3QS5TiNknVh1xQ5 SqrCKSGF8rJRS9PJQ9OJHOn5wrcrnzltetzGEVEb2xBYB5Gko1+mxQCajgQkxu+UjTUV iI2OeNfVj0H/+CiwsfCZ998GeG2PItC837izNbFpPNDyXIW2H06N3hgZTbPD1m5wh8+h jM3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aISaR1Nt; 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 193-20020a6300ca000000b00479139fe810si13449721pga.619.2022.12.13.10.29.50; Tue, 13 Dec 2022 10:30:00 -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=aISaR1Nt; 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 S236504AbiLMSXc (ORCPT + 72 others); Tue, 13 Dec 2022 13:23:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236460AbiLMSX3 (ORCPT ); Tue, 13 Dec 2022 13:23:29 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68417F01B; Tue, 13 Dec 2022 10:23:28 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id gh17so38641521ejb.6; Tue, 13 Dec 2022 10:23:28 -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:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TwSscO4PEOQF6eSJjMD8VMf0/HEneWx4N+6zCukP0wU=; b=aISaR1NtmUs7HLwylIB8pt6NezUoA9MqVwdl1HaqJxF+w6X3F0mTpCZgmb7+ljxrwt k4mwmFp6zMZQoYd4d0MLWDhpRsmzhWmA7uNk49EqQ/4f95adDVJba25WIv06vO/8B37F 3rQEgux0qYjlZlOY8C/LpUBSTkO2e4XEo4Qors0OnlJ4ZXcCCEZ09tDy4wki9a8n3oqZ KAFAm4JLpVSyfKKOLgkjkz+hJkpdUb7X4gZVASHRv/fMuCBj1pGXjEbibY7iRj2v+cH1 XEQWyPWpUU3PMQ2kw+m/mUXlkfTDD5AdjFHNzMt8Q8D2uGIT29xXaWjzHWZkrlREu5Vm 5tBQ== 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:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TwSscO4PEOQF6eSJjMD8VMf0/HEneWx4N+6zCukP0wU=; b=KnxeC6JvPHPdHLdKGo8CeWB33VBlFNMPwcVJLrVAnH+3Bon/UysNeYtD6yzF9yZ6Im hxWd874XEDQY8ZRrjVeNbzl+oZkeQtMkfLmSO2SxRrWx8MJdj3RffCFzAU7zhjoIDkjQ o5uE1adqB/0C45ZnpJskH5ZhxfO0TEwM4bX9OGdWEZ8RZkV+x5t5Q+L+gGBpP29e92u/ XNyDCpcsU8D7uN+LddesqD8mCqOiP8H8j4Wd1kbYrBEaOPuf/C0FyQGOS1SN/s1vPSN8 JYHAsWExZ77fh++Mz1KZhuUJSOuUXw97SZXDVm3BjOW/oJ1MRgPGB38DoWOpZZGC7Zof qs6Q== X-Gm-Message-State: ANoB5pnH4YznKazvLaHDKGfdMKAv44AgcfwwoPdsbfvu9YQaX4CZsrFK 2z32z7/7CheruAeyVEGF8zOdWG/ebA+8nlY/gI0= X-Received: by 2002:a17:906:694a:b0:7c0:9d50:5144 with SMTP id c10-20020a170906694a00b007c09d505144mr31755625ejs.590.1670955806889; Tue, 13 Dec 2022 10:23:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Palmas Date: Tue, 13 Dec 2022 19:23:13 +0100 Message-ID: Subject: Re: [PATCH] net: Fix for packets being rejected in the xHCI controller's ring buffer To: "Seija K." Cc: =?UTF-8?Q?Bj=C3=B8rn_Mork?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Hello Seija, Il giorno mar 13 dic 2022 alle ore 18:44 Seija K. ha scritto: > > 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; Did you test this change with QMAP? To support qmap dl aggregated blocks qmi_wwan relies on the usbnet_change_mtu behavior of changing the rx_urb_size. Thanks, Daniele > err: > return status; > } > -- > 2.38.2