Module Name:    src
Committed By:   msaitoh
Date:           Fri Oct 12 10:38:06 UTC 2012

Modified Files:
        src/sys/dev/marvell: if_mvgbe.c mvgbereg.h

Log Message:
- 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).


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/marvell/if_mvgbe.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/marvell/mvgbereg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.22 src/sys/dev/marvell/if_mvgbe.c:1.23
--- src/sys/dev/marvell/if_mvgbe.c:1.22	Thu Oct  4 14:21:00 2012
+++ src/sys/dev/marvell/if_mvgbe.c	Fri Oct 12 10:38:06 2012
@@ -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 @@ mvgbe_rxeof(struct mvgbe_softc *sc)
 			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 @@ mvgbe_rxeof(struct mvgbe_softc *sc)
 			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 @@ mvgbe_rxeof(struct mvgbe_softc *sc)
 			}
 			m->m_pkthdr.csum_flags = flgs;
 		}
-sw_csum:
 
 		/*
 		 * Try to allocate a new jumbo buffer. If that

Index: src/sys/dev/marvell/mvgbereg.h
diff -u src/sys/dev/marvell/mvgbereg.h:1.4 src/sys/dev/marvell/mvgbereg.h:1.5
--- src/sys/dev/marvell/mvgbereg.h:1.4	Thu Oct  4 14:21:00 2012
+++ src/sys/dev/marvell/mvgbereg.h	Fri Oct 12 10:38:06 2012
@@ -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 @@ struct mvgbe_rx_desc {
 #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_ */

Reply via email to