Lewis Adam-CAL022
2007-Apr-18 17:22 UTC
[Bridge] Interface or Linux crashes when put in bridge mode
Hi all, let me see if I can explain my problem in an explicable way. I have written a WLAN driver which runs on a dedicated box (e.g. not a PCMCIA card). The box is plugged into a client that wants WLAN connectivity via Ethernet. E.g.: [ ] Ethernet [ ] RF/WLAN [ Laptop ]------------------[ WLAN adapter ]------------- [ ] [ ] For testing, I put two WLAN adapters back-to-back [ ] RF/WLAN [ ] [ WLAN-1 ]------------------[ WLAN-2] [ ] [ ] And assigned each WLAN interface and IP address (192.168.0.1 and .2). Then I started a fast ping with a size above the WLAN MTU (for my test the MTU was set to 500). ping -s1000 -i0.00001 192.168.0.2 (from .1) Everything work perfectly! Now for the problem ... Next I put each WLAN adapter into bridge mode, tying wlan0 to eth0 on each box. Note that this is now a layer-2 bridge and hence br0 has no IP address. I connect a laptop on each WLAN adapter: [ ] Eth [ ] RF/WLAN [ ] Eth [ ] [ Laptop ]-------------[ WLAN 1 ]-------------[ WLAN 2 ]-------------[ Laptop2 ] [ ] [ ] [ ] [ ] And I do the same ping as above, but from laptop1 to laptop2. Regrettably, this causes a kernel crash (appears to be a deadlock somewhere because no oops is output to the serial port). It is also interesting to note that it does not crash if the ping size is below the WLAN MTU. So I am hoping somebody can shed some light. I am not an expert on the Linux bridge code, but I would assume it simply takes the data passed to one interface and gives it to the next; so my WLAN driver should not know or care if the data is coming from a local ping or a ping from another box, cause it should receive the same skb, right? I am at a total loss to explain it at this time. Thanks for any help offered! Adam
Stephen Hemminger
2007-Apr-18 17:22 UTC
[Bridge] Interface or Linux crashes when put in bridge mode
> So I am hoping somebody can shed some light. I am not an expert on the Linux bridge code, but I would assume it simply takes the data passed to one interface and gives it to the next; so my WLAN driver should not know or care if the data is coming from a local ping or a ping from another box, cause it should receive the same skb, right? I am at a total loss to explain it at this time. >Sorry, won't fix your driver for you... It's open source walkthrough the code. You might find that your driver doesn't like it when it's transmit routine is called from softirq? or maybe it doesn't like spoofing the source Ethernet address. Use printk's or kgdb; it can't be that hard to find.