summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-10-28 07:01:57 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-10-28 07:01:57 +0000
commitea6211d9f6cf0948dc6ebb1480801f9d4f7e446f (patch)
tree5f8b9dcf1974856e1dc29e0d4b1c26a7194c6963
parentc1f5077b2165057d6a2d33412681b3c74a917fb7 (diff)
Implement a workaround for stupid hw when using VLAN stripping. Frames
that are 64 bytes with a VLAN header appended like ARP frames or ICMP echos are flagged as runts when the tag is stripped. Issue mentioned by yongari@FreeBSD, info gleaned from the Linux driver.
-rw-r--r--sys/dev/pci/if_nge.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c
index 98ca3fe812e..4957f9ece16 100644
--- a/sys/dev/pci/if_nge.c
+++ b/sys/dev/pci/if_nge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nge.c,v 1.63 2008/10/28 05:04:32 brad Exp $ */
+/* $OpenBSD: if_nge.c,v 1.64 2008/10/28 07:01:56 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
@@ -1291,9 +1291,23 @@ nge_rxeof(sc)
* comes up in the ring.
*/
if (!(rxstat & NGE_CMDSTS_PKT_OK)) {
- ifp->if_ierrors++;
- nge_newbuf(sc, cur_rx, m);
- continue;
+#if NVLAN > 0
+ if ((rxstat & NGE_RXSTAT_RUNT) &&
+ total_len >= (ETHER_MIN_LEN - ETHER_CRC_LEN -
+ ETHER_VLAN_ENCAP_LEN)) {
+ /*
+ * Workaround a hardware bug. Accept runt
+ * frames if its length is larger than or
+ * equal to 56.
+ */
+ } else {
+#endif
+ ifp->if_ierrors++;
+ nge_newbuf(sc, cur_rx, m);
+ continue;
+#if NVLAN > 0
+ }
+#endif
}
/*