Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 1998 00:00:04 -0700 (PDT)
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/6099: LPIP to slow machine causes hang 
Message-ID:  <199805200700.AAA10489@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/6099; it has been noted by GNATS.

From: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/6099: LPIP to slow machine causes hang 
Date: Wed, 20 May 1998 08:57:30 +0200

 In message <199804120128.LAA30974@godzilla.zeta.org.au>, Bruce Evans writes:
 >> > The problem with LPIP is that enabling an lpt port for LPIP does not
 >> > update net_imask.  This means that LPIP interrupts can break splimp()
 >> > critical regions - which includes all mbuf handling.
 >> > 
 >> > The following patches correct the problem in 2.2.5R.  The problem also
 >> > exists in older versions of 2.2, -stable and -current.  The same patches
 >> >
 >> > [patch deleted]
 >> 
 >> Here's a patch for 2.2.6-STABLE:
 >
 >It's a waste of time to fix it better than (or different than) the
 >corresponding problem for SLIP.  Just change the evil SLIP ifdef in
 >isa.c.  ppp_tty.c has better fixes mainly because it needs them for
 >the LKM version.
 >
 >> --- /sys/i386/isa/lpt.c.orig    Sat Apr 11 17:44:06 1998
 >> +++ /sys/i386/isa/lpt.c Sat Apr 11 17:44:13 1998
 >> @@ -224,6 +224,7 @@
 >>         u_char  sc_backoff ;    /* time to call lptout() again */
 >> 
 >>  #ifdef INET
 >> +        u_short                sc_irqmask;     /* hardware interrupt mask */
 >>         struct  ifnet   sc_if;
 >>         u_char          *sc_ifbuf;
 >>         int             sc_iferrs;
 >
 >This white space lossage on every line (except the empty one :).
 >
 >> @@ -932,6 +935,9 @@
 >>      case SIOCSIFADDR:
 >>         if (ifa->ifa_addr->sa_family != AF_INET)
 >>             return EAFNOSUPPORT;
 >> +       x = splhigh();
 >> +       net_imask |= sc->sc_irqmask;
 >> +       splx(x);
 >>         ifp->if_flags |= IFF_UP;
 >>         /* FALLTHROUGH */
 >>      case SIOCSIFFLAGS:
 >> 
 >> I haven't had time to test it thoroughly yet though.
 >
 >It is inadequate.  It doesn't call update_intr_masks(), so unless
 >something else calls this function, intr_masks[] is out of date
 >and lpt interrupts are not always masked when network h/w interrupt
 >handlers run.  It doesn't set tty_imask to net_imask, so lptintr()
 >begins with the wrong set of interrupts masked (this is actually
 >harmless because lptintr() has internal, bogus spls) and there is
 >a risk that SLIP or PPP depends on spltty() masking network h/w
 >interrupts.  (All this only applies when neither SLIP nor PPP is
 >configured.)
 >
 >Bruce
 >
 >To Unsubscribe: send mail to majordomo@FreeBSD.org
 >with "unsubscribe freebsd-bugs" in the body of the message
 >
 
 --
 Poul-Henning Kamp             FreeBSD coreteam member
 phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
 "ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805200700.AAA10489>