From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 5 11:40:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 609051065677 for ; Thu, 5 Feb 2009 11:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3A03A8FC19 for ; Thu, 5 Feb 2009 11:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n15Be1Yd039551 for ; Thu, 5 Feb 2009 11:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n15Be1AR039550; Thu, 5 Feb 2009 11:40:01 GMT (envelope-from gnats) Resent-Date: Thu, 5 Feb 2009 11:40:01 GMT Resent-Message-Id: <200902051140.n15Be1AR039550@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sergey Tihonov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FC01065675 for ; Thu, 5 Feb 2009 11:37:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E84068FC1D for ; Thu, 5 Feb 2009 11:37:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n15BbOg0071501 for ; Thu, 5 Feb 2009 11:37:24 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n15BbOJR071500; Thu, 5 Feb 2009 11:37:24 GMT (envelope-from nobody) Message-Id: <200902051137.n15BbOJR071500@www.freebsd.org> Date: Thu, 5 Feb 2009 11:37:24 GMT From: Sergey Tihonov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/131414: Receive large packets by Vlan that parent if_sis (don't) work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 11:40:02 -0000 >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@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: