Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Feb 2012 19:53:02 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r231156 - in stable/9/sys/dev: bxe qlxgb sfxge
Message-ID:  <201202071953.q17Jr2iZ004946@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Feb  7 19:53:02 2012
New Revision: 231156
URL: http://svn.freebsd.org/changeset/base/231156

Log:
  MFC 229613:
  Update recently added drivers to use the if_*addr_r*lock() wrapper
  functions instead of using the IF_ADDR_LOCK directly.  The wrapper
  functions are the supported interface for device drivers.

Modified:
  stable/9/sys/dev/bxe/if_bxe.c
  stable/9/sys/dev/qlxgb/qla_os.c
  stable/9/sys/dev/sfxge/sfxge_port.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/bxe/if_bxe.c
==============================================================================
--- stable/9/sys/dev/bxe/if_bxe.c	Tue Feb  7 19:45:15 2012	(r231155)
+++ stable/9/sys/dev/bxe/if_bxe.c	Tue Feb  7 19:53:02 2012	(r231156)
@@ -14115,7 +14115,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
 			i = 0;
 			config = BXE_SP(sc, mcast_config);
 
-			IF_ADDR_LOCK(ifp);
+			if_maddr_rlock(ifp);
 
 			TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 				if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -14144,7 +14144,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
 				    config_table->cam_entry.lsb_mac_addr);
 			}
 
-			IF_ADDR_UNLOCK(ifp);
+			if_maddr_runlock(ifp);
 
 			old = config->hdr.length;
 
@@ -14172,7 +14172,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
 			/* Accept one or more multicasts */
 			memset(mc_filter, 0, 4 * MC_HASH_SIZE);
 
-			IF_ADDR_LOCK(ifp);
+			if_maddr_rlock(ifp);
 
 			TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 				if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -14184,7 +14184,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
 				bit &= 0x1f;
 				mc_filter[regidx] |= (1 << bit);
 			}
-			IF_ADDR_UNLOCK(ifp);
+			if_maddr_runlock(ifp);
 
 			for (i = 0; i < MC_HASH_SIZE; i++)
 				REG_WR(sc, MC_HASH_OFFSET(sc, i), mc_filter[i]);

Modified: stable/9/sys/dev/qlxgb/qla_os.c
==============================================================================
--- stable/9/sys/dev/qlxgb/qla_os.c	Tue Feb  7 19:45:15 2012	(r231155)
+++ stable/9/sys/dev/qlxgb/qla_os.c	Tue Feb  7 19:53:02 2012	(r231156)
@@ -760,7 +760,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a
 	int mcnt = 0;
 	struct ifnet *ifp = ha->ifp;
 
-	IF_ADDR_LOCK(ifp);
+	if_maddr_rlock(ifp);
 
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 
@@ -776,7 +776,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a
 		mcnt++;
 	}
 
-	IF_ADDR_UNLOCK(ifp);
+	if_maddr_runlock(ifp);
 
 	qla_hw_set_multi(ha, mta, mcnt, add_multi);
 

Modified: stable/9/sys/dev/sfxge/sfxge_port.c
==============================================================================
--- stable/9/sys/dev/sfxge/sfxge_port.c	Tue Feb  7 19:45:15 2012	(r231155)
+++ stable/9/sys/dev/sfxge/sfxge_port.c	Tue Feb  7 19:53:02 2012	(r231156)
@@ -301,7 +301,7 @@ sfxge_mac_filter_set_locked(struct sfxge
 		 * 0xff. */
 		bucket[0xff] = 1;
 
-		IF_ADDR_LOCK(ifp);
+		if_maddr_rlock(ifp);
 		TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 			if (ifma->ifma_addr->sa_family == AF_LINK) {
 				sa = (struct sockaddr_dl *)ifma->ifma_addr;
@@ -309,7 +309,7 @@ sfxge_mac_filter_set_locked(struct sfxge
 				bucket[index] = 1;
 			}
 		}
-		IF_ADDR_UNLOCK(ifp);
+		if_maddr_runlock(ifp);
 	}
 	return efx_mac_hash_set(enp, bucket);
 }
@@ -391,10 +391,10 @@ sfxge_port_start(struct sfxge_softc *sc)
 		goto fail2;
 
 	/* Set the unicast address */
-	IF_ADDR_LOCK(ifp);
+	if_addr_rlock(ifp);
 	bcopy(LLADDR((struct sockaddr_dl *)ifp->if_addr->ifa_addr),
 	      mac_addr, sizeof(mac_addr));
-	IF_ADDR_UNLOCK(ifp);
+	if_addr_runlock(ifp);
 	if ((rc = efx_mac_addr_set(enp, mac_addr)) != 0)
 		goto fail;
 



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