IFXF_MPSAFE is a hint for the network stack.  When it is set, the kernel
knows that it doesn't need to grab the KERNEL_LOCK() to call the start()
routine of an interface.

Exposing this flag to users in ifconfig(8) does not make sense.  This is
a side effect of having re-used the IFXF_TXREADY bit.

I don't even think we should export this bit to userland, developers
should not write different code for MPSAFE and !MPSAFE interfaces. 

ok?

Index: sys/net/if.c
===================================================================
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.430
diff -u -p -r1.430 if.c
--- sys/net/if.c        3 May 2016 14:52:39 -0000       1.430
+++ sys/net/if.c        7 May 2016 14:45:11 -0000
@@ -1668,7 +1668,7 @@ ifioctl(struct socket *so, u_long cmd, c
                break;
 
        case SIOCGIFXFLAGS:
-               ifr->ifr_flags = ifp->if_xflags;
+               ifr->ifr_flags = ifp->if_xflags & ~IFXF_MPSAFE;
                break;
 
        case SIOCGIFMETRIC:
Index: sbin/ifconfig/brconfig.h
===================================================================
RCS file: /cvs/src/sbin/ifconfig/brconfig.h,v
retrieving revision 1.9
diff -u -p -r1.9 brconfig.h
--- sbin/ifconfig/brconfig.h    7 Jan 2016 15:33:56 -0000       1.9
+++ sbin/ifconfig/brconfig.h    7 May 2016 14:35:29 -0000
@@ -68,7 +68,7 @@ int bridge_rule(int, char **, int);
 #define        IFFBITS                                                         
\
        "\024\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6NOTRAILERS" \
        "\7RUNNING\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX"    \
-       "\15LINK0\16LINK1\17LINK2\20MULTICAST\21MPSAFE" \
+       "\15LINK0\16LINK1\17LINK2\20MULTICAST"  \
        "\23INET6_NOPRIVACY\24MPLS\25WOL\26AUTOCONF6"
 
 void printb(char *, unsigned int, unsigned char *);

Reply via email to