What guarantee the serialization of access to the bridge(4) data
structures modified in bridge_rtage() below is the KERNEL_LOCK().

There's no network soft-interrupt context anymore, so remove a
superfluous splsoftnet()/splx() dance and assert for the KERNEL_LOCK().

ok?

Index: net/bridgectl.c
===================================================================
RCS file: /cvs/src/sys/net/bridgectl.c,v
retrieving revision 1.4
diff -u -p -r1.4 bridgectl.c
--- net/bridgectl.c     29 Sep 2016 11:37:43 -0000      1.4
+++ net/bridgectl.c     10 Jan 2017 09:13:26 -0000
@@ -52,7 +52,6 @@
 
 
 int    bridge_rtfind(struct bridge_softc *, struct ifbaconf *);
-void   bridge_rtage(struct bridge_softc *);
 int    bridge_rtdaddr(struct bridge_softc *, struct ether_addr *);
 u_int32_t bridge_hash(struct bridge_softc *, struct ether_addr *);
 
@@ -304,25 +303,17 @@ bridge_hash(struct bridge_softc *sc, str
            BRIDGE_RTABLE_MASK;
 }
 
-void
-bridge_timer(void *vsc)
-{
-       struct bridge_softc *sc = vsc;
-       int s;
-
-       s = splsoftnet();
-       bridge_rtage(sc);
-       splx(s);
-}
-
 /*
  * Perform an aging cycle
  */
 void
-bridge_rtage(struct bridge_softc *sc)
+bridge_rtage(void *vsc)
 {
+       struct bridge_softc *sc = vsc;
        struct bridge_rtnode *n, *p;
        int i;
+
+       KERNEL_ASSERT_LOCKED();
 
        for (i = 0; i < BRIDGE_RTABLE_SIZE; i++) {
                n = LIST_FIRST(&sc->sc_rts[i]);
Index: net/if_bridge.c
===================================================================
RCS file: /cvs/src/sys/net/if_bridge.c,v
retrieving revision 1.290
diff -u -p -r1.290 if_bridge.c
--- net/if_bridge.c     19 Dec 2016 15:49:28 -0000      1.290
+++ net/if_bridge.c     10 Jan 2017 09:12:49 -0000
@@ -168,7 +168,7 @@ bridge_clone_create(struct if_clone *ifc
 
        sc->sc_brtmax = BRIDGE_RTABLE_MAX;
        sc->sc_brttimeout = BRIDGE_RTABLE_TIMEOUT;
-       timeout_set(&sc->sc_brtimeout, bridge_timer, sc);
+       timeout_set(&sc->sc_brtimeout, bridge_rtage, sc);
        TAILQ_INIT(&sc->sc_iflist);
        TAILQ_INIT(&sc->sc_spanlist);
        for (i = 0; i < BRIDGE_RTABLE_SIZE; i++)
Index: net/if_bridge.h
===================================================================
RCS file: /cvs/src/sys/net/if_bridge.h,v
retrieving revision 1.53
diff -u -p -r1.53 if_bridge.h
--- net/if_bridge.h     3 Oct 2016 12:26:13 -0000       1.53
+++ net/if_bridge.h     10 Jan 2017 09:13:22 -0000
@@ -483,7 +483,7 @@ struct ifnet *bridge_rtupdate(struct bri
 struct bridge_rtnode *bridge_rtlookup(struct bridge_softc *,
     struct ether_addr *);
 void   bridge_rtflush(struct bridge_softc *, int);
-void   bridge_timer(void *);
+void   bridge_rtage(void *);
 
 u_int8_t bridge_filterrule(struct brl_head *, struct ether_header *,
     struct mbuf *);

Reply via email to