Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1230576rwb; Wed, 14 Dec 2022 07:58:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4U/+2kSP0uTdrFTzpRBD2U400r5gCKncS3BDNNM4GLZ+5q7cJW0J7JMkyth3M4EzEoOmCe X-Received: by 2002:a17:906:5a54:b0:7c0:eba2:f9dd with SMTP id my20-20020a1709065a5400b007c0eba2f9ddmr22118297ejc.53.1671033487782; Wed, 14 Dec 2022 07:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671033487; cv=none; d=google.com; s=arc-20160816; b=Yz7c63AsOorVqvZw3t0/dLyfijiW52llebo7HWajCga+vJfTgo+RqJ+FqQt0zm3VEw K0YlYQPOlpsR+7Ix84I/c6n8TqPK2xuJk8C0uVpj+RDU+DTFlyoKTnUgYgiO1Aa6zrjg Q8f+vO+wXuf/D2CxegFpp0NFW/850P1H85NiblrS36DC9ldm/0d3zUcNOrHaVoR4FwYn ord7amRYyHRnOvX0+e+tuPcgtCCcatfh9aC5VqfICu1lOr78tJWLdXmuv5Xw0yQEU6Fm 3buxkcyi6VcF20YkGhMm1nY8uAzqB0+Rscu03GXRMpfxLIMSoAfLIHL2qPz0t/ZZnm7d n2lg== 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=pyBUH3WX+Oy1sPUYcOHZQQujYgyDt0tZIAPGgn38vpc=; b=yO8Z0jxARvxzMj7yUE363wdbO8CsMTixZepPTE6EEgNsihdfRktOptgrdi4EbUvBYR j1vsfZJztiq361ywWxrYRy8SEIYz8OB5NlWGdEO0WVbQ/GGFEjXAUJVcsf0HUg+pws6Q rEebMJ7TYDGYbMH2VJO2D+b+42snjziR2OuTo5AllLCR116aPW7XdWXkFmw46GGLVYZi zVXiNUftrikVSW/Jo7J0rUV4qLd/1MCPwAxxVI670hpEUhMjplE+dJytJYPVr5wdj0ti a4u31bxWJo40d7f1lI4sY6UBYJDYxeikkeWieaow1NzwPJvYx/h4KHgZC8EGiGG/QGDx FZAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j+ECA3Ob; 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 o22-20020a170906975600b007c122a9ba98si12213018ejy.685.2022.12.14.07.57.50; Wed, 14 Dec 2022 07:58:07 -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=j+ECA3Ob; 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 S238795AbiLNPZR (ORCPT + 69 others); Wed, 14 Dec 2022 10:25:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238370AbiLNPZO (ORCPT ); Wed, 14 Dec 2022 10:25:14 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F09EAE73; Wed, 14 Dec 2022 07:25:13 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id kw15so45303436ejc.10; Wed, 14 Dec 2022 07:25:13 -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=pyBUH3WX+Oy1sPUYcOHZQQujYgyDt0tZIAPGgn38vpc=; b=j+ECA3ObDcDwKZ/gOsVb6iqxOmK9c6mpjTRYn8FOVx+iVAlCV+OW4eWgiSwyDFfL/d Kykb62y2LxaSy24jDd96VaD1OfZgYM3RUnvek60Mcwtws83ya0qExR1LXyWdYvh5xeJC o1BFo/vtUXtqvvMkXMnDsUeJSj6AXNgtOMT6QhupxaxvdkMkXaE53F7xZu8ROLEky59A w6Cw+alGPhNWOUdEvMP5chTSzc2oQPV+6Ry0uDuLIg9lzHKhc1R5WBDGTIMu4ymNSw7H 4d8PEsVGfitbyKdyLRtA1Q6gn38CR722NG5b/ctbp60rU2B/ZgOSflKcwNpQEmg9jrhw bokw== 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=pyBUH3WX+Oy1sPUYcOHZQQujYgyDt0tZIAPGgn38vpc=; b=1PQuge9f3ZAxe7PSXyB4u6P+sDrYQK/3PBNuau7qlewiWd9W6wa3OrpSxjh/7dCkHz pjkUyOwsQIhyIIGs1A1+EGF9uo8dton4FXHsYbbSMWf+V+QRQAX9TSlXwoVsabwqie7Y e4H37oe40YVcVlMCWt9OzipbmIZT4QpvnPSWFkOlR7iew/xR9rYCvqrxZPlusttS6z9h e7MA1AN486r3rCrsKlJPDsOWUeX9C40eL24jM0RqkX/qt6Za5lQl+OP2w8vgygZ/qxmj 6dikiCM2nf32iIk1UFtBnMetAghtYZcaUL5ob+MwC5n30kJwSZy45G/KlyGTNyaQEsKp iA8Q== X-Gm-Message-State: ANoB5plb5CRPxuFVo+OY42JgIxYQEpl1OGkPYHKLUn222Hl12x1D1bbU PUtW72a8f7Sj/DG5Lso4C9q9Fkj8/my9hunhM/0= X-Received: by 2002:a17:906:4792:b0:7c1:3e9e:adc0 with SMTP id cw18-20020a170906479200b007c13e9eadc0mr1260307ejc.312.1671031511829; Wed, 14 Dec 2022 07:25:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Palmas Date: Wed, 14 Dec 2022 16:18:12 +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 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