LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Georgi Valkov <gvalkov@abv.bg>
To: Jakub Kicinski <kuba@kernel.org>
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
Subject: Re: ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback
Date: Tue, 20 Jul 2021 14:39:49 +0300	[thread overview]
Message-ID: <5D0CFF83-439B-4A10-A276-D2D17B037704@abv.bg> (raw)
In-Reply-To: <20210720122215.54abaf53@cakuba>

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’t 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#providing-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=auto --cover-letter -o drivers/net/ master


drivers/net/0000-cover-letter.patch

From cd18496373e28af570dc382f618edd442d705252 Mon Sep 17 00:00:00 2001
From: Georgi Valkov <gvalkov@abv.bg>
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
-- 
2.32.0


drivers/net/0001-ipheth-fix-EOVERFLOW-in-ipheth_rcvbulk_callback.patch

From cd18496373e28af570dc382f618edd442d705252 Mon Sep 17 00:00:00 2001
From: Georgi Valkov <gvalkov@abv.bg>
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 <gvalkov@abv.bg>
---
 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 == NULL)
 		goto free_rx_urb;
 
-	rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
+	rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
 				    GFP_KERNEL, &rx_urb->transfer_dma);
 	if (rx_buf == NULL)
 		goto free_tx_buf;
@@ -146,7 +146,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
 
 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)
 
 	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 |= URB_NO_TRANSFER_DMA_MAP;
-- 
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=f33d9e2b48a34e1558b67a473a1fc1d6e793f93c



> On 2021-07-20, at 1:22 PM, Jakub Kicinski <kuba@kernel.org> wrote:
> 
> 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
>> 
>> 
>> From dd109ded2b526636fff438d33433ab64ffd21583 Mon Sep 17 00:00:00 2001
>> From: Georgi Valkov <gvalkov@abv.bg>
>> Date: Fri, 16 Apr 2021 20:44:36 +0300
>> Subject: [PATCH] ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback
> 
> 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).
> 


  reply	other threads:[~2021-07-20 11:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  9:37 Georgi Valkov
2021-07-20  9:58 ` Greg KH
2021-07-20 10:22 ` Jakub Kicinski
2021-07-20 11:39   ` Georgi Valkov [this message]
2021-07-20 11:49     ` Greg KH
2021-07-20 12:46       ` Georgi Valkov
2021-07-20 12:54         ` Greg KH
2021-07-20 13:12           ` Georgi Valkov
2022-01-31  9:45             ` Jan Kiszka
2022-01-31 17:27               ` Jakub Kicinski
2022-01-31 17:35                 ` Jan Kiszka
2022-01-31 17:47                   ` Jakub Kicinski
2022-01-31 18:46                     ` Jan Kiszka
2022-01-31 21:43                   ` Georgi Valkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D0CFF83-439B-4A10-A276-D2D17B037704@abv.bg \
    --to=gvalkov@abv.bg \
    --cc=corsac@corsac.net \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=matti.vuorela@bitfactor.fi \
    --cc=mhabets@solarflare.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=snelson@pensando.io \
    --cc=stable@vger.kernel.org \
    --subject='Re: ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).