Date: Fri, 26 Jun 2009 11:45:07 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r195049 - in head/sys: arm/at91 arm/xscale/ixp425 dev/ae dev/age dev/alc dev/ale dev/ath dev/bce dev/bfe dev/bge dev/bm dev/cas dev/cs dev/dc dev/de dev/e1000 dev/ed dev/et dev/ex dev/f... Message-ID: <200906261145.n5QBj7KP085340@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rwatson Date: Fri Jun 26 11:45:06 2009 New Revision: 195049 URL: http://svn.freebsd.org/changeset/base/195049 Log: Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/ IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks Modified: head/sys/arm/at91/if_ate.c head/sys/arm/xscale/ixp425/if_npe.c head/sys/dev/ae/if_ae.c head/sys/dev/age/if_age.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/ath/if_ath.c head/sys/dev/bce/if_bce.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/bm/if_bm.c head/sys/dev/cas/if_cas.c head/sys/dev/cs/if_cs.c head/sys/dev/dc/if_dc.c head/sys/dev/de/if_de.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ed/if_ed.c head/sys/dev/et/if_et.c head/sys/dev/ex/if_ex.c head/sys/dev/fe/if_fe.c head/sys/dev/fxp/if_fxp.c head/sys/dev/gem/if_gem.c head/sys/dev/hme/if_hme.c head/sys/dev/ie/if_ie.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/jme/if_jme.c head/sys/dev/le/lance.c head/sys/dev/lge/if_lge.c head/sys/dev/malo/if_malo.c head/sys/dev/mge/if_mge.c head/sys/dev/msk/if_msk.c head/sys/dev/mxge/if_mxge.c head/sys/dev/my/if_my.c head/sys/dev/nfe/if_nfe.c head/sys/dev/nge/if_nge.c head/sys/dev/nve/if_nve.c head/sys/dev/nxge/if_nxge.c head/sys/dev/pcn/if_pcn.c head/sys/dev/pdq/pdq_ifsubr.c head/sys/dev/re/if_re.c head/sys/dev/sf/if_sf.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/sn/if_sn.c head/sys/dev/snc/dp83932.c head/sys/dev/ste/if_ste.c head/sys/dev/stge/if_stge.c head/sys/dev/ti/if_ti.c head/sys/dev/tl/if_tl.c head/sys/dev/tsec/if_tsec.c head/sys/dev/tx/if_tx.c head/sys/dev/txp/if_txp.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/vge/if_vge.c head/sys/dev/vr/if_vr.c head/sys/dev/wb/if_wb.c head/sys/dev/wi/if_wi.c head/sys/dev/wl/if_wl.c head/sys/dev/xe/if_xe.c head/sys/dev/xl/if_xl.c head/sys/mips/adm5120/if_admsw.c head/sys/netgraph/ng_ether.c head/sys/pci/if_rl.c Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/arm/at91/if_ate.c Fri Jun 26 11:45:06 2009 (r195049) @@ -413,7 +413,7 @@ ate_setmcast(struct ate_softc *sc) */ mcaf[0] = 0; mcaf[1] = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -421,14 +421,14 @@ ate_setmcast(struct ate_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; af[index >> 3] |= 1 << (index & 7); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* * Write the hash to the hash register. This card can also * accept unicast packets as well as multicast packets using this * register for easier bridging operations, but we don't take * advantage of that. Locks here are to avoid LOR with the - * IF_ADDR_LOCK, but might not be strictly necessary. + * if_maddr_rlock, but might not be strictly necessary. */ WR4(sc, ETH_HSL, mcaf[0]); WR4(sc, ETH_HSH, mcaf[1]); Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/arm/xscale/ixp425/if_npe.c Fri Jun 26 11:45:06 2009 (r195049) @@ -435,7 +435,7 @@ npe_setmcast(struct npe_softc *sc) memset(clr, 0, ETHER_ADDR_LEN); memset(set, 0xff, ETHER_ADDR_LEN); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -445,7 +445,7 @@ npe_setmcast(struct npe_softc *sc) set[i] &= mac[i]; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < ETHER_ADDR_LEN; i++) { mask[i] = set[i] | ~clr[i]; Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ae/if_ae.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2073,7 +2073,7 @@ ae_rxfilter(ae_softc_t *sc) * Load multicast tables. */ bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2081,7 +2081,7 @@ ae_rxfilter(ae_softc_t *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); AE_WRITE_4(sc, AE_REG_MHT0, mchash[0]); AE_WRITE_4(sc, AE_REG_MHT1, mchash[1]); AE_WRITE_4(sc, AE_MAC_REG, rxcfg); Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/age/if_age.c Fri Jun 26 11:45:06 2009 (r195049) @@ -3131,7 +3131,7 @@ age_rxfilter(struct age_softc *sc) /* Program new filter. */ bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3139,7 +3139,7 @@ age_rxfilter(struct age_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, AGE_MAR0, mchash[0]); CSR_WRITE_4(sc, AGE_MAR1, mchash[1]); Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/alc/if_alc.c Fri Jun 26 11:45:06 2009 (r195049) @@ -3446,7 +3446,7 @@ alc_rxfilter(struct alc_softc *sc) goto chipit; } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3454,7 +3454,7 @@ alc_rxfilter(struct alc_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); chipit: CSR_WRITE_4(sc, ALC_MAR0, mchash[0]); Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ale/if_ale.c Fri Jun 26 11:45:06 2009 (r195049) @@ -3048,7 +3048,7 @@ ale_rxfilter(struct ale_softc *sc) /* Program new filter. */ bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3056,7 +3056,7 @@ ale_rxfilter(struct ale_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, ALE_MAR0, mchash[0]); CSR_WRITE_4(sc, ALE_MAR1, mchash[1]); Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ath/if_ath.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2408,7 +2408,7 @@ ath_update_mcast(struct ifnet *ifp) * Merge multicast addresses to form the hardware filter. */ mfilt[0] = mfilt[1] = 0; - IF_ADDR_LOCK(ifp); /* XXX need some fiddling to remove? */ + if_maddr_rlock(ifp); /* XXX need some fiddling to remove? */ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { caddr_t dl; u_int32_t val; @@ -2423,7 +2423,7 @@ ath_update_mcast(struct ifnet *ifp) pos &= 0x3f; mfilt[pos / 32] |= (1 << (pos % 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]); Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/bce/if_bce.c Fri Jun 26 11:45:06 2009 (r195049) @@ -7260,7 +7260,7 @@ bce_set_rx_mode(struct bce_softc *sc) /* Accept one or more multicast(s). */ DBPRINT(sc, BCE_INFO_MISC, "Enabling selective multicast mode.\n"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -7268,7 +7268,7 @@ bce_set_rx_mode(struct bce_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN) & 0xFF; hashes[(h & 0xE0) >> 5] |= 1 << (h & 0x1F); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), hashes[i]); Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/bfe/if_bfe.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1111,14 +1111,14 @@ bfe_set_rx_mode(struct bfe_softc *sc) val |= BFE_RXCONF_ALLMULTI; else { val &= ~BFE_RXCONF_ALLMULTI; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bfe_cam_write(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), i++); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } CSR_WRITE_4(sc, BFE_RXCONF, val); Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/bge/if_bge.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1186,7 +1186,7 @@ bge_setmulti(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0); /* Now program new ones. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1194,7 +1194,7 @@ bge_setmulti(struct bge_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN) & 0x7F; hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 4; i++) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), hashes[i]); Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/bm/if_bm.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1072,7 +1072,7 @@ bm_setladrf(struct bm_softc *sc) /* Clear the hash table. */ memset(hash, 0, sizeof(hash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -1085,7 +1085,7 @@ bm_setladrf(struct bm_softc *sc) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (crc & 0xf); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } /* Write out new hash table */ Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/cas/if_cas.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2531,7 +2531,7 @@ cas_setladrf(struct cas_softc *sc) /* Clear the hash table. */ memset(hash, 0, sizeof(hash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -2544,7 +2544,7 @@ cas_setladrf(struct cas_softc *sc) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (15 - (crc & 15)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); v |= CAS_MAC_RX_CONF_HFILTER; Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/cs/if_cs.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1022,7 +1022,7 @@ cs_setmode(struct cs_softc *sc) * Set up the filter to only accept multicast * frames we're interested in. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { struct sockaddr_dl *dl = (struct sockaddr_dl *)ifma->ifma_addr; @@ -1032,7 +1032,7 @@ cs_setmode(struct cs_softc *sc) mask = (u_int16_t) (1 << (index & 0xf)); af[port] |= mask; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } cs_writereg(sc, PP_LAF + 0, af[0]); Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/dc/if_dc.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1110,7 +1110,7 @@ dc_setfilt_21143(struct dc_softc *sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1118,7 +1118,7 @@ dc_setfilt_21143(struct dc_softc *sc) LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); sp[h >> 4] |= htole32(1 << (h & 0xF)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (ifp->if_flags & IFF_BROADCAST) { h = dc_mchash_le(sc, ifp->if_broadcastaddr); @@ -1185,7 +1185,7 @@ dc_setfilt_admtek(struct dc_softc *sc) return; /* Now program new ones. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1200,7 +1200,7 @@ dc_setfilt_admtek(struct dc_softc *sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, DC_AL_MAR0, hashes[0]); CSR_WRITE_4(sc, DC_AL_MAR1, hashes[1]); @@ -1258,7 +1258,7 @@ dc_setfilt_asix(struct dc_softc *sc) return; /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1268,7 +1268,7 @@ dc_setfilt_asix(struct dc_softc *sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_MAR0); CSR_WRITE_4(sc, DC_AX_FILTDATA, hashes[0]); @@ -1313,7 +1313,7 @@ dc_setfilt_xircom(struct dc_softc *sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1321,7 +1321,7 @@ dc_setfilt_xircom(struct dc_softc *sc) LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); sp[h >> 4] |= htole32(1 << (h & 0xF)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (ifp->if_flags & IFF_BROADCAST) { h = dc_mchash_le(sc, ifp->if_broadcastaddr); Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/de/if_de.c Fri Jun 26 11:45:06 2009 (r195049) @@ -3041,7 +3041,7 @@ tulip_addr_filter(tulip_softc_t * const multicnt = 0; ifp = sc->tulip_ifp; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); /* Copy MAC address on stack to align. */ if (ifp->if_input != NULL) @@ -3134,7 +3134,7 @@ tulip_addr_filter(tulip_softc_t * const *sp++ = TULIP_SP_MAC(eaddr[2]); } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } static void Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/e1000/if_em.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2538,7 +2538,7 @@ em_set_multi(struct adapter *adapter) if (mta == NULL) panic("em_set_multi memory failure\n"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2550,7 +2550,7 @@ em_set_multi(struct adapter *adapter) &mta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/e1000/if_igb.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1886,7 +1886,7 @@ igb_set_multi(struct adapter *adapter) IOCTL_DEBUGOUT("igb_set_multi: begin"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1898,7 +1898,7 @@ igb_set_multi(struct adapter *adapter) &mta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ed/if_ed.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1614,7 +1614,7 @@ ed_ds_getmcaf(struct ed_softc *sc, uint3 mcaf[0] = 0; mcaf[1] = 0; - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1622,7 +1622,7 @@ ed_ds_getmcaf(struct ed_softc *sc, uint3 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; af[index >> 3] |= 1 << (index & 7); } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); } int Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/et/if_et.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1361,7 +1361,7 @@ et_setmulti(struct et_softc *sc) } count = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { uint32_t *hp, h; @@ -1387,7 +1387,7 @@ et_setmulti(struct et_softc *sc) ++count; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 4; ++i) CSR_WRITE_4(sc, ET_MULTI_HASH + (i * 4), hash[i]); Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ex/if_ex.c Fri Jun 26 11:45:06 2009 (r195049) @@ -870,13 +870,13 @@ ex_setmulti(struct ex_softc *sc) ifp = sc->ifp; count = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; count++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || count > 63) { @@ -904,7 +904,7 @@ ex_setmulti(struct ex_softc *sc) CSR_WRITE_2(sc, IO_PORT_REG, 0); CSR_WRITE_2(sc, IO_PORT_REG, (count + 1) * 6); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; @@ -915,7 +915,7 @@ ex_setmulti(struct ex_softc *sc) CSR_WRITE_2(sc, IO_PORT_REG, *addr++); CSR_WRITE_2(sc, IO_PORT_REG, *addr++); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* Program our MAC address as well */ /* XXX: Is this necessary? The Linux driver does this Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/fe/if_fe.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2080,7 +2080,7 @@ fe_mcaf ( struct fe_softc *sc ) struct ifmultiaddr *ifma; filter = fe_filter_nothing; - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2093,7 +2093,7 @@ fe_mcaf ( struct fe_softc *sc ) filter.data[index >> 3] |= 1 << (index & 7); } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); return ( filter ); } Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/fxp/if_fxp.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2851,7 +2851,7 @@ fxp_mc_addrs(struct fxp_softc *sc) nmcasts = 0; if ((ifp->if_flags & IFF_ALLMULTI) == 0) { - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2864,7 +2864,7 @@ fxp_mc_addrs(struct fxp_softc *sc) &sc->mcsp->mc_addr[nmcasts][0], ETHER_ADDR_LEN); nmcasts++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } mcsp->mc_cnt = htole16(nmcasts * ETHER_ADDR_LEN); return (nmcasts); Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/gem/if_gem.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2201,7 +2201,7 @@ gem_setladrf(struct gem_softc *sc) /* Clear the hash table. */ memset(hash, 0, sizeof(hash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -2214,7 +2214,7 @@ gem_setladrf(struct gem_softc *sc) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (15 - (crc & 15)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); v |= GEM_MAC_RX_HASH_FILTER; Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/hme/if_hme.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1710,7 +1710,7 @@ hme_setladrf(struct hme_softc *sc, int r * the word. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -1723,7 +1723,7 @@ hme_setladrf(struct hme_softc *sc, int r /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (crc & 0xf); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); chipit: /* Now load the hash table into the chip */ Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ie/if_ie.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1675,7 +1675,7 @@ ie_mc_reset(struct ie_softc *sc) * Step through the list of addresses. */ sc->mcast_count = 0; - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1691,7 +1691,7 @@ ie_mc_reset(struct ie_softc *sc) &(sc->mcast_addrs[sc->mcast_count]), 6); sc->mcast_count++; } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); setflag: sc->want_mcsetup = 1; Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/if_ndis/if_ndis.c Fri Jun 26 11:45:06 2009 (r195049) @@ -320,7 +320,7 @@ ndis_setmulti(sc) sc->ndis_filter |= NDIS_PACKET_TYPE_MULTICAST; len = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -328,13 +328,13 @@ ndis_setmulti(sc) mclist + (ETHER_ADDR_LEN * len), ETHER_ADDR_LEN); len++; if (len > mclistsz) { - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); sc->ndis_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; sc->ndis_filter &= ~NDIS_PACKET_TYPE_MULTICAST; goto out; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); len = len * ETHER_ADDR_LEN; error = ndis_set_info(sc, OID_802_3_MULTICAST_LIST, mclist, &len); Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ixgb/if_ixgb.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1090,7 +1090,7 @@ ixgb_set_multi(struct adapter * adapter) IOCTL_DEBUGOUT("ixgb_set_multi: begin"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); #if __FreeBSD_version < 500000 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { #else @@ -1103,7 +1103,7 @@ ixgb_set_multi(struct adapter * adapter) &mta[mcnt * IXGB_ETH_LENGTH_OF_ADDRESS], IXGB_ETH_LENGTH_OF_ADDRESS); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt > MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = IXGB_READ_REG(&adapter->hw, RCTL); Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1883,7 +1883,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1892,7 +1892,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_ETH_LENGTH_OF_ADDRESS); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); update_ptr = mta; ixgbe_update_mc_addr_list(&adapter->hw, Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/jme/if_jme.c Fri Jun 26 11:45:06 2009 (r195049) @@ -3122,7 +3122,7 @@ jme_set_filter(struct jme_softc *sc) rxcfg |= RXMAC_MULTICAST; bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->jme_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3135,7 +3135,7 @@ jme_set_filter(struct jme_softc *sc) /* Set the corresponding bit in the hash table. */ mchash[crc >> 5] |= 1 << (crc & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, JME_MAR0, mchash[0]); CSR_WRITE_4(sc, JME_MAR1, mchash[1]); Modified: head/sys/dev/le/lance.c ============================================================================== --- head/sys/dev/le/lance.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/le/lance.c Fri Jun 26 11:45:06 2009 (r195049) @@ -605,7 +605,7 @@ lance_setladrf(struct lance_softc *sc, u } af[0] = af[1] = af[2] = af[3] = 0x0000; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -619,7 +619,7 @@ lance_setladrf(struct lance_softc *sc, u /* Set the corresponding bit in the filter. */ af[crc >> 4] |= LE_HTOLE16(1 << (crc & 0xf)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } /* Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/lge/if_lge.c Fri Jun 26 11:45:06 2009 (r195049) @@ -393,7 +393,7 @@ lge_setmulti(sc) CSR_WRITE_4(sc, LGE_MAR1, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -404,7 +404,7 @@ lge_setmulti(sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, LGE_MAR0, hashes[0]); CSR_WRITE_4(sc, LGE_MAR1, hashes[1]); Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/malo/if_malo.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1577,14 +1577,14 @@ malo_setmcastfilter(struct malo_softc *s (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC))) goto all; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (nmc == MALO_HAL_MCAST_MAX) { ifp->if_flags |= IFF_ALLMULTI; - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); goto all; } IEEE80211_ADDR_COPY(mp, @@ -1592,7 +1592,7 @@ malo_setmcastfilter(struct malo_softc *s mp += IEEE80211_ADDR_LEN, nmc++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); malo_hal_setmcast(sc->malo_mh, nmc, macs); Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/mge/if_mge.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1731,7 +1731,7 @@ mge_setup_multicast(struct mge_softc *sc memset(smt, 0, sizeof(smt)); memset(omt, 0, sizeof(omt)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1745,7 +1745,7 @@ mge_setup_multicast(struct mge_softc *sc omt[i >> 2] |= v << ((i & 0x03) << 3); } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } for (i = 0; i < MGE_MCAST_REG_NUMBER; i++) { Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/msk/if_msk.c Fri Jun 26 11:45:06 2009 (r195049) @@ -601,7 +601,7 @@ msk_rxfilter(struct msk_if_softc *sc_if) mchash[1] = 0xffff; } else { mode |= GM_RXCR_UCF_ENA; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -612,7 +612,7 @@ msk_rxfilter(struct msk_if_softc *sc_if) /* Set the corresponding bit in the hash table. */ mchash[crc >> 5] |= 1 << (crc & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mchash[0] != 0 || mchash[1] != 0) mode |= GM_RXCR_MCF_ENA; } Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/mxge/if_mxge.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1130,7 +1130,7 @@ mxge_set_multicast_list(mxge_softc_t *sc /* Walk the multicast list, and add each address */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1146,11 +1146,11 @@ mxge_set_multicast_list(mxge_softc_t *sc "MXGEFW_JOIN_MULTICAST_GROUP, error status:" "%d\t", err); /* abort, leaving multicast filtering off */ - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); return; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* Enable multicast filtering */ err = mxge_send_cmd(sc, MXGEFW_DISABLE_ALLMULTI, &cmd); if (err != 0) { Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/my/if_my.c Fri Jun 26 11:45:06 2009 (r195049) @@ -337,7 +337,7 @@ my_setmulti(struct my_softc * sc) CSR_WRITE_4(sc, MY_MAR1, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -349,7 +349,7 @@ my_setmulti(struct my_softc * sc) hashes[1] |= (1 << (h - 32)); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxfilt |= MY_AM; Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/nfe/if_nfe.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2491,7 +2491,7 @@ nfe_setmulti(struct nfe_softc *sc) bcopy(etherbroadcastaddr, addr, ETHER_ADDR_LEN); bcopy(etherbroadcastaddr, mask, ETHER_ADDR_LEN); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { u_char *addrp; @@ -2505,7 +2505,7 @@ nfe_setmulti(struct nfe_softc *sc) mask[i] &= ~mcaddr; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < ETHER_ADDR_LEN; i++) { mask[i] |= addr[i]; Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/nge/if_nge.c Fri Jun 26 11:45:06 2009 (r195049) @@ -863,7 +863,7 @@ nge_rxfilter(struct nge_softc *sc) * that needs to be updated, and the lower 4 bits represent * which bit within that byte needs to be set. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -875,7 +875,7 @@ nge_rxfilter(struct nge_softc *sc) NGE_FILTADDR_MCAST_LO + (index * 2)); NGE_SETBIT(sc, NGE_RXFILT_DATA, (1 << bit)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); done: CSR_WRITE_4(sc, NGE_RXFILT_CTL, rxfilt); Modified: head/sys/dev/nve/if_nve.c ============================================================================== --- head/sys/dev/nve/if_nve.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/nve/if_nve.c Fri Jun 26 11:45:06 2009 (r195049) @@ -1133,7 +1133,7 @@ nve_setmulti(struct nve_softc *sc) return; } /* Setup multicast filter */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { u_char *addrp; @@ -1147,7 +1147,7 @@ nve_setmulti(struct nve_softc *sc) oraddr[i] |= mcaddr; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 6; i++) { hwfilter.acMulticastAddress[i] = andaddr[i] & oraddr[i]; hwfilter.acMulticastMask[i] = andaddr[i] | (~oraddr[i]); Modified: head/sys/dev/nxge/if_nxge.c ============================================================================== --- head/sys/dev/nxge/if_nxge.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/nxge/if_nxge.c Fri Jun 26 11:45:06 2009 (r195049) @@ -2238,7 +2238,7 @@ xge_setmulti(xge_lldev_t *lldev) } /* Updating address list */ - IF_ADDR_LOCK(ifnetp); + if_maddr_rlock(ifnetp); index = 0; TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { if(ifma->ifma_addr->sa_family != AF_LINK) { @@ -2247,7 +2247,7 @@ xge_setmulti(xge_lldev_t *lldev) lladdr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); index += 1; } - IF_ADDR_UNLOCK(ifnetp); + if_maddr_runlock(ifnetp); if((!lldev->all_multicast) && (index)) { lldev->macaddr_count = (index + 1); @@ -2263,7 +2263,7 @@ xge_setmulti(xge_lldev_t *lldev) } /* Add new addresses */ - IF_ADDR_LOCK(ifnetp); + if_maddr_rlock(ifnetp); index = 0; TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { if(ifma->ifma_addr->sa_family != AF_LINK) { @@ -2273,7 +2273,7 @@ xge_setmulti(xge_lldev_t *lldev) xge_hal_device_macaddr_set(hldev, (offset + index), lladdr); index += 1; } - IF_ADDR_UNLOCK(ifnetp); + if_maddr_runlock(ifnetp); _exit: return; Modified: head/sys/dev/pcn/if_pcn.c ============================================================================== --- head/sys/dev/pcn/if_pcn.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/pcn/if_pcn.c Fri Jun 26 11:45:06 2009 (r195049) @@ -371,7 +371,7 @@ pcn_setmulti(sc) pcn_csr_write(sc, PCN_CSR_MAR0 + i, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -379,7 +379,7 @@ pcn_setmulti(sc) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; hashes[h >> 4] |= 1 << (h & 0xF); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 4; i++) pcn_csr_write(sc, PCN_CSR_MAR0 + i, hashes[i]); Modified: head/sys/dev/pdq/pdq_ifsubr.c ============================================================================== --- head/sys/dev/pdq/pdq_ifsubr.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/pdq/pdq_ifsubr.c Fri Jun 26 11:45:06 2009 (r195049) @@ -273,7 +273,7 @@ pdq_os_addr_fill( PDQ_IFNET(sc)->if_flags &= ~IFF_ALLMULTI; #endif - IF_ADDR_LOCK(PDQ_IFNET(sc)); + if_maddr_rlock(PDQ_IFNET(sc)); for (ifma = TAILQ_FIRST(&PDQ_IFNET(sc)->if_multiaddrs); ifma && num_addrs > 0; ifma = TAILQ_NEXT(ifma, ifma_link)) { char *mcaddr; @@ -286,7 +286,7 @@ pdq_os_addr_fill( addr++; num_addrs--; } - IF_ADDR_UNLOCK(PDQ_IFNET(sc)); + if_maddr_runlock(PDQ_IFNET(sc)); /* * If not all the address fit into the CAM, turn on all-multicast mode. */ Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/re/if_re.c Fri Jun 26 11:45:06 2009 (r195049) @@ -640,7 +640,7 @@ re_set_rxmode(struct rl_softc *sc) goto done; } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -651,7 +651,7 @@ re_set_rxmode(struct rl_softc *sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (hashes[0] != 0 || hashes[1] != 0) { /* Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/sf/if_sf.c Fri Jun 26 11:45:06 2009 (r195049) @@ -494,7 +494,7 @@ sf_rxfilter(struct sf_softc *sc) /* Now program new ones. */ i = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -514,7 +514,7 @@ sf_rxfilter(struct sf_softc *sc) sf_sethash(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), 0); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); done: csr_write_4(sc, SF_RXFILT, rxfilt); Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Fri Jun 26 11:07:57 2009 (r195048) +++ head/sys/dev/sis/if_sis.c Fri Jun 26 11:45:06 2009 (r195049) @@ -773,7 +773,7 @@ sis_setmulti_ns(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906261145.n5QBj7KP085340>