From owner-freebsd-net@FreeBSD.ORG Thu Aug 24 08:41:55 2006 Return-Path: X-Original-To: net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99A2516A4DA; Thu, 24 Aug 2006 08:41:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7A3943D45; Thu, 24 Aug 2006 08:41:54 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.4/8.13.3) with ESMTP id k7O8foMW082372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Aug 2006 12:41:50 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.4/8.13.1/Submit) id k7O8fnpH082371; Thu, 24 Aug 2006 12:41:49 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 24 Aug 2006 12:41:49 +0400 From: Gleb Smirnoff To: David Christensen Message-ID: <20060824084149.GI76666@cell.sick.ru> References: <20060823161649.GE76666@cell.sick.ru> <09BFF2FA5EAB4A45B6655E151BBDD90301D43002@NT-IRVA-0750.brcm.ad.broadcom.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NDin8bjvE/0mNLFQ" Content-Disposition: inline In-Reply-To: <09BFF2FA5EAB4A45B6655E151BBDD90301D43002@NT-IRVA-0750.brcm.ad.broadcom.com> User-Agent: Mutt/1.5.6i Cc: brad@openbsd.org, oleg@FreeBSD.org, net@FreeBSD.org Subject: Re: bge(4) one packet wedge X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2006 08:41:55 -0000 --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Colleagues, pondering on the Linux driver more I have found that the only thing that fixed this problem on 5700 (no status tag support) is the hack in the local timer. So, I have prepared a hack that fixes my problem. Certainly, the performance of request-response test is awful, since chip wedges for a fraction of a second many times per minute. But at least, it doesn't wedge forever. I will continue working on the patch so that it will support the tagged controllers, but I need one to test. P.S. Looks like 5700 is not usable for my benchmarking in the request-response tests. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="bge.status_block" Index: if_bge.c =================================================================== RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v retrieving revision 1.139 diff -u -p -r1.139 if_bge.c --- if_bge.c 23 Aug 2006 11:32:54 -0000 1.139 +++ if_bge.c 24 Aug 2006 08:32:24 -0000 @@ -2705,6 +2719,7 @@ bge_intr(void *xsc) * Do the mandatory PCI flush as well as get the link status. */ statusword = CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_LINK_CHANGED; + sc->bge_ldata.bge_status_block->bge_status &= ~BGE_STATUS_UPDATED; /* Ack interrupt and stop others from occuring. */ CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1); @@ -2769,6 +2784,16 @@ bge_tick_locked(struct bge_softc *sc) } } + if (1) { /* Only for not-tagged IRQ status. */ + struct bge_status_block *sblock = sc->bge_ldata.bge_status_block; + + if (sblock->bge_status & BGE_STATUS_UPDATED) + BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_SET); + else + CSR_WRITE_4(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE | + BGE_HCCMODE_COAL_NOW); + } + callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc); } Index: if_bgereg.h =================================================================== RCS file: /home/ncvs/src/sys/dev/bge/if_bgereg.h,v retrieving revision 1.52 diff -u -p -r1.52 if_bgereg.h --- if_bgereg.h 23 Aug 2006 11:32:54 -0000 1.52 +++ if_bgereg.h 24 Aug 2006 08:21:10 -0000 @@ -1932,7 +1937,10 @@ struct bge_sts_idx { struct bge_status_block { uint32_t bge_status; - uint32_t bge_rsvd0; +#define BGE_STATUS_UPDATED 0x00000001 +#define BGE_STATUS_LINKEV 0x00000002 +#define BGE_STATUS_ERROR 0x00000004 + uint32_t bge_tag; #if BYTE_ORDER == LITTLE_ENDIAN uint16_t bge_rx_jumbo_cons_idx; uint16_t bge_rx_std_cons_idx; --NDin8bjvE/0mNLFQ--