Date: Wed, 23 Aug 2006 17:54:24 -0700 From: "David Christensen" <davidch@broadcom.com> To: "Oleg Bulyzhin" <oleg@FreeBSD.org> Cc: brad@openbsd.org, Gleb Smirnoff <glebius@FreeBSD.org>, net@FreeBSD.org Subject: RE: bge(4) one packet wedge Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD90301D4312A@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <20060823235632.GA25876@lath.rinet.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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=20 > > field in the status block. (Listed as bge_rsvd0 in the=20 > bge_status_block > > structure).=20 > > Everytime the status block is updated a new tag value is=20 > written to the > > status block. =20 > > When the ISR starts the driver should record the status_tag=20 > value. At > > the end > > of the ISR, the driver should compare the current=20 > status_tag value is > > the status > > block with the value recorded on entry to the ISR. If the=20 > values are > > the same > > then no additional status block updates have occurred so=20 > there shouldn't > > be > > any packets hanging around. If the values are different=20 > then additional > > packets > > or completions are waiting around so the ISR should loop=20 > around again. > > At the=20 > > 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=20 > block update > > handled. > > If necessary the hardware will generate a new interrupt and=20 > start the > > process over > > again. > >=20 > > This entire process should be included in the Linux driver,=20 > I don't see > > it being > > used in the bge driver (bge_intr()). > >=20 > > Dave > >=20 >=20 > Could you please answer few questions? >=20 > 1) I've found status tag is returned in status block even if=20 > 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. >=20 > 2) Status tag is returned in bits 0-7 of status tag field of=20 > 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. >=20 > 3) If i try to return processed tag (at the end of ISR) in=20 > 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=20 > (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. >=20 > --=20 > Oleg. >=20 >=20 >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09BFF2FA5EAB4A45B6655E151BBDD90301D4312A>