aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_frontend.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-11-11 13:18:38 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-11-11 13:18:38 +0000
commit6bd364b5239d0e5d97f37d4ae2b9855c86ff83fa (patch)
tree4494fa08da892ab78c188245e2c14023a9938b89 /sys/cam/ctl/ctl_frontend.c
parentcd3903c620b3999949e3ee4df6eb9b5b37ef6499 (diff)
downloadsrc-6bd364b5239d0e5d97f37d4ae2b9855c86ff83fa.tar.gz
src-6bd364b5239d0e5d97f37d4ae2b9855c86ff83fa.zip
Modify target port groups logic in CTL.
- Introduce "ha_shared" port option, which being set to "on" moves the port into separate port group, shared between HA nodes. This allows to better handle cases when iSCSI portals are bound to CARP address that can dynamically move between nodes. Some initiators (at least VMware) don't detect that after iSCSI reconnect they've attached to different SCSI port from different port group, that totally breakes ALUA status parsing. In theory, I believe, it should be enough to have different iSCSI portal group tags on different nodes to make initiators detect this condition, but it seems like VMware ignores those values, and even full LUN retaste forced by UA does not help. - Make CTL report up to three port groups: 1 -- non-HA mode or ports with "ha_shared" option set, 2 -- HA node 1, 3 -- HA node 2. - Report Transitioning state for all port groups when HA interlink is connected, but neither of nodes is primary for the LUN. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=290670
Diffstat (limited to 'sys/cam/ctl/ctl_frontend.c')
-rw-r--r--sys/cam/ctl/ctl_frontend.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cam/ctl/ctl_frontend.c b/sys/cam/ctl/ctl_frontend.c
index 87ed9d573856..75837b51a52a 100644
--- a/sys/cam/ctl/ctl_frontend.c
+++ b/sys/cam/ctl/ctl_frontend.c
@@ -310,6 +310,7 @@ ctl_port_online(struct ctl_port *port)
{
struct ctl_softc *softc = port->ctl_softc;
struct ctl_lun *lun;
+ const char *value;
uint32_t l;
if (port->lun_enable != NULL) {
@@ -328,6 +329,13 @@ ctl_port_online(struct ctl_port *port)
if (port->port_online != NULL)
port->port_online(port->onoff_arg);
mtx_lock(&softc->ctl_lock);
+ if (softc->is_single == 0) {
+ value = ctl_get_opt(&port->options, "ha_shared");
+ if (value != NULL && strcmp(value, "on") == 0)
+ port->status |= CTL_PORT_STATUS_HA_SHARED;
+ else
+ port->status &= ~CTL_PORT_STATUS_HA_SHARED;
+ }
port->status |= CTL_PORT_STATUS_ONLINE;
STAILQ_FOREACH(lun, &softc->lun_list, links) {
if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS)