Date: Tue, 02 Feb 1999 14:43:34 -0500 From: Dennis <dennis@etinc.com> To: Emmanuel Duros <Emmanuel.Duros@sophia.inria.fr>, freebsd-hackers@FreeBSD.ORG Subject: Re: writing network device driver - pb with interrupt levels Message-ID: <199902021438.OAA13130@etinc.com> In-Reply-To: <199902021917.UAA01227@chouette.inria.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
Your "card" is too slow...if the fifo is not big enough to handle maximum off load times...there is little you can do to make it work generically. you "can" try to make the interrupt of the "card" a higher priority than the IDE driver (and other devices in your box as well)... although if its an 8-bit card you are out of luck because the high ints (10-15) have higher priority than 8-bit ints (except maybe 2/9) Im not sure if FreeBSD uses the standard priorities, if they dont then all of the above is wrong :-) Dennis At 08:17 PM 2/2/99 +0100, Emmanuel Duros wrote: > >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 > 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?199902021438.OAA13130>