summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/streamio.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/os/streamio.c
parentd38257c4392a9dd690c2f7f2383236c1fc80e509 (diff)
downloadillumos-gate-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/os/streamio.c')
-rw-r--r--usr/src/uts/common/os/streamio.c54
1 files changed, 47 insertions, 7 deletions
diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c
index 2bbbca12b6..d80fa67f56 100644
--- a/usr/src/uts/common/os/streamio.c
+++ b/usr/src/uts/common/os/streamio.c
@@ -77,9 +77,9 @@
#include <sys/sunldi_impl.h>
#include <sys/autoconf.h>
#include <sys/policy.h>
+#include <sys/dld.h>
#include <sys/zone.h>
-
/*
* This define helps improve the readability of streams code while
* still maintaining a very old streams performance enhancement. The
@@ -239,8 +239,9 @@ stropen(vnode_t *vp, dev_t *devp, int flag, cred_t *crp)
struct stdata *stp;
queue_t *qp;
int s;
- dev_t dummydev;
+ dev_t dummydev, savedev;
struct autopush *ap;
+ struct dlautopush dlap;
int error = 0;
ssize_t rmin, rmax;
int cloneopen;
@@ -439,6 +440,7 @@ ckreturn:
/*
* Open driver and create stream to it (via qattach).
*/
+ savedev = *devp;
cloneopen = (getmajor(*devp) == clone_major);
if ((error = qattach(qp, devp, flag, crp, NULL, B_FALSE)) != 0) {
mutex_enter(&vp->v_lock);
@@ -476,15 +478,53 @@ ckreturn:
" streams module");
}
+ if (!NETWORK_DRV(major)) {
+ savedev = *devp;
+ } else {
+ /*
+ * For network devices, process differently based on the
+ * return value from dld_autopush():
+ *
+ * 0: the passed-in device points to a GLDv3 datalink with
+ * per-link autopush configuration; use that configuration
+ * and ignore any per-driver autopush configuration.
+ *
+ * 1: the passed-in device points to a physical GLDv3
+ * datalink without per-link autopush configuration. The
+ * passed in device was changed to refer to the actual
+ * physical device (if it's not already); we use that new
+ * device to look up any per-driver autopush configuration.
+ *
+ * -1: neither of the above cases applied; use the initial
+ * device to look up any per-driver autopush configuration.
+ */
+ switch (dld_autopush(&savedev, &dlap)) {
+ case 0:
+ zoneid = crgetzoneid(crp);
+ for (s = 0; s < dlap.dap_npush; s++) {
+ error = push_mod(qp, &dummydev, stp,
+ dlap.dap_aplist[s], dlap.dap_anchor, crp,
+ zoneid);
+ if (error != 0)
+ break;
+ }
+ goto opendone;
+ case 1:
+ break;
+ case -1:
+ savedev = *devp;
+ break;
+ }
+ }
/*
- * Check for autopush. Start with the global zone. If not found
- * check in the local zone.
+ * Find the autopush configuration based on "savedev". Start with the
+ * global zone. If not found check in the local zone.
*/
zoneid = GLOBAL_ZONEID;
retryap:
ss = netstack_find_by_stackid(zoneid_to_netstackid(zoneid))->
netstack_str;
- if ((ap = sad_ap_find_by_dev(*devp, ss)) == NULL) {
+ if ((ap = sad_ap_find_by_dev(savedev, ss)) == NULL) {
netstack_rele(ss->ss_netstack);
if (zoneid == GLOBAL_ZONEID) {
/*
@@ -507,6 +547,8 @@ retryap:
sad_ap_rele(ap, ss);
netstack_rele(ss->ss_netstack);
+opendone:
+
/*
* let specfs know that open failed part way through
*/
@@ -516,8 +558,6 @@ retryap:
mutex_exit(&stp->sd_lock);
}
-opendone:
-
/*
* Wake up others that are waiting for stream to be created.
*/