Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1755454ybh; Sun, 8 Mar 2020 12:08:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtxWBbCbOfEANCEWW/lNi8MIiBaU4MYs0xbQHXB+trXy+BT55vw8r/wUT9riBN52Yo5ZugU X-Received: by 2002:aca:ded4:: with SMTP id v203mr7222178oig.19.1583694534469; Sun, 08 Mar 2020 12:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583694534; cv=none; d=google.com; s=arc-20160816; b=XOKBHAg2D5UG5nOVI/iJEaRQAU4knJxrycX9qEK4G6qN1zJpW4Gj1TfkRuLVJNmRNu NFj0I9oSDWYXzoVelpSKWTg+OE8UHguwoZn3oeSq8qhiNJ1sqOkCs8aR98aJbk5qI5LO iBizbbF30sRxCf/TezKFcJOgiCioevzdFlKHYpItpg7xhHyuJ2lcJDfTmD1wyotKPkOX AMS1geqb+2pw6sGCSO04mmU8Jg7ZjPUsf87jKxH1UnzYXM6v7fFR8rvESu1v6K43COvz iwA/F9V/h84i46+qMf4J4oA3cSf+28zJhriHsKDfTEemlkpkiX0Ujs3n/3ijr4bc265r xXow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=q9gIS4U5Axb2UV/TlkmoKYkwkraygD1wbePWfXVPOcw=; b=d0piipc7uQAMmIkkFuLS/0OEUpeAm7nVZTO1MkHtRgcmT7TL6G+p5j8xoJMip/cFNi Tdolkoyt9ylNw//pCYGvuRdyfTijlKUJ6fuL5I1lF3wra6z1imAuSZzGrx8oQo2Cb/+Q NoaBzUhLTcerEvl047OpcuU34nVactrpexBAhqETre9n6rwVgVHbg6G2BsAaJwPV6AHe uOBXRrvKfAzFp2bGMoEXpRXUDAOnesWdS23qm3OXCrtngIAbdVvfdGKTHNg/FEY2/gdH eepDiUjb8EMCeHeYVSG+kOEVVuq64TX00Cko0sv96kxbWtGn8M0/Kwr8dkHgJECi+/Qd /5Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TXKCEnly; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si5187344ots.79.2020.03.08.12.08.29; Sun, 08 Mar 2020 12:08:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TXKCEnly; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726359AbgCHTH6 (ORCPT + 99 others); Sun, 8 Mar 2020 15:07:58 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:33242 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbgCHTH6 (ORCPT ); Sun, 8 Mar 2020 15:07:58 -0400 Received: by mail-qt1-f196.google.com with SMTP id d22so5559532qtn.0; Sun, 08 Mar 2020 12:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=q9gIS4U5Axb2UV/TlkmoKYkwkraygD1wbePWfXVPOcw=; b=TXKCEnlyU80n3IUULzxYxQ2QaUidkrNMG/2yUohwmHP1jwU6PTB0LHc5q4Zl3UHH9z QX7NilsZjqIK0N/bUVHtKQG/GmA20luiyPSe0MWh9cfPjS0702OICJQCHhKPe0aHL88C IzJDs6BqN/SiyMYk5F+3JdV+GZ2DiWtcgmKQErxNJ/27daMjFZ9BtJbM6hs0ug5UgGxV 9qcCRsIzI4k2umhRSrZOIjMSzQpy8w2ukAZBxqYb+1H0X+7qNODMxTVR4ah2TjETANVr WOKvssAWJVwWvRzNsRmX3+IswTN4jqW+Tp1vTUnED9Gavt8stfaSz1TRgFXf4uCtDVMH Ip5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=q9gIS4U5Axb2UV/TlkmoKYkwkraygD1wbePWfXVPOcw=; b=Sw0cA4cIJaH9wk11r5nlOu/qUC5nOA5W15KaMPxpvnflKWJYoDAoRRnf2p3sab0U2J 3V+OxOnfS/KKffwpJd1GRu+RlsRfeRUGmy5FUgVfqixvOuPUJWhvZak4IcenfJtnGq2i kpAQooHW1M9wmrRyoysYYhat0P4XBWibhhhWz2vCBklOuu/sLY9P5Xb747tTLa7oBcIL 4cXHuc8Pdvrp/qO2wTKQJAn+nkZVa85T4W/nekyacuiY4b3TF7Ej4RmmIsFCpqk9TZKV AWDfxLZbO2e+UdNcWuUBcxmXO4Bq0+Wi5yt51Sgo5y7mFrMeDGShsbJ1VBlNW4jZ6m10 KT1w== X-Gm-Message-State: ANhLgQ16OS8pRY2NeI5TmectKonLny+cWwZ45S6M8Lk036B7F45WdxVK cEdV9m73kS9AupGR1GAx2EpiNJ5cQQRshAq20UM= X-Received: by 2002:ac8:4d1c:: with SMTP id w28mr12051926qtv.48.1583694476930; Sun, 08 Mar 2020 12:07:56 -0700 (PDT) MIME-Version: 1.0 References: <87wo7una02.fsf@miraculix.mork.no> In-Reply-To: <87wo7una02.fsf@miraculix.mork.no> From: Daniele Palmas Date: Sun, 8 Mar 2020 20:07:46 +0100 Message-ID: Subject: Re: [PATCH] net: usb: qmi_wwan: Fix for packets being rejected in the ring buffer used by the xHCI controller. To: =?UTF-8?Q?Bj=C3=B8rn_Mork?= Cc: Paul Gildea , "davem@davemloft.net" , "netdev@vger.kernel.org" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bj=C3=B8rn and Paul, Il giorno dom 8 mar 2020 alle ore 16:28 Bj=C3=B8rn Mork ha = scritto: > > Paul Gildea writes: > > > When MTU of modem is set to less than 1500 and a packet larger than MTU > > arrives in Linux from a modem, it is discarded with -EOVERFLOW error > > (Babble error). This is seen on USB3.0 and USB2.0 busses. This is > > essentially because the MRU (Max Receive Size) is not a separate entity= to > > the MTU (Max Transmit Size) and the received packets can be larger than > > those transmitted. Following the babble error there were an endless sup= ply > > of zero-length URBs which are rejected with -EPROTO (increasing the rx > > input error counter each time). This is only seen on USB3.0. These cont= inue > > to come ad infinitum until the modem is shutdown, rendering the modem > > unusable. There is a bug in the core USB handling code in Linux that > > doesn't deal well with network MTUs smaller than 1500 bytes. By default= the > > dev->hard_mtu (the "real" MTU) is in lockstep with dev->rx_urb_size > > (essentially an MRU), and it's the latter that 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 gre= ater > > than 1406. > > > > Signed-off-by: Paul Gildea > > --- > > 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 5754bb6..545c772 100644 > > --- a/drivers/net/usb/qmi_wwan.c > > +++ b/drivers/net/usb/qmi_wwan.c > > @@ -815,6 +815,13 @@ static int qmi_wwan_bind(struct usbnet *dev, struc= t > > usb_interface *intf) > > } > > dev->net->netdev_ops =3D &qmi_wwan_netdev_ops; > > dev->net->sysfs_groups[0] =3D &qmi_wwan_sysfs_attr_group; > > + /* LTE Networks don't always respect their own MTU on receive side= ; > > + * e.g. AT&T pushes 1430 MTU but still allows 1500 byte packets fro= m > > + * far-end network. Make 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 =3D ETH_DATA_LEN + 4; Isn't this going to break the change MTU workaround for dl data aggregation when using qmap? Regards, Daniele > > err: > > return status; > > } > > -- > > 1.9.1 > > > This is fine as a first step towards saner buffer handling in qmi_wwan. > If real world devices use asymmetric MTUs, then we should just deal with > that. > > So I was going to add my ack. But the patch does not apply: > > > bjorn@miraculix:/usr/local/src/git/linux$ git am /tmp/l > Applying: net: usb: qmi_wwan: Fix for packets being rejected in the ring= buffer used by the xHCI controller. > error: corrupt patch at line 10 > > and checkpatch says why: > > bjorn@miraculix:/usr/local/src/git/linux$ scripts/checkpatch.pl /tmp/l > ERROR: patch seems to be corrupt (line wrapped?) > #34: FILE: drivers/net/usb/qmi_wwan.c:814: > usb_interface *intf) > > > Could you fix up and resend? You might have to use a different email > client. See > https://www.kernel.org/doc/html/latest/process/email-clients.html#email-c= lients > > > Bj=C3=B8rn