From owner-p4-projects@FreeBSD.ORG Fri Sep 5 13:34:34 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D63C416A4C1; Fri, 5 Sep 2003 13:34:33 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AD6216A4BF for ; Fri, 5 Sep 2003 13:34:33 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 075E443FCB for ; Fri, 5 Sep 2003 13:34:33 -0700 (PDT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h85KYW0U059094 for ; Fri, 5 Sep 2003 13:34:32 -0700 (PDT) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h85KYWlL059091 for perforce@freebsd.org; Fri, 5 Sep 2003 13:34:32 -0700 (PDT) Date: Fri, 5 Sep 2003 13:34:32 -0700 (PDT) Message-Id: <200309052034.h85KYWlL059091@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 37582 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2003 20:34:34 -0000 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;