Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/marvell Fix a bug that MVGBE_JLEN is miscalculated.



details:   https://anonhg.NetBSD.org/src/rev/28d5b9e3b9dd
branches:  trunk
changeset: 782600:28d5b9e3b9dd
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Nov 08 15:39:29 2012 +0000

description:
Fix a bug that MVGBE_JLEN is miscalculated.

diffstat:

 sys/dev/marvell/if_mvgbe.c |  7 ++++---
 sys/dev/marvell/mvgbereg.h |  4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 1dcece2db89b -r 28d5b9e3b9dd sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Thu Nov 08 15:25:01 2012 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Thu Nov 08 15:39:29 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvgbe.c,v 1.30 2012/11/08 14:37:47 msaitoh Exp $    */
+/*     $NetBSD: if_mvgbe.c,v 1.31 2012/11/08 15:39:29 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.30 2012/11/08 14:37:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.31 2012/11/08 15:39:29 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -93,7 +93,8 @@
 
 #define MVGBE_JSLOTS           384     /* XXXX */
 #define MVGBE_JLEN \
-    ((MVGBE_MRU + MVGBE_RXBUF_ALIGN) & ~MVGBE_RXBUF_MASK)
+    ((MVGBE_MRU + MVGBE_HWHEADER_SIZE + MVGBE_RXBUF_ALIGN - 1) & \
+    ~MVGBE_RXBUF_MASK)
 #define MVGBE_NTXSEG           30
 #define MVGBE_JPAGESZ          PAGE_SIZE
 #define MVGBE_RESID \
diff -r 1dcece2db89b -r 28d5b9e3b9dd sys/dev/marvell/mvgbereg.h
--- a/sys/dev/marvell/mvgbereg.h        Thu Nov 08 15:25:01 2012 +0000
+++ b/sys/dev/marvell/mvgbereg.h        Thu Nov 08 15:39:29 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvgbereg.h,v 1.6 2012/10/16 19:49:41 msaitoh Exp $     */
+/*     $NetBSD: mvgbereg.h,v 1.7 2012/11/08 15:39:30 msaitoh Exp $     */
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -348,7 +348,7 @@
  */
 #define MVGBE_MRU              9022
 
-#define MVGBE_RXBUF_ALIGN      8
+#define MVGBE_RXBUF_ALIGN      32      /* Cache line size */
 #define MVGBE_RXBUF_MASK       (MVGBE_RXBUF_ALIGN - 1)
 #define MVGBE_HWHEADER_SIZE    2
 



Home | Main Index | Thread Index | Old Index