summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJohn Forte <John.Forte@Sun.COM>2009-11-19 22:08:32 -0800
committerJohn Forte <John.Forte@Sun.COM>2009-11-19 22:08:32 -0800
commitcd36db67f9470c74ed7f5bbd57ec6eeb84f71fcd (patch)
tree9610ac1d0a5415be7c7fb97cfacb717e2be210b5 /usr
parentd1419d5a02eaedd520f925cd465fd62f3950ae43 (diff)
downloadillumos-joyent-cd36db67f9470c74ed7f5bbd57ec6eeb84f71fcd.tar.gz
6900698 port providers should not passively participate in ALUA
6903022 stmfSetAluaState() is deleting non-active LUs when state is enabled
Diffstat (limited to 'usr')
-rw-r--r--usr/src/lib/libstmf/common/stmf.c2
-rw-r--r--usr/src/uts/common/io/comstar/port/fct/fct.c2
-rw-r--r--usr/src/uts/common/io/comstar/port/srpt/srpt_stp.c3
-rw-r--r--usr/src/uts/common/io/comstar/stmf/stmf.c24
-rw-r--r--usr/src/uts/common/sys/portif.h1
5 files changed, 26 insertions, 6 deletions
diff --git a/usr/src/lib/libstmf/common/stmf.c b/usr/src/lib/libstmf/common/stmf.c
index f38e52b224..f64396046b 100644
--- a/usr/src/lib/libstmf/common/stmf.c
+++ b/usr/src/lib/libstmf/common/stmf.c
@@ -5293,7 +5293,7 @@ stmfSetAluaState(boolean_t enabled, uint32_t node)
break;
}
}
- if (ret == STMF_STATUS_SUCCESS) {
+ if (!enabled && ret == STMF_STATUS_SUCCESS) {
deleteNonActiveLus();
}
diff --git a/usr/src/uts/common/io/comstar/port/fct/fct.c b/usr/src/uts/common/io/comstar/port/fct/fct.c
index 577499e183..636191548d 100644
--- a/usr/src/uts/common/io/comstar/port/fct/fct.c
+++ b/usr/src/uts/common/io/comstar/port/fct/fct.c
@@ -1207,6 +1207,8 @@ fct_register_local_port(fct_local_port_t *port)
lport->lport_ctl = fct_ctl;
lport->lport_info = fct_info;
lport->lport_event_handler = fct_event_handler;
+ /* set up as alua participating port */
+ stmf_set_port_alua(lport);
if (stmf_register_local_port(port->port_lport) != FCT_SUCCESS) {
goto fct_regport_fail1;
}
diff --git a/usr/src/uts/common/io/comstar/port/srpt/srpt_stp.c b/usr/src/uts/common/io/comstar/port/srpt/srpt_stp.c
index b9d957fadd..f64ac936de 100644
--- a/usr/src/uts/common/io/comstar/port/srpt/srpt_stp.c
+++ b/usr/src/uts/common/io/comstar/port/srpt/srpt_stp.c
@@ -364,6 +364,9 @@ srpt_stp_alloc_port(srpt_ioc_t *ioc, ib_guid_t guid)
lport->lport_info = &srpt_stp_info;
lport->lport_event_handler = &srpt_stp_event_handler;
+ /* set up as alua participating port */
+ stmf_set_port_alua(lport);
+
SRPT_DPRINTF_L3("stp_alloc_port, register STMF LPORT");
retry_registration:
diff --git a/usr/src/uts/common/io/comstar/stmf/stmf.c b/usr/src/uts/common/io/comstar/stmf/stmf.c
index f7eddf7788..d348e60e0d 100644
--- a/usr/src/uts/common/io/comstar/stmf/stmf.c
+++ b/usr/src/uts/common/io/comstar/stmf/stmf.c
@@ -1975,8 +1975,9 @@ stmf_set_alua_state(stmf_alua_state_desc_t *alua_state)
/* register existing local ports with ppp */
for (ilport = stmf_state.stmf_ilportlist; ilport != NULL;
ilport = ilport->ilport_next) {
- /* skip standby ports */
- if (ilport->ilport_standby == 1) {
+ /* skip standby ports and non-alua participants */
+ if (ilport->ilport_standby == 1 ||
+ ilport->ilport_alua == 0) {
continue;
}
if (alua_state->alua_node != 0) {
@@ -3093,6 +3094,14 @@ stmf_set_port_standby(stmf_local_port_t *lport, uint16_t rtpid)
ilport->ilport_standby = 1;
}
+void
+stmf_set_port_alua(stmf_local_port_t *lport)
+{
+ stmf_i_local_port_t *ilport =
+ (stmf_i_local_port_t *)lport->lport_stmf_private;
+ ilport->ilport_alua = 1;
+}
+
stmf_status_t
stmf_register_local_port(stmf_local_port_t *lport)
{
@@ -3125,13 +3134,15 @@ stmf_register_local_port(stmf_local_port_t *lport)
/*
* rtpid will/must be set if this is a standby port
* only register ports that are not standby (proxy) ports
+ * and ports that are alua participants (ilport_alua == 1)
*/
if (ilport->ilport_standby == 0) {
ilport->ilport_rtpid = atomic_add_16_nv(&stmf_rtpid_counter, 1);
}
if (stmf_state.stmf_alua_state == 1 &&
- ilport->ilport_standby == 0) {
+ ilport->ilport_standby == 0 &&
+ ilport->ilport_alua == 1) {
stmf_ic_msg_t *ic_reg_port;
stmf_ic_msg_status_t ic_ret;
stmf_local_port_t *lport;
@@ -3189,7 +3200,8 @@ stmf_deregister_local_port(stmf_local_port_t *lport)
* deregister ports that are not standby (proxy)
*/
if (stmf_state.stmf_alua_state == 1 &&
- ilport->ilport_standby == 0) {
+ ilport->ilport_standby == 0 &&
+ ilport->ilport_alua == 1) {
stmf_ic_msg_t *ic_dereg_port;
stmf_ic_msg_status_t ic_ret;
ic_dereg_port = ic_dereg_port_msg_alloc(
@@ -3314,7 +3326,9 @@ try_dereg_ss_again:
}
/* dereg proxy session if not standby port */
- if (stmf_state.stmf_alua_state == 1 && ilport->ilport_standby == 0) {
+ if (stmf_state.stmf_alua_state == 1 &&
+ ilport->ilport_standby == 0 &&
+ ilport->ilport_alua == 1) {
ic_session_dereg = ic_session_dereg_msg_alloc(
ss, stmf_proxy_msg_id);
if (ic_session_dereg) {
diff --git a/usr/src/uts/common/sys/portif.h b/usr/src/uts/common/sys/portif.h
index 690b501825..c4a806ecf3 100644
--- a/usr/src/uts/common/sys/portif.h
+++ b/usr/src/uts/common/sys/portif.h
@@ -113,6 +113,7 @@ stmf_status_t stmf_register_scsi_session(stmf_local_port_t *lport,
void stmf_deregister_scsi_session(stmf_local_port_t *lport,
stmf_scsi_session_t *ss);
void stmf_set_port_standby(stmf_local_port_t *lport, uint16_t rtpid);
+void stmf_set_port_alua(stmf_local_port_t *lport);
#ifdef __cplusplus
}