Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2001 04:50:46 +0200
From:      "misho" <misho@interbgc.com>
To:        "Luigi Rizzo" <luigi@FreeBSD.ORG>
Cc:        <net@FreeBSD.ORG>
Subject:   Re: HEADS-UP: net polling code now in STABLE.
Message-ID:  <000c01c17e00$ce170740$eee209d9@cablebg.net>
References:  <20011203221742.A50473@iguana.aciri.org> <3C0CBE2D.1050505@gmx.net> <20011204175148.B58039@iguana.aciri.org> <3C0E3856.2000507@gmx.net> <20011205082203.A63639@iguana.aciri.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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:

/*
 * 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)) {
...

regards,
misho

----- Original Message -----
From: "Luigi Rizzo" <luigi@FreeBSD.ORG>
To: "Michael Nottebrock" <michaelnottebrock@gmx.net>
Cc: <net@FreeBSD.ORG>
Sent: Wednesday, December 05, 2001 6:22 PM
Subject: Re: HEADS-UP: net polling code now in STABLE.


> On Wed, Dec 05, 2001 at 04:08:06PM +0100, Michael Nottebrock wrote:
> > Luigi Rizzo wrote:
> >
> > >i just committed a patch to dev/fxp/if_fxp.c pci/if_dc.c and
> > >pci/if_sis.c which should fix this. It's a very simple one so you
> > >can just fetch the diff from the cvs repository and rebuild the
> > >kernel, without having to upgrade the whole system.
> >
> > The system boots fine now, but I got one page fault panic very similar
> > to the one I already reported again when I tried to reboot. Not sure if
>
> do you have a "dc" or "sis" interface in your system, by chance ?
>
> I used to get a panic on reboot, in a previous version of the
> code, which disappeared when i introduced the check for IFF_RUNNING
> before invoking xx_poll() on the device.
> If it happens again, please let me know, maybe together with
> the list of interfaces you have.
>
> (I notice that the original code in dc_stop() and sis_stop() is
> slightly incorrect, because it first frees resources and then marks
> the interface as not RUNNING. This might lead to a race and explains
> the panic and why it does not happen all the times).
>
> cheers
> luigi
> ----------------------------------+---------------------------------------
--
>  Luigi RIZZO, luigi@iet.unipi.it  . ACIRI/ICSI (on leave from Univ. di
Pisa)
>  http://www.iet.unipi.it/~luigi/  . 1947 Center St, Berkeley CA 94704
>  Phone: (510) 666 2927
> ----------------------------------+---------------------------------------
--
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-net" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000c01c17e00$ce170740$eee209d9>