Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4472945pxv; Tue, 20 Jul 2021 04:41:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQMOCuTHmuB6L+cCmE06wPa8bWsWMOXit81rVs5Gxg4hP6M+CRpkmydoWJlcsmwqbK0ZhX X-Received: by 2002:a05:6602:2406:: with SMTP id s6mr17206460ioa.159.1626781289755; Tue, 20 Jul 2021 04:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626781289; cv=none; d=google.com; s=arc-20160816; b=G9Ms3YNRh3IT/9qoPPe9jC8GMtDjVrLIySRPMdzeThroiSyUIgEG3t3GUu6KRdvFsV rZZnFZvwfrkLFx3KwVb/D91k5+XOfI1KAmOgc1+Cx0HQg7yGTYKuA6hq7EVzi06lYRvE gI80sl1hcqhnU1oQHfv5kgAFf2nZ+XB2w3ITFx4w2a3pKuJhT//TjaR7SVncslMedBzS bfiygAh4GjTNiHzueHvVH9cHHh2UVkJBqLyFQWJM072YtcDaWiMORGEcDupg9GCOFNPH hF8I+RUlQNREmwDxfz/uOub63kb3lByzvOp7NW43QVdtFFeXya8cJP1+z3uTJvbbvNNz 3q3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=dD4UUjFyJU+H/nb01M25DvrioANn5x42FGEb+GYWFec=; b=SnEHQU90sdOtrbPi7m9f7hVY58xYj5vsc6F47/lHEY1Dj7eC1Syr5tDZ+X2Ipao+HL YUtGAgsFTzYXCpvaBlsAbbNSqzdD0BdoA5YgY/3dXk87pS3Hvdq6B2neFayAAoFcOs8i kZalarf7TRE9AZWAR4rqoBiUEhF813eJVGLHpR0N6zD/ieTFQXtze3/su3RCk5k5XqiH ch01+rhOUo46PXU8goKr0H1vPknJuWxQZsVV+K2bPs9hTA8zVCwWNaFHoj3iLlIIyHp7 McWwSnKMNbtMELVTMQxtWzHKCzA54LW+Ee9D3Awm4jQoeMFYH5aEIJsdZYXxPXNwlrf4 CAeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@abv.bg header.s=smtp-out header.b=YpDAr2e9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=abv.bg Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si21553911iot.101.2021.07.20.04.41.18; Tue, 20 Jul 2021 04:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@abv.bg header.s=smtp-out header.b=YpDAr2e9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=abv.bg Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236474AbhGTK73 (ORCPT + 99 others); Tue, 20 Jul 2021 06:59:29 -0400 Received: from pop31.abv.bg ([194.153.145.221]:39728 "EHLO pop31.abv.bg" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233914AbhGTK7X (ORCPT ); Tue, 20 Jul 2021 06:59:23 -0400 Received: from smtp.abv.bg (localhost [127.0.0.1]) by pop31.abv.bg (Postfix) with ESMTP id 76F091805D3B; Tue, 20 Jul 2021 14:39:58 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=abv.bg; s=smtp-out; t=1626781198; bh=dD4UUjFyJU+H/nb01M25DvrioANn5x42FGEb+GYWFec=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=YpDAr2e9D4CHrBEEh8SvLFnRo/6hoaj61G3Zd5Fy330sn60N1DnTqgq/67pmkceLz tFX562mWxO9Kx1Hqj9C+K73CzCqHevqyvaWo7Np48reZiFHTcQldLl6VPWldDAElmc 6jQisT3nxYJQNSgFUhkbTWFTaT83C9jZBmQwawok= X-HELO: smtpclient.apple Authentication-Results: smtp.abv.bg; auth=pass (plain) smtp.auth=gvalkov@abv.bg Received: from 212-39-89-148.ip.btc-net.bg (HELO smtpclient.apple) (212.39.89.148) by smtp.abv.bg (qpsmtpd/0.96) with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted); Tue, 20 Jul 2021 14:39:58 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback From: Georgi Valkov In-Reply-To: <20210720122215.54abaf53@cakuba> Date: Tue, 20 Jul 2021 14:39:49 +0300 Cc: davem@davemloft.net, mhabets@solarflare.com, luc.vanoostenryck@gmail.com, snelson@pensando.io, mst@redhat.com, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, corsac@corsac.net, matti.vuorela@bitfactor.fi, stable@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <5D0CFF83-439B-4A10-A276-D2D17B037704@abv.bg> References: <20210720122215.54abaf53@cakuba> To: Jakub Kicinski X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am doing this for the first time, so any help would be appreciated! What is to rebase on the netdev/net tree? The patch from my previous = e-mail was generated by `git format-patch -1`. I can=E2=80=99t notice any = difference when compared to to the newly generated patch, which I rebased on the latest master. According to the description from the link below, I ran the following = commands: = https://www.kernel.org/doc/html/latest/process/submitting-patches.html#pro= viding-base-tree-information git clone = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git cd linux git checkout -t -b ipheth-fix-RX-EOVERFLOW master git am --signoff < = 0001-ipheth-fix-EOVERFLOW-in-ipheth_rcvbulk_callback.patch git format-patch --base=3Dauto --cover-letter -o drivers/net/ master drivers/net/0000-cover-letter.patch =46rom cd18496373e28af570dc382f618edd442d705252 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Tue, 20 Jul 2021 14:15:58 +0300 Subject: [PATCH 0/1] *** SUBJECT HERE *** *** BLURB HERE *** Georgi Valkov (1): ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback drivers/net/usb/ipheth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) base-commit: 2734d6c1b1a089fb593ef6a23d4b70903526fe0c --=20 2.32.0 drivers/net/0001-ipheth-fix-EOVERFLOW-in-ipheth_rcvbulk_callback.patch =46rom cd18496373e28af570dc382f618edd442d705252 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Fri, 16 Apr 2021 20:44:36 +0300 Subject: [PATCH 1/1] ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback When rx_buf is allocated we need to account for IPHETH_IP_ALIGN, which reduces the usable size by 2 bytes. Otherwise we have 1512 bytes usable instead of 1514, and if we receive more than 1512 bytes, ipheth_rcvbulk_callback is called with status -EOVERFLOW, after which the driver malfunctiones and all communication stops. Fixes: ipheth 2-1:4.2: ipheth_rcvbulk_callback: urb status: -75 Signed-off-by: Georgi Valkov --- drivers/net/usb/ipheth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 207e59e74935..06d9f19ca142 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c @@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device = *iphone) if (tx_buf =3D=3D NULL) goto free_rx_urb; =20 - rx_buf =3D usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, + rx_buf =3D usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + = IPHETH_IP_ALIGN, GFP_KERNEL, &rx_urb->transfer_dma); if (rx_buf =3D=3D NULL) goto free_tx_buf; @@ -146,7 +146,7 @@ static int ipheth_alloc_urbs(struct ipheth_device = *iphone) =20 static void ipheth_free_urbs(struct ipheth_device *iphone) { - usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + = IPHETH_IP_ALIGN, iphone->rx_buf, iphone->rx_urb->transfer_dma); usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, iphone->tx_urb->transfer_dma); @@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device = *dev, gfp_t mem_flags) =20 usb_fill_bulk_urb(dev->rx_urb, udev, usb_rcvbulkpipe(udev, dev->bulk_in), - dev->rx_buf, IPHETH_BUF_SIZE, + dev->rx_buf, IPHETH_BUF_SIZE + = IPHETH_IP_ALIGN, ipheth_rcvbulk_callback, dev); dev->rx_urb->transfer_flags |=3D URB_NO_TRANSFER_DMA_MAP; --=20 2.32.0 My patch corrects the following commit, which changes IPHETH_BUF_SIZE = from 1516 to 1514: = https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/= drivers/net/usb/ipheth.c?id=3Df33d9e2b48a34e1558b67a473a1fc1d6e793f93c > On 2021-07-20, at 1:22 PM, Jakub Kicinski wrote: >=20 > On Tue, 20 Jul 2021 12:37:43 +0300, Georgi Valkov wrote: >> ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback >> https://github.com/openwrt/openwrt/pull/4084 >>=20 >>=20 >> =46rom dd109ded2b526636fff438d33433ab64ffd21583 Mon Sep 17 00:00:00 = 2001 >> From: Georgi Valkov >> Date: Fri, 16 Apr 2021 20:44:36 +0300 >> Subject: [PATCH] ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback >=20 > This is all unnecessary, IIUC you're submitting this patch for = upstream > inclusion, please rebase it on the netdev/net tree, and try git > send-email on a file generated by git format-patch. Before that please > correct the fixes tag to the common format (you'll find it in docs or > follow what others do). >=20