Interface ioctl(2) are now always run at IPL_SOFTNET, so let's get rid
of recursive splsoftnet()/splx() dances.

ok?

Index: net/if_mpe.c
===================================================================
RCS file: /cvs/src/sys/net/if_mpe.c,v
retrieving revision 1.55
diff -u -p -r1.55 if_mpe.c
--- net/if_mpe.c        21 Sep 2016 07:41:49 -0000      1.55
+++ net/if_mpe.c        19 Dec 2016 10:38:47 -0000
@@ -270,7 +270,7 @@ mpeioctl(struct ifnet *ifp, u_long cmd, 
        struct mpe_softc        *ifm;
        struct ifreq            *ifr;
        struct shim_hdr          shim;
-       int                      s, error = 0;
+       int                      error = 0;
 
        ifr = (struct ifreq *)data;
        switch (cmd) {
@@ -320,7 +320,6 @@ mpeioctl(struct ifnet *ifp, u_long cmd, 
                if (error)
                        break;
                ifm = ifp->if_softc;
-               s = splsoftnet();
                if (ifm->sc_smpls.smpls_label) {
                        /* remove old MPLS route */
                        rt_ifa_del(&ifm->sc_ifa, RTF_MPLS,
@@ -330,7 +329,6 @@ mpeioctl(struct ifnet *ifp, u_long cmd, 
                ifm->sc_smpls.smpls_label = shim.shim_label;
                error = rt_ifa_add(&ifm->sc_ifa, RTF_MPLS,
                    smplstosa(&ifm->sc_smpls));
-               splx(s);
                if (error) {
                        ifm->sc_smpls.smpls_label = 0;
                        break;
@@ -341,10 +339,8 @@ mpeioctl(struct ifnet *ifp, u_long cmd, 
                ifm = ifp->if_softc;
                if (ifr->ifr_rdomainid != ifp->if_rdomain) {
                        if (ifm->sc_smpls.smpls_label) {
-                               s = splsoftnet();
                                rt_ifa_add(&ifm->sc_ifa, RTF_MPLS,
                                    smplstosa(&ifm->sc_smpls));
-                               splx(s);
                        }
                }
                /* return with ENOTTY so that the parent handler finishes */
Index: net/if_mpw.c
===================================================================
RCS file: /cvs/src/sys/net/if_mpw.c,v
retrieving revision 1.15
diff -u -p -r1.15 if_mpw.c
--- net/if_mpw.c        21 Sep 2016 07:41:49 -0000      1.15
+++ net/if_mpw.c        19 Dec 2016 10:38:27 -0000
@@ -152,7 +152,6 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd,
        struct sockaddr_in *sin;
        struct sockaddr_in *sin_nexthop;
        int error = 0;
-       int s;
        struct ifmpwreq imr;
 
        switch (cmd) {
@@ -183,11 +182,9 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd,
                /* Teardown all configuration if got no nexthop */
                sin = (struct sockaddr_in *) &imr.imr_nexthop;
                if (sin->sin_addr.s_addr == 0) {
-                       s = splsoftnet();
                        if (rt_ifa_del(&sc->sc_ifa, RTF_MPLS,
                            smplstosa(&sc->sc_smpls)) == 0)
                                sc->sc_smpls.smpls_label = 0;
-                       splx(s);
 
                        memset(&sc->sc_rshim, 0, sizeof(sc->sc_rshim));
                        memset(&sc->sc_nexthop, 0, sizeof(sc->sc_nexthop));
@@ -213,7 +210,6 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd,
                    htonl(imr.imr_rshim.shim_label << MPLS_LABEL_OFFSET);
 
                if (sc->sc_smpls.smpls_label != imr.imr_lshim.shim_label) {
-                       s = splsoftnet();
                        if (sc->sc_smpls.smpls_label)
                                rt_ifa_del(&sc->sc_ifa, RTF_MPLS,
                                    smplstosa(&sc->sc_smpls));
@@ -221,7 +217,6 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd,
                        sc->sc_smpls.smpls_label = imr.imr_lshim.shim_label;
                        error = rt_ifa_add(&sc->sc_ifa, RTF_MPLS,
                            smplstosa(&sc->sc_smpls));
-                       splx(s);
                        if (error != 0) {
                                sc->sc_smpls.smpls_label = 0;
                                break;

Reply via email to