Subject: kern/31323: vge on !i386 is broken.
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <mrt@notwork.org>
List: netbsd-bugs
Date: 09/15/2005 18:39:00
>Number:         31323
>Category:       kern
>Synopsis:       vge on !i386 is broken.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 15 18:39:00 +0000 2005
>Originator:     mrt@notwork.org
>Release:        NetBSD 3.99.8
>Organization:
>Environment:
System: NetBSD fons-adae 3.99.8 NetBSD 3.99.8 (WILLIAM) #63: Fri Sep 16 03:02:52 JST 2005 mrt@fons-adae:/sys/arch/amd64/compile/WILLIAM amd64
Architecture: x86_64
Machine: amd64
>Description:
On !i386 environment, first 2 bytes of all ether frames from vge will be chopped.
>How-To-Repeat:
Use vge with !i386.
>Fix:
Although I'm not sure that following patch is correct fix, I can use vge on
amd64 with the patch:

Index: if_vge.c
===================================================================
RCS file: /home/mrt/src/netbsdcvs/src/sys/dev/pci/if_vge.c,v
retrieving revision 1.6
diff -u -r1.6 if_vge.c
--- if_vge.c	8 Sep 2005 18:18:10 -0000	1.6
+++ if_vge.c	15 Sep 2005 18:02:24 -0000
@@ -1157,7 +1157,7 @@
 	for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++)
 		*dst++ = *src++;
 
-	m->m_data -= ETHER_ALIGN;
+	m->m_data -= sizeof(uint16_t);
 
 	return;
 }