Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/marvell - The MVGBE_RX_MAX_FRAME_LEN_ERROR bit is us...
details: https://anonhg.NetBSD.org/src/rev/f5c6ec115bc3
branches: trunk
changeset: 781993:f5c6ec115bc3
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Oct 12 10:38:06 2012 +0000
description:
- The MVGBE_RX_MAX_FRAME_LEN_ERROR bit is used to check whether a packet
is fragmented or not, so define new MVGBE_RX_IP_FRAGMENT with the same
value and use it.
- Remove the checking whether a packet length is lower than 72 octet.
This check is not used in Linux and FreeBSD. Tested with me (for Kirkwood)
and Kiyohara (for DiscoveryII).
diffstat:
sys/dev/marvell/if_mvgbe.c | 11 +++--------
sys/dev/marvell/mvgbereg.h | 4 +++-
2 files changed, 6 insertions(+), 9 deletions(-)
diffs (62 lines):
diff -r 51ded7191beb -r f5c6ec115bc3 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c Fri Oct 12 02:37:20 2012 +0000
+++ b/sys/dev/marvell/if_mvgbe.c Fri Oct 12 10:38:06 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mvgbe.c,v 1.22 2012/10/04 14:21:00 msaitoh Exp $ */
+/* $NetBSD: if_mvgbe.c,v 1.23 2012/10/12 10:38:06 msaitoh Exp $ */
/*
* Copyright (c) 2007, 2008 KIYOHARA Takashi
* All rights reserved.
@@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.22 2012/10/04 14:21:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.23 2012/10/12 10:38:06 msaitoh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -1741,9 +1741,6 @@
continue;
}
- if (total_len <= MVGBE_RX_CSUM_MIN_BYTE) /* XXX documented? */
- goto sw_csum;
-
if (rxstat & MVGBE_RX_IP_FRAME_TYPE) {
int flgs = 0;
@@ -1751,8 +1748,7 @@
flgs |= M_CSUM_IPv4;
if (!(rxstat & MVGBE_RX_IP_HEADER_OK))
flgs |= M_CSUM_IPv4_BAD;
- else if ((bufsize & MVGBE_RX_MAX_FRAME_LEN_ERROR)
- == 0) {
+ else if ((bufsize & MVGBE_RX_IP_FRAGMENT) == 0) {
/*
* Check TCPv4/UDPv4 checksum for
* non-fragmented packet only.
@@ -1775,7 +1771,6 @@
}
m->m_pkthdr.csum_flags = flgs;
}
-sw_csum:
/*
* Try to allocate a new jumbo buffer. If that
diff -r 51ded7191beb -r f5c6ec115bc3 sys/dev/marvell/mvgbereg.h
--- a/sys/dev/marvell/mvgbereg.h Fri Oct 12 02:37:20 2012 +0000
+++ b/sys/dev/marvell/mvgbereg.h Fri Oct 12 10:38:06 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mvgbereg.h,v 1.4 2012/10/04 14:21:00 msaitoh Exp $ */
+/* $NetBSD: mvgbereg.h,v 1.5 2012/10/12 10:38:06 msaitoh Exp $ */
/*
* Copyright (c) 2007 KIYOHARA Takashi
* All rights reserved.
@@ -431,4 +431,6 @@
#define MVGBE_RX_ENABLE_INTERRUPT (1 << 29)
#define MVGBE_RX_L4_CHECKSUM_OK (1 << 30)
+#define MVGBE_RX_IP_FRAGMENT (1 << 2)
+
#endif /* _MVGEREG_H_ */
Home |
Main Index |
Thread Index |
Old Index