[haiku-development] Re: if_bge for Haiku

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 04 Oct 2008 13:04:38 +0200 CEST

Pieter Panman <pieter@xxxxxxxxx> wrote:
> I managed to get it to compile (with some cheats), but it does not 
> work 
> quite yet. See the attached diff for what I did to make it compile. I 
> still have to implement m_cljget, but I get stuck on other things 
> first. 
> Besides, if it is called, it will panic, then I'll implement it :) 
> It's 
> something to do with jumbo frames.

Jumbo frames aren't yet supported by our network stack, so you are 
probably safe to ignore them for now. I will port FreeBSDs jme driver 
when I get the hardware, and that one obviously has support for jumbo 
frames, too, so I guess I'll have to improve the compatibility layer a 
bit, anyway.

> I also tried these two below, but that doesn't help at all. Probably 
> this device generates interrupts, and this does not apply.
> NO_HAIKU_CHECK_DISABLE_INTERRUPTS();
> NO_HAIKU_REENABLE_INTERRUPTS();

It depends on how the interrupt routine is done. If the driver operates 
the queues within the interrupt (like the ipro1000 a.k.a. em driver 
does), then the above causes the compatibility layer to handle this 
correctly and efficiently. Else, the interrupt routine is offloaded to 
a service thread.
In any case, this hints to a problem with interrupt handling. Some 
devices don't like how FreeBSD usually handles this in our 
compatibility layer, so that you need to do some extra work. The 3com 
driver is an example for that (just compare the changes made to it for 
Haiku, and have a look at its glue.c).
Probably, the driver doesn't like sharing interrupts, and assumes every 
interrupt is his. Maybe the interrupt level/edge configuration is 
incorrect, causing the kernel to acknowledge an interrupt too early or 
too late.

> I also tried with the latest driver from 
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/bge/ but they now 
> added m_collapse, which still needs to be added to the layer. So I 
> figured I'd focus on the current driver, can always update later.

m_collapse() should only be needed in combination with jumbo frames 
AFAICT, so you can probably stub it out as well.
Updating probably won't help, though, unless they changed the interrupt 
handling.

Bye,
   Axel.


Other related posts: