Subject: kern/22466: sip driver doesn't configure DP83815 chip to accept long frames
To: None <gnats-bugs@gnats.netbsd.org>
From: Valtteri Vuorikoski <vuori@puuhamaa.magenta.net>
List: netbsd-bugs
Date: 08/13/2003 16:06:01
>Number:         22466
>Category:       kern
>Synopsis:       sip driver doesn't configure DP83815 chip to accept long frames
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 13 13:07:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Valtteri Vuorikoski
>Release:        NetBSD 1.6.1_STABLE
>Organization:
>Environment:
System: NetBSD arabgw 1.6.1_STABLE NetBSD 1.6.1_STABLE (SOEKRIS) #18: Wed Aug 13 08:58:39 UTC 2003     vuori@tunkmenistan:/usr/src/sys/arch/i386/compile/SOEKRIS i386
Architecture: i386
Machine: Soekris net4501 with three built-in DP83815 FE controllers
>Description:

The sip driver doesn't configure the Ethernet chip (DP83815) to accept
frames over 1518 bytes long. This causes ip packets larger than 1496
bytes to get truncated when sent over 802.1Q VLAN trunks.

(The PR kern/22459 sent by me is tangentially related to this issue
but is based on false assumptions, and should be killed.)

>How-To-Repeat:

Connect a sip interface to a 802.1Q trunk, create a VLAN interface,
try ping -s 1472 vlan.interface from another machine. Note ip packets
truncated to 1496 bytes.

>Fix:

The following patch in /sys/dev/pci corrects the problem. if_sipreg.h
is changed to reflect the nomenclature in the DP83815 data sheet
(p. 52) for the "accept long packets" bit.

I couldn't find a datasheet for the SiS 900 chip and don't have one to
test, so I don't know what effect this may have on those.

--- if_sip.c.orig       Tue Aug 12 22:27:13 2003
+++ if_sip.c    Wed Aug 13 12:49:33 2003
@@ -2268,6 +2268,12 @@
                sc->sc_txcfg = TXCFG_MXDMA_512;
                sc->sc_rxcfg = RXCFG_MXDMA_512;
        }
+
+       /*
+        * Accept packets >1518 bytes (including FCS) so we can handle
+        * 802.1q-tagged frames properly.
+        */
+       sc->sc_rxcfg |= RXCFG_ALP;
 #endif /* DP83820 */
 
        sc->sc_txcfg |= TXCFG_ATP |
--- if_sipreg.h.orig    Wed Aug 13 08:50:42 2003
+++ if_sipreg.h Wed Aug 13 08:54:05 2003
@@ -450,7 +450,7 @@
 #define        RXCFG_STRIPCRC  0x20000000      /* strip CRC */
 #endif /* DP83820 */
 #define        RXCFG_ATX       0x10000000      /* accept transmit packets */
-#define        RXCFG_AJAB      0x08000000      /* accept jabber packets */
+#define        RXCFG_ALP       0x08000000      /* accept long packets */
 #ifdef DP83820
 #define        RXCFG_AIRL      0x04000000      /* accept in-range length err packets */
 #define        RXCFG_MXDMA      0x00700000     /* max DMA burst size */
>Release-Note:
>Audit-Trail:
>Unformatted: