kern/131414: Receive large packets by Vlan that parent if_sis (don't) work

Sergey Tihonov gluk at slan.ru
Thu Feb 5 03:40:02 PST 2009


>Number:         131414
>Category:       kern
>Synopsis:       Receive large packets by Vlan that parent if_sis (don't) work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 05 11:40:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Tihonov
>Release:        release 6.4
>Organization:
none
>Environment:
FreeBSD vts-uzhnaya.slan.ru 6.4-RELEASE FreeBSD 6.4-RELEASE #3: Tue Feb  3 17:55:28 MSK 2009     root at host1.slan.ru:/usr/src/sys/i386/compile/MINIBSD-64-FULL  i386

>Description:
Good day.
I have motherboard with integrated SIS 900.
When ” ifconfig vlan777 create 10.3.3.3/24 vlan 777 vlandev sis0 “
Packets that size more than 1468 did’t received by vlan777
I’m search patch, but find only patch which correct error counter.

>How-To-Repeat:
host1:
  ifconfig vlan777 create 10.3.3.3/24 vlan 777 vlandev sis0
host2:
  ifconfig vlan777 create 10.3.3.1/24 vlan 777 vlandev rl0
  ping -s 1500 10.3.3.3

Some or all packets lost.

>Fix:
I’m correct two files if_sis.c and if_sisreg.h 
May be, this not correct code, but it help for me.
Patch appended

Patch attached with submission follows:

--- if_sis.c.bak	2008-10-02 06:57:00.000000000 +0400
+++ if_sis.c	2009-02-03 17:05:00.000000000 +0300
@@ -1431,9 +1431,12 @@
 		 * it should simply get re-used next time this descriptor
 	 	 * comes up in the ring.
 		 */
-		if (!(rxstat & SIS_CMDSTS_PKT_OK)) {
+		if ((ifp->if_capenable & IFCAP_VLAN_MTU) != 0 && total_len <= (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_CRC_LEN))
+		    rxstat &= ~SIS_RXSTAT_GIANT;
+		if (SIS_RXSTAT_ERROR(rxstat) != 0) {
 			ifp->if_ierrors++;
 			if (rxstat & SIS_RXSTAT_COLL)
+				ifp->if_ierrors++;
 				ifp->if_collisions++;
 			sis_newbuf(sc, cur_rx, m);
 			continue;
@@ -1649,6 +1652,7 @@
 		SIS_LOCK_ASSERT(sc);
 		/* Reading the ISR register clears all interrupts. */
 		status = CSR_READ_4(sc, SIS_ISR);
+		if (status & SIS_ISR_RX_EARLY) DELAY(1000); 
 
 		if ((status & SIS_INTRS) == 0)
 			break;
@@ -1661,8 +1665,10 @@
 		if (status & (SIS_ISR_RX_DESC_OK|SIS_ISR_RX_OK|SIS_ISR_RX_IDLE))
 			sis_rxeof(sc);
 
-		if (status & (SIS_ISR_RX_ERR | SIS_ISR_RX_OFLOW))
-			sis_rxeoc(sc);
+		if (status & (SIS_ISR_RX_ERR | SIS_ISR_RX_OFLOW)) {
+			if (status & SIS_ISR_RX_EARLY) 
+			    sis_rxeof(sc); 
+			else sis_rxeoc(sc); }
 
 		if (status & (SIS_ISR_RX_IDLE))
 			SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
--- if_sisreg.h.bak	2008-10-02 06:57:00.000000000 +0400
+++ if_sisreg.h	2009-02-03 17:24:00.000000000 +0300
@@ -245,11 +245,11 @@
 
 #define SIS_TXCFG_100	\
 	(SIS_TXDMA_64BYTES|SIS_TXCFG_AUTOPAD|\
-	 SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1536))
+	 SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1540))
 
 #define SIS_TXCFG_10	\
 	(SIS_TXDMA_32BYTES|SIS_TXCFG_AUTOPAD|\
-	 SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1536))
+	 SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1540))
 
 #define SIS_RXCFG_DRAIN_THRESH	0x0000003E /* 8-byte units */
 #define SIS_TXCFG_MPII03D	0x00040000 /* "Must be 1" */ 
@@ -347,6 +347,10 @@
 #define SIS_RXSTAT_DSTCLASS	0x01800000
 #define SIS_RXSTAT_OVERRUN	0x02000000
 #define SIS_RXSTAT_RX_ABORT	0x04000000
+#define SIS_RXSTAT_ERROR(x) \
+ ((x) & (SIS_RXSTAT_RX_ABORT | SIS_RXSTAT_OVERRUN | \
+ SIS_RXSTAT_GIANT | SIS_RXSTAT_SYMBOLERR | SIS_RXSTAT_RUNT | \
+ SIS_RXSTAT_CRCERR | SIS_RXSTAT_ALIGNERR))
 
 #define SIS_DSTCLASS_REJECT	0x00000000
 #define SIS_DSTCLASS_UNICAST	0x00800000
@@ -465,7 +469,7 @@
 
 #define SIS_TIMEOUT		1000
 #define ETHER_ALIGN		2
-#define SIS_RXLEN		1536
+#define SIS_RXLEN		1540
 #define SIS_MIN_FRAMELEN	60
 
 /*


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list