Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp50164rwb; Wed, 14 Dec 2022 13:52:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lnnxIlFyKcBSKZ07Kbu8iDvadR6rCheRmx7RjrYaYZHwokfD+aGgXl4YLbMkwZBA8Jchw X-Received: by 2002:a17:906:960b:b0:7c1:1bc:7fd4 with SMTP id s11-20020a170906960b00b007c101bc7fd4mr21635504ejx.42.1671054757252; Wed, 14 Dec 2022 13:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671054757; cv=none; d=google.com; s=arc-20160816; b=kYwWAgAF+B7Ij3VRPQEGSv94L9Gvaz8GJZYldoKubDlCau9ig7lR7TQD2RnSf5PN8+ KUO34UQn4Lx4Nj2xS5OvMDeSlfQNqqokH4Mutc+NC9SsaIHtIvUZy9xXmYwRMMkR7YRE 9i2WYApFwXYvo/fN5DXXxVBpcovoL805w4GwVBXec2tQ6KxpjsSYyrU24JCIKuDwJZqv dk2jMynwg3yj/8YX+60qyVOhGc1GjXJAbvr7kG8SRhaNo0S74WfUv8CnEkexuIggFnRp 4igPwlmKRJvIt1C6AaEon7/6T1iJRQg7R1Sld19TZw6YtWIOsum84OqOKl7fg86SazZ+ 5f7A== 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=3jT8BbEnTMk4PvBeviyKw2FcYCYOfLeszTEBNvSB5Oo=; b=EicOORli2g6MwX5yE2YqAX7QbrwRKx6xXNEeNcTkCATfujH+n7zM+DKCJP/6fMPEPt BsqLX8hpzmPFnADa/Cp8GOqX+gPXYbYhlyTtO2zSNAwpD8XDh2S47AdTv4sj/ubufAht xgsv2h8Z31l6XbS3XM2o4xTDawRhiG+QTWyC578HhWG9EvrdtGP9uqbXmvPrE9v7bb7M vYYY08GNGf75DhpW5pcodC8RBrnGWF8Z/RuU75Jw09Z6hWEdfqKam9ABeZpLSEPlCYvB FiZ7NJHrUjTYtvuyshtWEn+ZPHle/BA98XTcDGhn+gikCI0PwBHClsi6ZgaqwZAJlmFz pyiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YaSXoKz3; 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 lz25-20020a170906fb1900b007316843d58bsi9194925ejb.925.2022.12.14.13.52.19; Wed, 14 Dec 2022 13:52:37 -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=YaSXoKz3; 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 S229720AbiLNVkM (ORCPT + 70 others); Wed, 14 Dec 2022 16:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiLNVkL (ORCPT ); Wed, 14 Dec 2022 16:40:11 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 777623D92F; Wed, 14 Dec 2022 13:40:07 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id j4so12735278lfk.0; Wed, 14 Dec 2022 13:40:07 -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=3jT8BbEnTMk4PvBeviyKw2FcYCYOfLeszTEBNvSB5Oo=; b=YaSXoKz3u/5HGMhU88zPl4NQgxVNjpIjM+WeKSNkZ/UrWgPauK3YyuOlu0RckPaFVe mFZccA/HUjQHaQd6JnPV5CvjrDK5PHvJck3kd1EQZkVTBaxrfoaAYOmbVB8W88NQqZkk j/Sir9JwwherHi9gjNtcUTvlnpEer1Td/C/pIbklsXE8SKjd7G1FYmL67uFCPwojI/Gu QLCP7lUDLrVBFXqxkGa6NpYnVAVI9KmnZAnkhBYK1zzVId3SXtp7E6n3knCzvtsFjNu1 ZmhUL3LvZJlg4k4G6mpDjWB+pAMda0TaOBkdN1Yg24cp0j1Vm8nKSP1KsHWweye4fjUf 8k0w== 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=3jT8BbEnTMk4PvBeviyKw2FcYCYOfLeszTEBNvSB5Oo=; b=wToiWjsyeUoATfQCZJNHqhUkkGhIvtxPLNUhSsHhk1SBhtZ16GKnx98jU61HjIUMIe USz4/QlkG3gFuveY9hmZC+rLK6IfRLa2/402VcCpD5Ytsstd8BxlF9q+JngbUjJTKki4 1wn/pvhcQdgeu8gERBdZDKAW9itkvfvCgvGXcy9oHInkQsd9cNMrJsLOu8Qx2JbjZzOJ tVESgEh7szU6TJ22snECOYrHAhNHXagiqJz95HTgt3TdkKA/89QyJxKoZsdQifH4kIPH KgRUkyNY+Gj33G0oduGFj1pS/Q+oCZrhAX2YiI/4APJaywMY96fToHr7ip9HBG5zzgOJ IaxQ== X-Gm-Message-State: ANoB5plODRqXvpwI21MGemgSj/8jZ6ulNr0d9ER7F+B7bxiqc/y0Si9z X4+oSnBEsilc9DmblY/qOMPRU9jF7PiRJjbLcPbs/lWySm5z X-Received: by 2002:a05:6512:324d:b0:4a2:4d28:73b9 with SMTP id c13-20020a056512324d00b004a24d2873b9mr36407500lfr.690.1671054005708; Wed, 14 Dec 2022 13:40:05 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Seija K." Date: Wed, 14 Dec 2022 16:39:54 -0500 Message-ID: Subject: Re: [PATCH] net: Fix for packets being rejected in the xHCI controller's ring buffer To: Daniele Palmas 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=-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 Ok, thanks. On Wed, Dec 14, 2022 at 10:25 AM Daniele Palmas wrote: > > Hello Seija, > > Il giorno mar 13 dic 2022 alle ore 20:55 Seija K. > ha scritto: > > On Tue, Dec 13, 2022 at 1:23 PM Daniele Palmas wrote: > > > > > > 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 > > > > Yes, I did. > > > > I've applied your change and verified that the rx_urb_size can't be > changed anymore by modifying the mtu of the wwan netdevice and stays > fixed to 1504. > > Just a heads-up, that this change is not working fine with qmap setup > procedure, since the URB size can't be changed anymore to the value of > the maximum dl aggregated block set through wda_set_data_format. > > I know that linking MTU with the rx_urb_size is odd, but this is how > it's done currently. > > Regards, > Daniele > > > On Tue, Dec 13, 2022 at 1:23 PM Daniele Palmas wrote: > > > > > > 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