NetBSD Problem Report #35041

From dieter.NetBSD@pandora.be  Sun Nov 12 15:02:37 2006
Return-Path: <dieter.NetBSD@pandora.be>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 781B963B400
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 12 Nov 2006 15:02:37 +0000 (UTC)
Message-Id: <20061112150346.5275217826@simult.amelgem.be>
Date: Sun, 12 Nov 2006 16:03:46 +0100 (CET)
From: dieter.NetBSD@pandora.be
Reply-To: dieter.NetBSD@pandora.be
To: gnats-bugs@NetBSD.org
Subject: RealTek 8168B broken.
X-Send-Pr-Version: 3.95

>Number:         35041
>Category:       kern
>Synopsis:       RealTek 8168B broken.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    tsutsui
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 12 15:05:00 +0000 2006
>Closed-Date:    Sun Nov 12 15:13:50 +0000 2006
>Last-Modified:  Sun Nov 12 15:15:06 +0000 2006
>Originator:     dieter roelants
>Release:        NetBSD 4.99.3
>Organization:
>Environment:
System: NetBSD simult.amelgem.be 4.99.3 NetBSD 4.99.3 (GENERIC.MPACPI) #8: Sun Nov 12 11:37:55 CET 2006 dieter@simult.amelgem.be:/build/obj.i386.current/sys/arch/i386/compile/GENERIC.MPACPI i386
Architecture: i386
Machine: i386
re0 at pci3 dev 0 function 0: RealTek 8168B/8111B Gigabit Ethernet
>Description:
	My on-board RealTek 8168B doesn't work anymore in -current.
	Incoming packets are shifted 2 bytes. This is easy to see
	by running tcpdump while trying to get an IP address with
	dhclient:
15:13:13.010463 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:f2:d9:18:19, length: 300
15:13:13.017757 20:20:ab:b4:08:00 > f2:d9:18:19:08:00, ethertype Unknown (0x4510)

	I had the same problem (PR 33763) a few months ago. It was
	fixed by changing RTK_ETHER_ALIGN on i386 and amd64. This
	fix is still there, but it's now called RE_ETHER_ALIGN (and
	now __NO_STRICT_ALIGNMENT is checked instead of the port).

	It seems that not all instances of RTK_ETHER_ALIGN where
	renamed or maybe the RTK_ETHER_ALIGN definition needs to
	be in the ifdef? I can make my nic work again with the
	patch below. I have no clue if it breaks anything.
>How-To-Repeat:
	Boot a current kernel with this nic.
>Fix:
Index: rtl8169.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rtl8169.c,v
retrieving revision 1.59
diff -u -r1.59 rtl8169.c
--- rtl8169.c	12 Nov 2006 03:09:37 -0000	1.59
+++ rtl8169.c	12 Nov 2006 14:55:36 -0000
@@ -1044,8 +1044,8 @@
 	 * alignment so that the frame payload is
 	 * longword aligned.
 	 */
-	m->m_len = m->m_pkthdr.len = MCLBYTES - RTK_ETHER_ALIGN;
-	m->m_data += RTK_ETHER_ALIGN;
+	m->m_len = m->m_pkthdr.len = MCLBYTES - RE_ETHER_ALIGN;
+	m->m_data += RE_ETHER_ALIGN;

 	rxs = &sc->re_ldata.re_rxsoft[idx];
 	map = rxs->rxs_dmamap;

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->tsutsui
Responsible-Changed-By: tsutsui@netbsd.org
Responsible-Changed-When: Mon, 13 Nov 2006 00:13:50 +0900
Responsible-Changed-Why:
My bug.


State-Changed-From-To: open->closed
State-Changed-By: tsutsui@netbsd.org
State-Changed-When: Mon, 13 Nov 2006 00:13:50 +0900
State-Changed-Why:
Fix applied. Thanks.
Note RTK_ETHER_ALIGN is used in rtl81x9.c for rtk(4).


From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35041 CVS commit: src/sys/dev/ic
Date: Sun, 12 Nov 2006 15:12:02 +0000 (UTC)

 Module Name:	src
 Committed By:	tsutsui
 Date:		Sun Nov 12 15:12:02 UTC 2006

 Modified Files:
 	src/sys/dev/ic: rtl8169.c

 Log Message:
 Replace RTK_ETHER_ALIGN with RE_ETHER_ALIGN, which I missed.
 Pointed out by dieter roelants in PR kern/35041.


 To generate a diff of this commit:
 cvs rdiff -r1.60 -r1.61 src/sys/dev/ic/rtl8169.c

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.