From owner-freebsd-net@FreeBSD.ORG Thu Aug 24 01:21:43 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 4F3F216A4DD; Thu, 24 Aug 2006 01:21:43 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from mms2.broadcom.com (mms2.broadcom.com [216.31.210.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id C525043D45; Thu, 24 Aug 2006 01:21:42 +0000 (GMT) (envelope-from davidch@broadcom.com) Received: from 10.10.64.154 by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.2.0)); Wed, 23 Aug 2006 18:21:31 -0700 X-Server-Uuid: D9EB6F12-1469-4C1C-87A2-5E4C0D6F9D06 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id CA3DF2AF; Wed, 23 Aug 2006 18:21:30 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id 9FE552AE; Wed, 23 Aug 2006 18:21:30 -0700 (PDT) Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.10.64.146]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id EDM58530; Wed, 23 Aug 2006 18:21:30 -0700 (PDT) Received: from NT-IRVA-0750.brcm.ad.broadcom.com (nt-irva-0750 [10.8.194.64]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id 14A3E69CA4; Wed, 23 Aug 2006 18:21:30 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Wed, 23 Aug 2006 18:21:28 -0700 Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD90301D43136@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <20060824010423.GA27699@lath.rinet.ru> Thread-Topic: bge(4) one packet wedge Thread-Index: AcbHGUkhGgRNirAnQkGGDEjM78XVwwAAVCWQ From: "David Christensen" To: "Oleg Bulyzhin" X-TMWD-Spam-Summary: SEV=1.1; DFV=A2006082313; IFV=2.0.6,4.0-7; RPD=4.00.0004; RPDID=303030312E30413031303230332E34344543464530422E303030432D412D; ENG=IBF; TS=20060824012135; CAT=NONE; CON=NONE; X-MMS-Spam-Filter-ID: A2006082313_4.00.0004_2.0.6,4.0-7 X-WSS-ID: 68F220913881580588-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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:21:43 -0000 > > > 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? > >=20 > > 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 > I tested it on bcm5701 & bcm5721 >=20 > >=20 > > >=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,=20 > is it ok? > >=20 > > 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=20 > your system. > > Check that byte/word swapping is set correctly. > >=20 > > >=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. > >=20 > > Writing a non-zero value to bits 23:0 will cause the interrupt to > > be disabled: > >=20 > > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1); > >=20 > > Writing all zeros to bits 23:0 will enable interrupts. > >=20 > > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24); > >=20 > > The tag value written to bits 31:24 does not affect the interrupt > > state. >=20 > 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. Here's how it's done in Linux: static void tg3_disable_ints(struct tg3 *tp) { tw32(TG3PCI_MISC_HOST_CTRL, (tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT)); tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001); } static void tg3_enable_ints(struct tg3 *tp) { tp->irq_sync =3D 0; wmb(); tw32(TG3PCI_MISC_HOST_CTRL, (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT)); tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, (tp->last_tag << 24)); if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, (tp->last_tag << 24)); tg3_cond_int(tp); } >=20 > P.S. bcm5705 does not support tagged status mode, am i right? No, the 5705 should support tagged status mode, only the 5788 doesn't support it. The 5705 and 5788 are very closely related though. > --=20 > Oleg.