From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 08/12] sky2: check drop truncated packets
Date: Mon, 09 Jul 2007 15:33:40 -0700 [thread overview]
Message-ID: <20070709223453.454111039@linux-foundation.org> (raw)
In-Reply-To: 20070709223332.966231494@linux-foundation.org
[-- Attachment #1: sky2-len-check.patch --]
[-- Type: text/plain, Size: 892 bytes --]
If packet larger than MTU is received, the driver uses hardware to
truncate the packet. Use the status registers to catch/drop them.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-07-09 15:30:12.000000000 -0700
+++ b/drivers/net/sky2.c 2007-07-09 15:30:12.000000000 -0700
@@ -2109,6 +2109,9 @@ static struct sk_buff *sky2_receive(stru
if (!(status & GMR_FS_RX_OK))
goto resubmit;
+ if (status >> 16 != length)
+ goto len_mismatch;
+
if (length < copybreak)
skb = receive_copy(sky2, re, length);
else
@@ -2118,6 +2121,11 @@ resubmit:
return skb;
+len_mismatch:
+ /* Truncation of overlength packets
+ causes PHY length to not match MAC length */
+ ++sky2->net_stats.rx_length_errors;
+
error:
++sky2->net_stats.rx_errors;
if (status & GMR_FS_RX_FF_OV) {
--
Stephen Hemminger <shemminger@linux-foundation.org>
next prev parent reply other threads:[~2007-07-09 22:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 22:33 [PATCH 00/12] sky2 driver updates for 2.6.23 Stephen Hemminger
2007-07-09 22:33 ` [PATCH 01/12] sky2: restore workarounds for lost interrupts Stephen Hemminger
2007-07-10 16:24 ` Jeff Garzik
2007-07-09 22:33 ` [PATCH 02/12] sky2: carrier management Stephen Hemminger
2007-07-09 22:33 ` [PATCH 03/12] sky2: debug interface Stephen Hemminger
2007-07-09 22:33 ` [PATCH 04/12] sky2: check for more work before leaving NAPI Stephen Hemminger
2007-07-09 22:33 ` [PATCH 05/12] sky2: receive fill Stephen Hemminger
2007-07-09 22:33 ` [PATCH 06/12] sky2: unmark as EXPERIMENTAL Stephen Hemminger
2007-07-09 22:33 ` [PATCH 07/12] sky2: add support for read/write of EEPROM Stephen Hemminger
2007-07-09 22:33 ` Stephen Hemminger [this message]
2007-07-09 22:33 ` [PATCH 09/12] sky2: use roundup() macro Stephen Hemminger
2007-07-09 22:33 ` [PATCH 10/12] sky2: use upper_32_bits() macro Stephen Hemminger
2007-07-09 22:33 ` [PATCH 11/12] sky2: remove some leftover debug messages Stephen Hemminger
2007-07-09 22:33 ` [PATCH 12/12] sky2: 1.16 version Stephen Hemminger
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=20070709223453.454111039@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=jgarzik@pobox.com \
--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 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).