From owner-freebsd-hackers Tue Feb 2 11:17:42 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA19982 for freebsd-hackers-outgoing; Tue, 2 Feb 1999 11:17:42 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from chouette.inria.fr (chouette.inria.fr [138.96.24.103]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA19972 for ; Tue, 2 Feb 1999 11:17:37 -0800 (PST) (envelope-from Emmanuel.Duros@sophia.inria.fr) Received: by chouette.inria.fr (8.8.8/8.8.5) id UAA01227; Tue, 2 Feb 1999 20:17:34 +0100 (MET) Date: Tue, 2 Feb 1999 20:17:34 +0100 (MET) Message-Id: <199902021917.UAA01227@chouette.inria.fr> From: Emmanuel Duros To: freebsd-hackers@FreeBSD.ORG Subject: writing network device driver - pb with interrupt levels X-URL: http://www.inria.fr/rodeo/personnel/eduros Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I am writing a driver for a network card and I have a pb with interrupt levels. Basically, when I read data from the card it works fine as long as I do not intensively read from/write to the hard drive. This card works as follows: It has a fifo which gets filled with incoming traffic (IP datagrams) and generates an interrupt when the fifo goes from the an empty to a non-empty state. When the interrup occures, I read the data from the fifo with the following code: void dvintr(int unit){ ... while (fifo_not_empty){ data = inw( addr_read ); /* No DMA transfer !!! -> quite slow */ fill_buffer( buf, data); ... } dvread( buf ); /* when we get a complete MAC packet */ ... } The card does not provide DMA functionalities, I have to read word-long data from the ISA bus with the inw() function. :-( This code works fine when there is no read/write on my IDE hard drive. When writing on the IDE drive, the fifo of the card gets completely filled and therefore loses bytes. In fact I cannot read data as fast as it arrives because the CPU is busy with I/O accesses on the IDE drive. It seems the drive I/O have higher interrupt level than the card has. (BTW, the code works fine with an SCSI drive instead !?!??!) I do not understand this because in the kernel config file, the card has the correct priority level which is higher than disk I/O: device dv0 at isa? port 0x310 net irq 11 vector dvintr I also tried to surround the code in dvintr() with: s = splimp(); --loop-- splx(s) but it is unsuccessful. Anyway I am already at splimp level when I enter the dvintr() function (see kernel config file), am I right ? Could someone give me some help on this ? BTW, what is the exact meaning of the disable_intr() and enable_intr() functions ? Thanks a lot in advance Emmanuel To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message