From owner-freebsd-net@FreeBSD.ORG Thu Aug 24 01:04:28 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 6FC3016A4DD; Thu, 24 Aug 2006 01:04:28 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD99843D49; Thu, 24 Aug 2006 01:04:27 +0000 (GMT) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (localhost [127.0.0.1]) by lath.rinet.ru (8.13.6/8.13.6) with ESMTP id k7O14NfZ027821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Aug 2006 05:04:23 +0400 (MSD) (envelope-from oleg@lath.rinet.ru) Received: (from oleg@localhost) by lath.rinet.ru (8.13.6/8.13.6/Submit) id k7O14N0t027820; Thu, 24 Aug 2006 05:04:23 +0400 (MSD) (envelope-from oleg) Date: Thu, 24 Aug 2006 05:04:23 +0400 From: Oleg Bulyzhin To: David Christensen Message-ID: <20060824010423.GA27699@lath.rinet.ru> References: <20060823235632.GA25876@lath.rinet.ru> <09BFF2FA5EAB4A45B6655E151BBDD90301D4312A@NT-IRVA-0750.brcm.ad.broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09BFF2FA5EAB4A45B6655E151BBDD90301D4312A@NT-IRVA-0750.brcm.ad.broadcom.com> User-Agent: Mutt/1.5.11 Cc: brad@openbsd.org, Gleb Smirnoff , 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 01:04:28 -0000 On Wed, Aug 23, 2006 at 05:54:24PM -0700, David Christensen wrote: > > On Wed, Aug 23, 2006 at 12:53:49PM -0700, David Christensen wrote: > > > This "lost interrupt" type of problem is addressed by the use of the > > > status_tag > > > field in the status block. (Listed as bge_rsvd0 in the > > bge_status_block > > > structure). > > > Everytime the status block is updated a new tag value is > > written to the > > > status block. > > > When the ISR starts the driver should record the status_tag > > value. At > > > the end > > > of the ISR, the driver should compare the current > > status_tag value is > > > the status > > > block with the value recorded on entry to the ISR. If the > > values are > > > the same > > > then no additional status block updates have occurred so > > there shouldn't > > > be > > > any packets hanging around. If the values are different > > then additional > > > packets > > > or completions are waiting around so the ISR should loop > > around again. > > > At the > > > end of the ISR the driver will write the status_tag value it last > > > handled to a > > > mailbox register, letting the hardware know the last status > > block update > > > handled. > > > If necessary the hardware will generate a new interrupt and > > start the > > > process over > > > again. > > > > > > This entire process should be included in the Linux driver, > > I don't see > > > it being > > > used in the bge driver (bge_intr()). > > > > > > Dave > > > > > > > Could you please answer few questions? > > > > 1) I've found status tag is returned in status block even if > > bit 9 of Misc. > > Host Control Register is not set, is it ok? > > Which controller are you using? This bit is reserved on the 5700 > (which didn't support tagged status mode) but all other controllers > should support it and all of the Broadcom drivers will always > enable it. I tested it on bcm5701 & bcm5721 > > > > > 2) Status tag is returned in bits 0-7 of status tag field of > > status block, > > as long as i know it should be returned in bits 31-24, is it ok? > > Not sure what you mean by this. If you're seeing it in bits 31-24 > of the status block then there may be an endian issue on your system. > Check that byte/word swapping is set correctly. > > > > > 3) If i try to return processed tag (at the end of ISR) in > > Mailbox 0 register: > > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24); > > it would lead to disabled interrupts. > > I've thought this should not happen cause in_isr bits > > (0-23) are cleared. > > Writing a non-zero value to bits 23:0 will cause the interrupt to > be disabled: > > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1); > > Writing all zeros to bits 23:0 will enable interrupts. > > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24); > > The tag value written to bits 31:24 does not affect the interrupt > state. Yes, this is i'm talking about: CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0x01000000) would lead to _disabled_ interrupts. Tested on bcm5701 & bcm5721. P.S. bcm5705 does not support tagged status mode, am i right? -- Oleg.