From: Ondrej Zary <linux@rainbow-software.org>
To: David Brownell <david-b@pacbell.net>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
netdev@vger.kernel.org,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] usbnet: do not count empty skbs as errors in rx_process()
Date: Fri, 10 Sep 2010 23:35:58 +0200 [thread overview]
Message-ID: <201009102336.00722.linux@rainbow-software.org> (raw)
In-Reply-To: <436709.64173.qm@web180305.mail.gq1.yahoo.com>
If rx_fixup() returns an empty skb (because it consumed all data inside), do
not count it as error.
This is needed for cx82310_eth. It also may allow other usbnet minidrivers'
rx_fixup() functions to be simplified (no need to leave the last packet in the
skb anymore).
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
The patch does not pass checkpatch.pl because the function calls match the
style used in usbnet.c.
--- linux-2.6.36-rc3-orig/drivers/net/usb/usbnet.c 2010-08-29 17:36:04.000000000 +0200
+++ linux-2.6.36-rc3/drivers/net/usb/usbnet.c 2010-09-10 20:10:10.000000000 +0200
@@ -387,17 +387,11 @@
{
if (dev->driver_info->rx_fixup &&
!dev->driver_info->rx_fixup (dev, skb))
- goto error;
- // else network stack removes extra byte if we forced a short packet
-
- if (skb->len)
- usbnet_skb_return (dev, skb);
- else {
- netif_dbg(dev, rx_err, dev->net, "drop\n");
-error:
dev->net->stats.rx_errors++;
- skb_queue_tail (&dev->done, skb);
- }
+ else if (skb->len)
+ return usbnet_skb_return (dev, skb);
+
+ skb_queue_tail (&dev->done, skb);
}
/*-------------------------------------------------------------------------*/
--
Ondrej Zary
next prev parent reply other threads:[~2010-09-10 21:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-04 21:52 [PATCH] usbnet: allow rx_process() to ignore packets Ondrej Zary
2010-09-04 23:24 ` David Brownell
2010-09-05 16:16 ` Ondrej Zary
2010-09-05 21:35 ` David Brownell
2010-09-07 20:02 ` Ondrej Zary
2010-09-10 21:35 ` Ondrej Zary [this message]
2010-09-11 19:07 ` [PATCH v2] usbnet: do not count empty skbs as errors in rx_process() David Brownell
2010-09-11 20:22 ` Ondrej Zary
2010-09-11 21:15 ` David Brownell
2010-09-11 21:21 ` Ondrej Zary
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=201009102336.00722.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=david-b@pacbell.net \
--cc=dbrownell@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--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.