Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jul 1998 09:25:01 +1000 (EST)
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        hackers@FreeBSD.ORG
Subject:   LPIP losing clock interrupts - need new spl...() call
Message-ID:  <199807192325.JAA05650@gsms01.alcatel.com.au>

next in thread | raw e-mail | index | archive | help
Last Wednesday I posted a question regarding LPIP losing clock
interrupts.  Following further examination of the code, a discussion
with Bruce Evans and some experimenting, I've verified that the
problem is due to the use of splhigh() within the LPIP input and
output routines.

It appears that the splhigh() is intended to stop other interrupts
interfering with the packet transfer - an interrupt on either machine
delays both machines, so this seems reasonable.  The problem is that
LPIP is slow enough that it can lose clock interrupts - which isn't
reasonable.  At the same time, it's fairly essential that other
PIO-related interrupts be blocked - otherwise the performance is
abyssmal (I measured ~100 bytes/sec across LPIP when I saturated both
machines IDE drives).

Unfortunately, this requirement isn't covered by any of the existing
spl...() macros.  There are also no macros defining the hardclock()
and statclock() IRQ's (they are hard-coded constants in the relevant
register_intr() calls from isa/clock.c).

The solution (from my point of view) is a new spllpip() (or maybe
splplip()).  Technically, this is easy, but I have a number of
stylistic questions:
- Should it go in i386/include/spl.h (since it's an spl()) or
  i386/isa/lpt.c (the only place it's used)?  I tend towards the
  former.
- How should a mask of `all 1's except the hardclock() and statclock()
  IRQs' be declared?  Some options include:

a) GENSPL(spllpip, cpl |= SWI_MASK | 0xfefe)

b) #include <i386/isa/icu.h>
   GENSPL(spllpip, cpl |= SWI_MASK | (HWI_MASK & ~(IRQ0 | IRQ8)))

c) In an include file somewhere:
    #define HWI_CLOCK        0
    #define HWI_STATCLOCK    8
   In i386/include/spl.h:
    GENSPL(spllpip, cpl |= SWI_MASK | (HWI_MASK & ~((1 << HWI_CLOCK) | (1 << HWI_STATCLOCK))))
   And update i386/isa/clock.c to use the new macros.

BTW, as far as I can tell, none of IF_DROP(), IF_ENQUEUE(),
IF_QFULL(), bpf_tap(), m_devget(), m_freem() or schednetisr() must be
called at non-zero spl's.  Can anyone confirm this?

Peter
--
Peter Jeremy (VK2PJ)                    peter.jeremy@alcatel.com.au
Alcatel Australia Limited
41 Mandible St                          Phone: +61 2 9690 5019
ALEXANDRIA  NSW  2015                   Fax:   +61 2 9690 5247

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



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