CFR: bridge locking
From: Sam Leffler (sam_at_errno.com)
Date: 08/20/03
- Previous message: Sam Leffler: "CFR: routing table locking"
- Next in thread: Bruce A. Mah: "Re: CFR: bridge locking"
- Reply: Bruce A. Mah: "Re: CFR: bridge locking"
- Reply: Lars Eggert: "Re: CFR: bridge locking"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 20 Aug 2003 09:34:54 -0700 To: freebsd-net@freebsd.org, freebsd-arch@freebsd.org
http://www.freebsd.org/~sam/bridge.patch
This patch adds locking and also overhauls the bridge code some to do
things like replace explicit numbers with #defines and cleanup the
debugging code. I also restructured the forwarding code to avoid grabbing
the ifnet lock if possible and optimized the common case of bridging two
interfaces. There are a couple of LOR issues to be resolved before it can
be committed. In particular the output path has a LOR that can deadlock.
I'm making it available for review now in case folks have other comments.
Beware that buried in these changes are a renaming of the bridge MIB
variables to be under a net.link.ether.bridge. node. Those changes will
not be carried over into the committed code unless folks are interested
(since it'll break lots of rc scripts).
Note that drivers that operate Giant-free with bridging need to release
their "driver lock" before passing packets up. Otherwise the up call can
result in an immediate return through the start method and deadlock (unless
the lock is marked to allow recursion, which should be eliminated if at all
possible). I've made these modifications for the em, wi, and sis drivers
but have not committed them. The fxp driver already does this and the ath
driver has a totally different locking strategy where this doesn't occur.
Short term dropping the lock around the up call will work but is
suboptimal. Long term we may want to revise the locking strategy for
drivers to eliminate this issue. This will likely be revisited when I get
to more performance tuning (unless someone else does it--hint hint).
One other minor change: I moved the printf "BRIDGE 020214 loaded" under
bootverbose. Can anyone tell me what 020214 means?
This code has been in "production use" on my interior firewall (a soekris
box) for a week. This box runs with the sis driver Giant-free.
Sam
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Sam Leffler: "CFR: routing table locking"
- Next in thread: Bruce A. Mah: "Re: CFR: bridge locking"
- Reply: Bruce A. Mah: "Re: CFR: bridge locking"
- Reply: Lars Eggert: "Re: CFR: bridge locking"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: location of bioq lock
... > to work on the queue, ... > So we need to know where the lock
is. ... Each bioq is owned by the consumer of it, i.e. the individual driver. ...
locking it is the responsibility of the driver. ... (freebsd-current) - CFR: bridge locking
... Beware that buried in these changes are a renaming of the bridge MIB ... their
"driver lock" before passing packets up. ... driver has a totally different locking
strategy where this doesn't occur. ... (freebsd-net) - Re: msleep() on recursivly locked mutexes
... global strategy when we write device drivers, so that various modules can be connected together
without races and locking order reversals. ... In my view there are two categories of mutexes.
... 1a) The global mutex protects interrupts/callbacks into a hardware driver. ...
But it does not make sense to make lock #2 lock shorter than lock #1. ... (freebsd-hackers) - [PATCH] I2C: pcf8574 doesnt need a lock
... locking, we found that the pcf8574 driver does the exact contrary. ... uses
a lock where it's not needed. ... we did some additional cleanups to the driver:
... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: [RFC&PATCH 1/2] PCI Error Recovery (readX_check)
... This document describes about the implementation and usage of driver APIs ...
Generally, system has multiple PCI buses, every bus could have multiple ... Often host
bus bridge(Host-to-PCI bridge, connecting PCI system to the host) ... and bridge
has 2 sets of status register for both of its neighbor buses. ... (Linux-Kernel)