- In bridge_enqueue(), dispatch the mbuf to the current cpu's netisr, instead
commite29177e8ca106f4112e456a23b26687cb33b81e2
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 16 Jun 2007 15:27:27 +0000 (16 15:27 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 16 Jun 2007 15:27:27 +0000 (16 15:27 +0000)
treeb5f659cdec7197c4d4eea55264e83ea356d68ccd
parentd41721146455e61f7d781c185b54219b33907f9b
- In bridge_enqueue(), dispatch the mbuf to the current cpu's netisr, instead
  of calling member iface's handoff directly, so we don't need to release
  bridge's serializer to avoid possible bridge/member iface serializer dead
  lock.  Add bridge_handoff(), which calls member iface's handoff directly.
- Add bridge_pfil_enqueue(), which dispatches the mbuf to the current cpu's
  netisr.  Its netisr handler runs pfil on destination before calling member
  iface's handoff.  With the help of this fucntion, bridge's serializer no
  longer needs to be released during bridge_broadcast()'s member iface
  iteration.  Originally the serializer was released mainly to:
  o  Avoid possible bridge/member iface serializer dead lock
  o  Avoid possible recursion introduced by pfil
  These are no longer applicable to the new code.
- Factor out bridge_enqueue_internal(), which dispatches the mbuf to the
  current cpu's netisr and strips MT_TAG mbufs before the dispatching.  It
  is used by bridge_{enqueue,pfil_enqueue}()
- In bridge_forward(), reorganize pfil code to minimize bridge's temporary
  serializer releasing period:
  o  For broadcast or multicast packets, push bridge_pfil(bifp, src_if) down
     into bridge_broadcast().
  o  For unicast packets, delay bridge_pfil(bifp, src_if) until we have made
     sure that the destination interface is in working state.
- In bridge_input(), if the input iface is not changed, don't go through
  the upper half of ether_input() again.
- Declare netisr_apanic_port in netisr.h, since netmsg is embedded in mbuf,
  this declaration probably will become more useful than netisr_afree_port.

Reviewed-by: dillon@
Tested-by: dillon@
sys/net/bridge/if_bridge.c
sys/net/netisr.h