Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2003 13:34:32 -0700 (PDT)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 37582 for review
Message-ID:  <200309052034.h85KYWlL059091@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=37582

Change 37582 by sam@sam_ebb on 2003/09/05 13:34:26

	o fix typo/braino
	o remove unneeded locking

Affected files ...

.. //depot/projects/netperf/sys/net/if_vlan.c#3 edit

Differences ...

==== //depot/projects/netperf/sys/net/if_vlan.c#3 (text+ko) ====

@@ -114,7 +114,7 @@
 #define	VLAN_LOCK_DESTROY()	mtx_destroy(&ifv_mtx)
 #define	VLAN_LOCK_ASSERT()	mtx_assert(&ifv_mtx, MA_OWNED)
 #define	VLAN_LOCK()	mtx_lock(&ifv_mtx)
-#define	VLAN_UNLOCK()	mtx_lock(&ifv_mtx)
+#define	VLAN_UNLOCK()	mtx_unlock(&ifv_mtx)
 
 static	int vlan_clone_create(struct if_clone *, int);
 static	void vlan_clone_destroy(struct ifnet *);
@@ -147,8 +147,6 @@
 	struct sockaddr_dl	sdl;
 	int			error;
 
-	VLAN_LOCK_ASSERT();
-
 	/* Find the parent. */
 	sc = ifp->if_softc;
 	ifp_p = sc->ifv_p;
@@ -643,8 +641,6 @@
 	struct ifvlan *ifv = ifp->if_softc;
 	int error = 0;
 
-	VLAN_LOCK_ASSERT();
-
 	if ((ifp->if_flags & IFF_PROMISC) != 0) {
 		if ((ifv->ifv_flags & IFVF_PROMISC) == 0) {
 			error = ifpromisc(ifv->ifv_p, 1);
@@ -754,10 +750,10 @@
 		if (vlr.vlr_parent[0] == '\0') {
 			VLAN_LOCK();
 			vlan_unconfig(ifp);
-			VLAN_UNLOCK();
 			if (ifp->if_flags & IFF_UP)
 				if_down(ifp);
 			ifp->if_flags &= ~IFF_RUNNING;
+			VLAN_UNLOCK();
 			break;
 		}
 		p = ifunit(vlr.vlr_parent);
@@ -781,10 +777,10 @@
 		}
 		ifv->ifv_tag = vlr.vlr_tag;
 		ifp->if_flags |= IFF_RUNNING;
+		VLAN_UNLOCK();
 
 		/* Update promiscuous mode, if necessary. */
 		vlan_set_promisc(ifp);
-		VLAN_UNLOCK();
 		break;
 		
 	case SIOCGETVLAN:
@@ -804,17 +800,13 @@
 		 * For promiscuous mode, we enable promiscuous mode on
 		 * the parent if we need promiscuous on the VLAN interface.
 		 */
-		VLAN_LOCK();
 		if (ifv->ifv_p != NULL)
 			error = vlan_set_promisc(ifp);
-		VLAN_UNLOCK();
 		break;
 
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
-		VLAN_LOCK();
 		error = vlan_setmulti(ifp);
-		VLAN_UNLOCK();
 		break;
 	default:
 		error = EINVAL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309052034.h85KYWlL059091>