From owner-freebsd-net Wed Dec 5 19: 0:36 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 779E237B419 for ; Wed, 5 Dec 2001 19:00:32 -0800 (PST) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id fB630HC68209; Wed, 5 Dec 2001 19:00:17 -0800 (PST) (envelope-from rizzo) Date: Wed, 5 Dec 2001 19:00:17 -0800 From: Luigi Rizzo To: misho Cc: net@FreeBSD.ORG Subject: Re: HEADS-UP: net polling code now in STABLE. Message-ID: <20011205190017.A68166@iguana.aciri.org> References: <20011203221742.A50473@iguana.aciri.org> <3C0CBE2D.1050505@gmx.net> <20011204175148.B58039@iguana.aciri.org> <3C0E3856.2000507@gmx.net> <20011205082203.A63639@iguana.aciri.org> <000c01c17e00$ce170740$eee209d9@cablebg.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000c01c17e00$ce170740$eee209d9@cablebg.net> User-Agent: Mutt/1.3.23i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, Dec 06, 2001 at 04:50:46AM +0200, misho wrote: > Hi Luigi, > > I found this bug several days ago, but I don;t have free time to send you > simple patch. > In my opinion it;s better to disable interrupts in xxx_intr() code when > device is in polling mode. > Something like this: I have committed a proper fix yesterday. The code you propose is a safety belt to mask bugs, but *_intr() could still be called because other devices are sharing the interrupt line (this is actually very common when you have many interfaces). As a matter of fact, calling *_stop() or writing to I/O registers when you get some unwanted interrupts is a bad thing because the operations involved can be very time consuming. cheers luigi > /* > * Process interface interrupts. > */ > static void > fxp_intr(void *xsc) > { > struct fxp_softc *sc = xsc; > u_int8_t statack; > > #ifdef DEVICE_POLLING > struct ifnet *ifp = &sc->sc_if; > > if (ifp->if_ipending & IFF_POLLING) { > /* this shouldn't happen, we are in polling mode > * disable interrupts > */ > CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); > return; > } > if (ether_poll_register(fxp_poll, ifp)) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message