summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/io/dls/dls_link.c
diff options
context:
space:
mode:
authoryz147064 <none@none>2008-01-23 18:09:15 -0800
committeryz147064 <none@none>2008-01-23 18:09:15 -0800
commitd62bc4badc1c1f1549c961cfb8b420e650e1272b (patch)
tree9f466859e9cfb73da13b64261432aba4683f19ad /usr/src/uts/common/io/dls/dls_link.c
parentd38257c4392a9dd690c2f7f2383236c1fc80e509 (diff)
downloadillumos-joyent-d62bc4badc1c1f1549c961cfb8b420e650e1272b.tar.gz
PSARC/2006/499 Clearview Nemo unification and vanity naming
PSARC/2007/527 Addendum for Clearview Vanity Naming and Nemo Unification PSARC/2008/002 Clearview UV Updates 6310766 vlan statistics get reset at unplumb time 6320515 dladm commands with "-R" option should not take effect immediately 6433732 Simplify the GLDv3 control path by making its processing asynchronous 6445912 dladm show-link fails to show a specific link in the debug version 6452413 dladm show-link doesn't show VLAN links for GLDv2 drivers 6504433 libwladm's use of wladm_wlresult2status() needs an overhaul 6504507 dladm set-linkprop failure message is unclear 6534289 DR should work with aggregations 6535719 dladm_aggr_port_attr_db_t`lp_devname should be MAXNAMELEN, not MAXNAMELEN + 1 6539634 GLDv3 should DL_ERROR_ACK a DL_UDQOS_REQ with DL_OUTSTATE when the stream is DL_UNATTACHED 6540246 libdladm should not guess zoneid from DLDIOCZIDGET ioctl errno 6544195 dladm show-dev assumes GLDv3 stats.. incompatible with GLDv2 6563295 dladm show-linkprop -P does not work properly for unavailable links 6577618 integrate network vanity naming and nemo unification 6600446 links assigned to a local zone are still aggregatable by global zone 6607572 "boot net - install" can trigger assertion failure in dld_str_attach() 6613956 "svccfg import -" does not work as bfu expects 6637596 invalid assertion in ip_soft_ring_assignment() 6642350 kernel DLPI processing routines are long overdue 6643338 GLDv3 PPA hack VLAN ID checks don't always work 6647203 bfu: smf_delete_manifest() does not work for non-global zones 6649885 DL_IB GLDv3 mactype plugin must fill in its mtr_nativetype 6650395 libuuid should be lint-clean and linted nightly --HG-- rename : usr/src/cmd/dladm/aggregation.conf => deleted_files/usr/src/cmd/dladm/aggregation.conf rename : usr/src/cmd/dladm/linkprop.conf => deleted_files/usr/src/cmd/dladm/linkprop.conf rename : usr/src/lib/libinetcfg/common/inetcfg_nic.c => deleted_files/usr/src/lib/libinetcfg/common/inetcfg_nic.c rename : usr/src/lib/libinetcfg/common/inetcfg_nic.h => deleted_files/usr/src/lib/libinetcfg/common/inetcfg_nic.h
Diffstat (limited to 'usr/src/uts/common/io/dls/dls_link.c')
-rw-r--r--usr/src/uts/common/io/dls/dls_link.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/usr/src/uts/common/io/dls/dls_link.c b/usr/src/uts/common/io/dls/dls_link.c
index e342c95955..759fb97f0a 100644
--- a/usr/src/uts/common/io/dls/dls_link.c
+++ b/usr/src/uts/common/io/dls/dls_link.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -90,7 +90,7 @@ i_dls_link_constructor(void *buf, void *arg, int kmflag)
bzero(buf, sizeof (dls_link_t));
- (void) sprintf(name, "dls_link_t_%p_hash", buf);
+ (void) snprintf(name, MAXNAMELEN, "dls_link_t_%p_hash", buf);
dlp->dl_impl_hash = mod_hash_create_idhash(name, IMPL_HASHSZ,
mod_hash_null_valdtor);
@@ -190,12 +190,13 @@ i_dls_link_subchain(dls_link_t *dlp, mblk_t *mp, const mac_header_info_t *mhip,
prevp->b_next = mp;
/*
- * The source, destination, sap, and vlan id must all match
- * in a given subchain.
+ * The source, destination, sap, vlan id and the MSGNOLOOP
+ * flag must all match in a given subchain.
*/
if (memcmp(mhip->mhi_daddr, cmhi.mhi_daddr, addr_size) != 0 ||
memcmp(mhip->mhi_saddr, cmhi.mhi_saddr, addr_size) != 0 ||
- mhip->mhi_bindsap != cmhi.mhi_bindsap) {
+ mhip->mhi_bindsap != cmhi.mhi_bindsap ||
+ mhip->mhi_prom_looped != cmhi.mhi_prom_looped) {
/*
* Note that we don't need to restore the padding.
*/
@@ -700,7 +701,7 @@ dls_link_txloop(void *arg, mblk_t *mp)
static uint_t
i_dls_link_walk(mod_hash_key_t key, mod_hash_val_t *val, void *arg)
{
- boolean_t *promiscp = arg;
+ boolean_t *promiscp = arg;
uint32_t sap = KEY_SAP(key);
if (sap == DLS_SAP_PROMISC) {
@@ -833,7 +834,7 @@ dls_link_hold(const char *name, dls_link_t **dlpp)
/*
* Insert the dls_link_t.
*/
- err = mod_hash_insert(i_dls_link_hash, (mod_hash_key_t)name,
+ err = mod_hash_insert(i_dls_link_hash, (mod_hash_key_t)dlp->dl_name,
(mod_hash_val_t)dlp);
ASSERT(err == 0);
@@ -841,6 +842,7 @@ dls_link_hold(const char *name, dls_link_t **dlpp)
ASSERT(i_dls_link_count != 0);
done:
+
/*
* Bump the reference count and hand back the reference.
*/
@@ -884,26 +886,24 @@ done:
int
dls_mac_hold(dls_link_t *dlp)
{
+ mac_handle_t mh;
int err = 0;
+ err = mac_open(dlp->dl_name, &mh);
+
mutex_enter(&dlp->dl_lock);
ASSERT(IMPLY(dlp->dl_macref != 0, dlp->dl_mh != NULL));
ASSERT(IMPLY(dlp->dl_macref == 0, dlp->dl_mh == NULL));
-
- if (dlp->dl_macref == 0) {
- /*
- * First reference; hold open the MAC interface.
- */
- err = mac_open(dlp->dl_name, &dlp->dl_mh);
- if (err != 0)
- goto done;
-
- dlp->dl_mip = mac_info(dlp->dl_mh);
+ if (err == 0) {
+ ASSERT(dlp->dl_mh == NULL || dlp->dl_mh == mh);
+ if (dlp->dl_mh == NULL) {
+ dlp->dl_mh = mh;
+ dlp->dl_mip = mac_info(mh);
+ }
+ dlp->dl_macref++;
}
- dlp->dl_macref++;
-done:
mutex_exit(&dlp->dl_lock);
return (err);
}
@@ -914,9 +914,9 @@ dls_mac_rele(dls_link_t *dlp)
mutex_enter(&dlp->dl_lock);
ASSERT(dlp->dl_mh != NULL);
+ mac_close(dlp->dl_mh);
+
if (--dlp->dl_macref == 0) {
- mac_rx_remove_wait(dlp->dl_mh);
- mac_close(dlp->dl_mh);
dlp->dl_mh = NULL;
dlp->dl_mip = NULL;
}
@@ -997,7 +997,7 @@ dls_link_add(dls_link_t *dlp, uint32_t sap, dls_impl_t *dip)
/* Replace the existing receive function if there is one. */
if (dlp->dl_mrh != NULL)
- mac_rx_remove(dlp->dl_mh, dlp->dl_mrh, B_FALSE);
+ mac_rx_remove(dlp->dl_mh, dlp->dl_mrh, B_TRUE);
dlp->dl_mrh = mac_active_rx_add(dlp->dl_mh, rx, (void *)dlp);
mutex_exit(&dlp->dl_lock);
}
@@ -1073,7 +1073,7 @@ dls_link_remove(dls_link_t *dlp, dls_impl_t *dip)
*/
if (dlp->dl_impl_count == 0) {
rw_exit(&dlp->dl_impl_lock);
- mac_rx_remove(dlp->dl_mh, dlp->dl_mrh, B_FALSE);
+ mac_rx_remove(dlp->dl_mh, dlp->dl_mrh, B_TRUE);
dlp->dl_mrh = NULL;
} else {
boolean_t promisc = B_FALSE;
@@ -1095,7 +1095,7 @@ dls_link_remove(dls_link_t *dlp, dls_impl_t *dip)
else
rx = i_dls_link_rx;
- mac_rx_remove(dlp->dl_mh, dlp->dl_mrh, B_FALSE);
+ mac_rx_remove(dlp->dl_mh, dlp->dl_mrh, B_TRUE);
dlp->dl_mrh = mac_active_rx_add(dlp->dl_mh, rx, (void *)dlp);
}
mutex_exit(&dlp->dl_lock);
@@ -1152,5 +1152,11 @@ dls_link_header_info(dls_link_t *dlp, mblk_t *mp, mac_header_info_t *mhip)
mhip->mhi_istagged = B_FALSE;
mhip->mhi_tci = 0;
}
+
+ /*
+ * The messsage is looped back from the underlying driver.
+ */
+ mhip->mhi_prom_looped = (mp->b_flag & MSGNOLOOP);
+
return (0);
}