All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dean Jenkins <Dean_Jenkins@mentor.com>
To: netdev@vger.kernel.org, davem@davemloft.net
Subject: [PATCH 4/4] asix: C1 DUB-E100 double rx_urb_size to 4096
Date: Wed, 11 Dec 2013 10:50:28 +0000	[thread overview]
Message-ID: <1386759028-3534-5-git-send-email-Dean_Jenkins@mentor.com> (raw)
In-Reply-To: <1386759028-3534-1-git-send-email-Dean_Jenkins@mentor.com>

It seems that for the C1 hardware variant of the D-Link DUB-E100
that the rx_urb_size of 2048 is truncating IP fragmented packets due
to multiple Ethernet frames being present in a single URB.

A simple ping test shows a loss of ping responses
ping 172.17.0.10 -f -c 200 -s 1965
(172.17.0.1 is the IP address of the target)

In the worse case, this test requires a 2049 byte data buffer size
to hold the IN bulk transfer but the URB is 2048 in size so the last byte
of the Ethernet frame is lost and the Ethernet frame is truncated.

This modification resolves "asix_rx_fixup() Bad Header" errors caused by
truncation of the Ethernet frame due to the URB buffer being too small.

Therefore, increase the rx_urb_size to 4096 to accommodate
multiple Ethernet frames being present in a single URB.

Signed-off-by: Dean Jenkins <Dean_Jenkins@mentor.com>
---
 drivers/net/usb/asix_devices.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 37de7db..cee3f8c 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -492,7 +492,10 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
 	if (dev->driver_info->flags & FLAG_FRAMING_AX) {
 		/* hard_mtu  is still the default - the device does not support
 		   jumbo eth frames */
-		dev->rx_urb_size = 2048;
+		/* Increased to 4K for the C1 DUB-E100 to avoid
+		 * "asix_rx_fixup() Bad Header" errors because the 2K
+		 * urb buffer was too small which caused frame truncation */
+		dev->rx_urb_size = 4096;
 	}
 
 	dev->driver_priv = kzalloc(sizeof(struct asix_common_private), GFP_KERNEL);
-- 
1.7.9.5

  parent reply	other threads:[~2013-12-11 10:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 10:50 [PATCH 0/4] asix: Fix support for C1 DUB-E100 Dean Jenkins
2013-12-11 10:50 ` [PATCH 1/4] asix: Rename remaining and size for clarity Dean Jenkins
2013-12-11 10:50 ` [PATCH 2/4] asix: Tidy-up asix_rx_fixup_internal() logic Dean Jenkins
2013-12-11 10:50 ` [PATCH 3/4] asix: On RX avoid creating bad Ethernet frames Dean Jenkins
2013-12-11 10:50 ` Dean Jenkins [this message]
2013-12-11 11:30   ` [PATCH 4/4] asix: C1 DUB-E100 double rx_urb_size to 4096 David Laight
2013-12-11 12:28     ` Dean Jenkins
2013-12-11 12:45       ` David Laight
2013-12-11 15:13     ` Eric Dumazet
2013-12-11 16:28       ` David Laight

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=1386759028-3534-5-git-send-email-Dean_Jenkins@mentor.com \
    --to=dean_jenkins@mentor.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.