From jforte@sac.sfbay.sun.com Wed Aug 26 16:21:05 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7QNL5UB016467
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 26 Aug 2009 16:21:05 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7QNL4w9014498;
	Wed, 26 Aug 2009 16:21:05 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP000A05BJ5LX00@nwk-avmta-1.sfbay.Sun.COM>; Wed,
 26 Aug 2009 16:21:05 -0700 (PDT)
Received: from dm-sfbay-02.sfbay.sun.com ([129.146.11.31])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP0004IZBJ3FW40@nwk-avmta-1.sfbay.Sun.COM>; Wed,
 26 Aug 2009 16:21:03 -0700 (PDT)
Received: from sac.sfbay.sun.com (sac.SFBay.Sun.COM [129.146.226.132])
	by dm-sfbay-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id n7QNL3BS002207; Wed, 26 Aug 2009 16:21:03 -0700 (PDT)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7QNL2nj016462; Wed,
 26 Aug 2009 16:21:02 -0700 (PDT)
Received: (from jforte@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id n7QNL2vh016458; Wed,
 26 Aug 2009 16:21:02 -0700 (PDT)
Date: Wed, 26 Aug 2009 16:21:02 -0700 (PDT)
From: John Forte <jforte@sac.sfbay.sun.com>
Subject: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack timeout
 09/02/2009]
To: PSARC-ext@sun.com
Cc: John.Forte@sun.com
Message-id: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 12502

I am sponsoring the following fasttrack for myself. Requested binding is
minor. Timeout is set for 9/02.

- John


Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 COMSTAR ALUA active/standby support
    1.2. Name of Document Author/Supplier:
	 Author:  John Forte
    1.3  Date of This Document:
	26 August, 2009
4. Technical Description

COMSTAR (PSARC 2007/523 [1]) supports the SCSI standard [2] for Asymmetric 
Logical Unit Access (ALUA) but only supports the access state of 
Active/Optimized. This set of interfaces introduces support for a logical unit
access state of Standby on a peer node. This support is provided via the
existing libstmf(3LIB) introduced in PSARC 2007/253 and is targeted towards
developers of clustered storage systems in 2 node configurations. Use of these 
interfaces require a peer-to-peer communication channel be established between 
the two participating nodes in the COMSTAR (STMF) ALUA configuration.


4.1 Interfaces

    Minor binding.

        -------------+-----------------------+-------------------------
        Interface        Classification         Comments
        -------------+-----------------------+-------------------------
        libstmf      |   Committed           |  PSARC 2007/523


4.2 stmfSetAluaState

NAME
    stmfSetAluaState

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include <libstmf.h>

    int stmfSetAluaState(boolean_t enabled, uint8_t node)

PARAMETERS
    enabled     B_TRUE when enabling ALUA mode
                B_FALSE when disabling ALUA mode

    node        Must be the value 0 or 1

DESCRIPTION
    The stmfSetAluaState() function sets the Asymmetric Logical Unit Access
    State (ALUA) mode for STMF. When enabled is set to B_FALSE, node is ignored,
    otherwise, node must be set to 0 or 1.  The node setting must be different
    for each node in a paired config. This should be called only after the
    STMF proxy door service has been initialized(See stmfInitProxyDoor(3STMF)).
    When the ALUA state is enabled, all STMF logical units will be
    registered on the peer node as standby logical units. The standby logical
    units can then be exported to any SCSI initiator using the existing
    mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
    subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
    it is valid to call this interface again with enabled set to B_TRUE.
    This action would result in a re-initialization of the ALUA mode. This
    can be used during recovery of a failed peer node.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      Either enabled or node was incorrectly set.

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|


4.3 stmfGetAluaState

NAME
    stmfGetAluaState

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include <libstmf.h>

    int stmfGetAluaState(boolean_t *enabled, uint8_t *node)

PARAMETERS
    enabled     set to B_TRUE or B_FALSE on success

    node        set to 0 or 1 on success

DESCRIPTION
    The stmfGetAluaState() function returns the Asymmetric Logical Unit Access
    State (ALUA) mode for STMF along with the node setting.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|



4.4 stmfLuStandby

NAME
    stmfLuStandby

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include <libstmf.h>

    int stmfLuStandby(stmfGuid *luGuid)

PARAMETERS
    luGuid      a pointer to an stmfGuid structure containing the guid
                of the logical unit to set to standby

DESCRIPTION
    The stmfLuStandby() function sets the access state of a logical unit to
    standby mode.  When successfully set, a standby logical unit switches its
    asymmetric logical unit access state to a one of "Transition to
    Standby" (see stmfGetLuProp(3STMF). Once moved to this state, the backing
    store for the logical unit will be released by the logical unit provider
    (sbd for disk devices). In order to move a logical unit out of "Standby"
    or the "Transition to Standby" state, stmfImportLu(3STMF) or the import-lu
    subcommand of stmfadm(1M) must be executed on the logical unit. On a
    successful logical unit import, the access state of the logical unit will
    move to Active in addition to sending a message to its peer that will
    complete the peer's transition to Standby. The current access state for
    the logical unit can be retrieved using stmfGetLuProp(3STMF) where the
    property type is STMF_LU_PROP_ACCESS_STATE.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_NOT_FOUND        The guid does not exist

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|



4.5 stmfInitProxyDoor

NAME
    stmfInitProxyDoor

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include <libstmf.h>

    int stmfInitProxyDoor(int *hdl, int fd);

PARAMETERS
    hdl         a pointer to an int. This will contain the handle for
                the proxy door to be used in calls to
                stmfPostProxyMsg(3STMF) and stmfDestroyProxyDoor(3STMF)

    fd          The door file descriptor for the established door server

DESCRIPTION
    The stmfInitProxyDoor() function establishes the door server with the
    STMF proxy service. The STMF proxy service is responsible for sending
    SCSI commands to the peer node on behalf of a logical unit in the Standby
    asymmetric logical unit access (ALUA) state. stmfInitProxyDoor(3STMF)
    should be called once a peer-to-peer communication channel between the two
    participating ALUA nodes has been established by the caller.

    Door server interface:

    The door_call from the STMF proxy service to the door server will fill in
    the door_arg_t structure as follows:

        door_arg_t arg;
        uint32_t result;

        arg.data_ptr = buf;
        arg.data_size = size;
        arg.desc_ptr = NULL;
        arg.desc_num = 0;
        arg.rbuf = (char *)&result;
        arg.rsize = sizeof (result);

        The tuple <data_ptr, data_size> is expected to arrive at the
        peer node STMF proxy service via stmfPostProxyMsg(3STMF).

    The door server is expected to complete the door call with these
    arguments to door_return:

         uinit32_t result;

         (void) door_return((char *)&result, sizeof(result), NULL, 0);

    where result is of type uint32_t and set to 0 on success, non-zero
    on failure.

    Non-zero values are logged as errors without further action. No file
    descriptors will be exchanged by the door call or return.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_DOOR_INSTALLED   A previous door has already been
                                established.

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|

4.6 stmfDestroyProxyDoor

NAME
    stmfDestroyProxyDoor

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include <libstmf.h>

    void stmfDestroyProxyDoor(int hdl);

PARAMETERS
    hdl         hdl returned from a previous call to
                stmfInitProxyDoor(3STMF)

DESCRIPTION
    The stmfDestroyProxyDoor() function closes the door interface
    established in the call to stmfInitProxyDoor().

RETURN VALUES

    None


ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|


4.7 stmfPostProxyMsg

NAME
    stmfPostProxyMsg

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include <libstmf.h>

    int stmfPostProxyMsg(int hdl, void *buf, uint32_t buflen)

PARAMETERS
    hdl         Returned in a previous successful call to
                stmfInitProxyDoor(3STMF)

    buf         Pointer to buffer to received from peer node

    buflen      length of buf

DESCRIPTION
    The stmfPostProxyMsg() function passes down to the STMF proxy service
    the message received from the peer node's STMF proxy service door upcall.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      hdl is not valid or buf is NULL

    STMF_POST_MSG_FAILED        Failed to post message

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|



4.8 Changes to stmfGetLuProp(3STMF) manpage

       decimal  representation (that is, no leading "0x"). The prop
       argument can be one of the following values:
  
+      STMF_LU_PROP_ACCESS_STATE 
+      
+          Asymmetric access state for the logical unit.
+          Set to one of:
+      
+          "0"   is    Active
+          "1"   is    Transition to Active
+          "2"   is    Standby
+          "3"   is    Transition to Standby
+ 
       STMF_LU_PROP_ALIAS
  
           Up to 255 characters representing a  user  defined  name

4.9 References

    [1] COMSTAR: Common Multiprotocol SCSI Target
        http://sac.sfbay/PSARC/2007/523

    [2] SCSI Primary Commands - 3 (SPC-3) revision 23
        http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc3r23.pdf

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


From dcragun@sonic.net Thu Aug 27 20:47:45 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7S3lje8015883
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 27 Aug 2009 20:47:45 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7S3lU0M014523;
	Thu, 27 Aug 2009 20:47:30 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP200K03IJ6BY00@brm-avmta-1.central.sun.com>; Thu,
 27 Aug 2009 21:47:30 -0600 (MDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP2006VNIJ6PR90@brm-avmta-1.central.sun.com>; Thu,
 27 Aug 2009 21:47:30 -0600 (MDT)
Received: from relay13i.sun.com
 (ip123.net129179-4.block1.us.syntegra.com [129.179.4.123])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n7S3hhXL016904; Fri,
 28 Aug 2009 03:47:29 +0000 (GMT)
Received: from mmp14es.mmp.us.syntegra.com ([160.41.208.14] [160.41.208.14])
 by relay13i.sun.com with ESMTP id BT-MMP-373070; Fri,
 28 Aug 2009 03:47:29 +0000 (Z)
Received: from relay11i.sun.com (relay11i.sun.com [129.179.4.121])
 by mmp14es.mmp.us.syntegra.com with ESMTP id BT-MMP-53746; Fri,
 28 Aug 2009 03:47:29 +0000 (Z)
Received: from a.mail.sonic.net ([64.142.16.245] [64.142.16.245])
 by relay1i.sun.com with ESMTP id BT-MMP-9162827; Fri,
 28 Aug 2009 03:47:29 +0000 (Z)
Received: from [10.0.0.10]
 (76-191-129-144.dsl.dynamic.sonic.net [76.191.129.144])	(authenticated bits=0)
	by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id n7S3lSkU012761;
 Thu, 27 Aug 2009 20:47:28 -0700
Date: Thu, 27 Aug 2009 20:47:28 -0700
From: Don Cragun <dcragun@sonic.net>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
To: John.Forte@sun.com
Cc: PSARC-ext@sun.com
Message-id: <4A975350.6080108@sonic.net>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Status: RO
Content-Length: 3178

On Wed, 26 Aug 2009 16:21:02 -0700 (PDT), John Forte wrote:
  ... ... ...
> 4.2 stmfSetAluaState
> 
> NAME
>     stmfSetAluaState
> 
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
> 
>     int stmfSetAluaState(boolean_t enabled, uint8_t node)
> 
> PARAMETERS
>     enabled     B_TRUE when enabling ALUA mode
>                 B_FALSE when disabling ALUA mode

I'm having trouble understanding what is going on here.  Should "mode"
in the above two lines be "node"?

> 
>     node        Must be the value 0 or 1
> 
> DESCRIPTION
>     The stmfSetAluaState() function sets the Asymmetric Logical Unit Access
>     State (ALUA) mode for STMF. When enabled is set to B_FALSE, node is ignored,
>     otherwise, node must be set to 0 or 1.  The node setting must be different
>     for each node in a paired config. This should be called only after the
>     STMF proxy door service has been initialized(See stmfInitProxyDoor(3STMF)).
>     When the ALUA state is enabled, all STMF logical units will be
>     registered on the peer node as standby logical units. The standby logical
>     units can then be exported to any SCSI initiator using the existing
>     mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
>     subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
>     it is valid to call this interface again with enabled set to B_TRUE.
>     This action would result in a re-initialization of the ALUA mode. This
>     can be used during recovery of a failed peer node.

According to the Note above, it is not an error to call
stmfSetAluaState(B_TRUE, node) to reinitialize node if had it previously
been enabled.

> 
> RETURN VALUES
> 
>     The following values are returned:
> 
>     STMF_ERROR_INVALID_ARG      Either enabled or node was incorrectly set.
> 
>     STMF_STATUS_SUCCESS         The API call was successful

According to the above two lines, stmfSetAluaState() is supposed to
return STMF_ERROR_INVALID_ARG (because it was enabled) and
STMF_STATUS_SUCCESS (if it successfully reinitializes node)???

  ... ... ...
> 
> 4.3 stmfGetAluaState
> 
> NAME
>     stmfGetAluaState
> 
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
> 
>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
> 
> PARAMETERS
>     enabled     set to B_TRUE or B_FALSE on success
> 
>     node        set to 0 or 1 on success
> 
> DESCRIPTION
>     The stmfGetAluaState() function returns the Asymmetric Logical Unit Access
>     State (ALUA) mode for STMF along with the node setting.
> 
> RETURN VALUES
> 
>     The following values are returned:
> 
>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
> 
>     STMF_STATUS_SUCCESS         The API call was successful

So, if I call stmfSetAluaState(B_TRUE, 0) and stmfSetAluaState(B_TRUE,
1) and then call stmfGetAluaState(&state, &node) what is it supposed to
do?  On which node is it going to report?  Since both nodes have been
enabled, it says that it is going to return STMF_ERROR_INVALID_ARG.
But if it successfully sets state and node, it also says it will return
STMF_STATUS_SUCCESS???

  - Don

From John.Forte@sun.com Thu Aug 27 21:23:23 2009
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7S4NMfg016670
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 27 Aug 2009 21:23:23 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id n7S4NIDt028825
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Fri, 28 Aug 2009 12:23:22 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP200D01K6VXD00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 27 Aug 2009 21:23:19 -0700 (PDT)
Received: from brmea-mail-2.sun.com ([192.18.98.43])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP20054GK6UFX40@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Thu,
 27 Aug 2009 21:23:18 -0700 (PDT)
Received: from fe-amer-10.sun.com ([192.18.109.80])
	by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n7S4NIfZ018497	for
 <PSARC-ext@sun.com>; Fri, 28 Aug 2009 04:23:18 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KP200L00K4AZ500@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 27 Aug 2009 22:23:18 -0600 (MDT)
Received: from john-fortes-macbook-pro.local ([unknown] [71.139.20.162])
 by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KP200IUGK6LUP10@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 27 Aug 2009 22:23:18 -0600 (MDT)
Date: Thu, 27 Aug 2009 21:19:53 -0700
From: John Forte <John.Forte@sun.com>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <4A975350.6080108@sonic.net>
Sender: John.Forte@sun.com
To: Don Cragun <dcragun@sonic.net>
Cc: PSARC-ext@sun.com
Message-id: <4A975AE9.7010201@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
 <4A975350.6080108@sonic.net>
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Status: RO
Content-Length: 4298

Don Cragun wrote:
> On Wed, 26 Aug 2009 16:21:02 -0700 (PDT), John Forte wrote:
>  ... ... ...
>> 4.2 stmfSetAluaState
>>
>> NAME
>>     stmfSetAluaState
>>
>> SYNOPSIS
>>     cc [ flag... ] file... -lstmf [ library... ]
>>     #include <libstmf.h>
>>
>>     int stmfSetAluaState(boolean_t enabled, uint8_t node)
>>
>> PARAMETERS
>>     enabled     B_TRUE when enabling ALUA mode
>>                 B_FALSE when disabling ALUA mode
>
> I'm having trouble understanding what is going on here.  Should "mode"
> in the above two lines be "node"?
No, but the word "mode" could easily be replaced by "state" and perhaps 
should.
>
>>
>>     node        Must be the value 0 or 1
>>
>> DESCRIPTION
>>     The stmfSetAluaState() function sets the Asymmetric Logical Unit 
>> Access
>>     State (ALUA) mode for STMF. When enabled is set to B_FALSE, node 
>> is ignored,
>>     otherwise, node must be set to 0 or 1.  The node setting must be 
>> different
>>     for each node in a paired config. This should be called only 
>> after the
>>     STMF proxy door service has been initialized(See 
>> stmfInitProxyDoor(3STMF)).
>>     When the ALUA state is enabled, all STMF logical units will be
>>     registered on the peer node as standby logical units. The standby 
>> logical
>>     units can then be exported to any SCSI initiator using the existing
>>     mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
>>     subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
>>     it is valid to call this interface again with enabled set to B_TRUE.
>>     This action would result in a re-initialization of the ALUA mode. 
>> This
>>     can be used during recovery of a failed peer node.
>
> According to the Note above, it is not an error to call
> stmfSetAluaState(B_TRUE, node) to reinitialize node if had it previously
> been enabled.
Correct.
>
>>
>> RETURN VALUES
>>
>>     The following values are returned:
>>
>>     STMF_ERROR_INVALID_ARG      Either enabled or node was 
>> incorrectly set.
>>
>>     STMF_STATUS_SUCCESS         The API call was successful
>
> According to the above two lines, stmfSetAluaState() is supposed to
> return STMF_ERROR_INVALID_ARG (because it was enabled) and
> STMF_STATUS_SUCCESS (if it successfully reinitializes node)???
I don't think it says that. STMF_ERROR_INVALID_ARG would be returned if 
node was neither 0 or 1.

Perhaps it would be clearer if it was:

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      Either "enabled" or "node" was 
incorrectly set.
   
?


>
>  ... ... ...
>>
>> 4.3 stmfGetAluaState
>>
>> NAME
>>     stmfGetAluaState
>>
>> SYNOPSIS
>>     cc [ flag... ] file... -lstmf [ library... ]
>>     #include <libstmf.h>
>>
>>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>>
>> PARAMETERS
>>     enabled     set to B_TRUE or B_FALSE on success
>>
>>     node        set to 0 or 1 on success
>>
>> DESCRIPTION
>>     The stmfGetAluaState() function returns the Asymmetric Logical 
>> Unit Access
>>     State (ALUA) mode for STMF along with the node setting.
>>
>> RETURN VALUES
>>
>>     The following values are returned:
>>
>>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>>
>>     STMF_STATUS_SUCCESS         The API call was successful
>
> So, if I call stmfSetAluaState(B_TRUE, 0) and stmfSetAluaState(B_TRUE,
> 1) and then call stmfGetAluaState(&state, &node) what is it supposed to
> do?
Return the last node id set, which in this case would be 1 along with a 
state of B_TRUE.
> On which node is it going to report?  Since both nodes have been
> enabled, it says that it is going to return STMF_ERROR_INVALID_ARG.
STMF_ERROR_INVALID_ARG is only returned when the arguments are invalid. 
As long as "enabled" is B_TRUE or B_FALSE and "node" is either 0 or 1, 
that error would not be returned.

To make this clear, "node" is just an identifier for the stmf instance 
on which the set ALUA state is executed. It isn't a target for the 
execution of the set ALUA state, i.e. the set is not setting the state 
for node 0 or node 1, it's setting the state AND setting the node 
identifier to 0 or 1.
> But if it successfully sets state and node, it also says it will return
> STMF_STATUS_SUCCESS???
Yes, it's just another state change.

- John

From dcragun@sonic.net Sat Aug 29 20:14:42 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7U3Eg29025770
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 29 Aug 2009 20:14:42 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n7U3EZeu022456;
	Sun, 30 Aug 2009 04:14:40 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP600E036CGHG00@nwk-avmta-2.sfbay.sun.com>; Sat,
 29 Aug 2009 20:14:40 -0700 (PDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP6009XD6CF8R10@nwk-avmta-2.sfbay.sun.com>; Sat,
 29 Aug 2009 20:14:39 -0700 (PDT)
Received: from relay42i.sun.com ([192.5.209.72])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n7U3BNp7010500; Sun,
 30 Aug 2009 03:14:39 +0000 (GMT)
Received: from mms49es.mms.us.syntegra.com ([160.41.221.232] [160.41.221.232])
 by relay42i.sun.com with ESMTP id BT-MMP-184691; Sun,
 30 Aug 2009 03:14:24 +0000 (Z)
Received: from relay42i.sun.com (relay42i.sun.com [192.5.209.72])
 by mms49es.mms.us.syntegra.com with ESMTP id BT-MMP-2345304; Sun,
 30 Aug 2009 03:12:23 +0000 (Z)
Received: from a.mail.sonic.net ([64.142.16.245] [64.142.16.245])
 by relay4i.sun.com with ESMTP id BT-MMP-3217560; Sun,
 30 Aug 2009 03:12:23 +0000 (Z)
Received: from [10.0.0.10]
 (76-191-129-144.dsl.dynamic.sonic.net [76.191.129.144])	(authenticated bits=0)
	by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id n7U3CM2k023376;
 Sat, 29 Aug 2009 20:12:22 -0700
Date: Sat, 29 Aug 2009 20:12:22 -0700
From: Don Cragun <dcragun@sonic.net>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <4A975AE9.7010201@sun.com>
To: John Forte <John.Forte@sun.com>
Cc: PSARC-ext@sun.com
Message-id: <4A99EE16.8070701@sonic.net>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-0.2/5.0, scanned in 0.196sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
 <4A975350.6080108@sonic.net> <4A975AE9.7010201@sun.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Status: RO
Content-Length: 5767

John Forte wrote:
> Don Cragun wrote:
>> On Wed, 26 Aug 2009 16:21:02 -0700 (PDT), John Forte wrote:
>>  ... ... ...
>>> 4.2 stmfSetAluaState
>>>
>>> NAME
>>>     stmfSetAluaState
>>>
>>> SYNOPSIS
>>>     cc [ flag... ] file... -lstmf [ library... ]
>>>     #include <libstmf.h>
>>>
>>>     int stmfSetAluaState(boolean_t enabled, uint8_t node)
>>>
>>> PARAMETERS
>>>     enabled     B_TRUE when enabling ALUA mode
>>>                 B_FALSE when disabling ALUA mode
>>
>> I'm having trouble understanding what is going on here.  Should "mode"
>> in the above two lines be "node"?
> No, but the word "mode" could easily be replaced by "state" and perhaps 
> should.

Ok.  The way it is seems ambiguous to me.  It seems like you're trying
to set the state of the specified "node" to be enabled or disabled
depending on the value of "enabled" and if the value of "enabled" is
B_TRUE, you're also enabling ALUA.

>>
>>>
>>>     node        Must be the value 0 or 1
>>>
>>> DESCRIPTION
>>>     The stmfSetAluaState() function sets the Asymmetric Logical Unit 
>>> Access
>>>     State (ALUA) mode for STMF. When enabled is set to B_FALSE, node 
>>> is ignored,
>>>     otherwise, node must be set to 0 or 1.  The node setting must be 
>>> different
>>>     for each node in a paired config. This should be called only 
>>> after the
>>>     STMF proxy door service has been initialized(See 
>>> stmfInitProxyDoor(3STMF)).
>>>     When the ALUA state is enabled, all STMF logical units will be
>>>     registered on the peer node as standby logical units. The standby 
>>> logical
>>>     units can then be exported to any SCSI initiator using the existing
>>>     mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
>>>     subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
>>>     it is valid to call this interface again with enabled set to B_TRUE.
>>>     This action would result in a re-initialization of the ALUA mode. 
>>> This
>>>     can be used during recovery of a failed peer node.
>>
>> According to the Note above, it is not an error to call
>> stmfSetAluaState(B_TRUE, node) to reinitialize node if had it previously
>> been enabled.
> Correct.

OK.  Good.

>>
>>>
>>> RETURN VALUES
>>>
>>>     The following values are returned:
>>>
>>>     STMF_ERROR_INVALID_ARG      Either enabled or node was 
>>> incorrectly set.
>>>
>>>     STMF_STATUS_SUCCESS         The API call was successful
>>
>> According to the above two lines, stmfSetAluaState() is supposed to
>> return STMF_ERROR_INVALID_ARG (because it was enabled) and
>> STMF_STATUS_SUCCESS (if it successfully reinitializes node)???
> I don't think it says that. STMF_ERROR_INVALID_ARG would be returned if 
> node was neither 0 or 1.

OK.  I see what you're trying to do now.  By not having italics to
indicate that "enabled" was the function call argument as opposed to the
state of the node, I misread what the error was.  If you changed to
argument name from "enabled" to "enable" it might be less confusing.

On most systems, an argument of type boolean_t can only assume two
values; false (== 0) and true (!= 0) and in that case it is hard to get
an incorrectly set boolean value.  If you're really checking for B_FALSE
and B_TRUE instead of 0 and non-zero, it is OK.

> 
> Perhaps it would be clearer if it was:
> 
> RETURN VALUES
> 
>    The following values are returned:
> 
>    STMF_ERROR_INVALID_ARG      Either "enabled" or "node" was 
> incorrectly set.
>   ?
> 
> 
>>
>>  ... ... ...
>>>
>>> 4.3 stmfGetAluaState
>>>
>>> NAME
>>>     stmfGetAluaState
>>>
>>> SYNOPSIS
>>>     cc [ flag... ] file... -lstmf [ library... ]
>>>     #include <libstmf.h>
>>>
>>>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>>>
>>> PARAMETERS
>>>     enabled     set to B_TRUE or B_FALSE on success
>>>
>>>     node        set to 0 or 1 on success
>>>
>>> DESCRIPTION
>>>     The stmfGetAluaState() function returns the Asymmetric Logical 
>>> Unit Access
>>>     State (ALUA) mode for STMF along with the node setting.
>>>
>>> RETURN VALUES
>>>
>>>     The following values are returned:
>>>
>>>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>>>
>>>     STMF_STATUS_SUCCESS         The API call was successful
>>
>> So, if I call stmfSetAluaState(B_TRUE, 0) and stmfSetAluaState(B_TRUE,
>> 1) and then call stmfGetAluaState(&state, &node) what is it supposed to
>> do?
> Return the last node id set, which in this case would be 1 along with a 
> state of B_TRUE.

I understand what you're doing now, but I still find "disabled" in this
presentation mode ambiguous.  I read it as "Either the node (or the
ALUA) is enabled, or the value of node is a null pointer."
Obviously, if either argument is a pointer to any correctly aligned
valid address this will write over whatever is there.  Is there any
error reserved for a pointer to unallocated space (other than a null
pointer), or is the expected result in that case memory fault - core
dumped?

  - Don

>> On which node is it going to report?  Since both nodes have been
>> enabled, it says that it is going to return STMF_ERROR_INVALID_ARG.
> STMF_ERROR_INVALID_ARG is only returned when the arguments are invalid. 
> As long as "enabled" is B_TRUE or B_FALSE and "node" is either 0 or 1, 
> that error would not be returned.
> 
> To make this clear, "node" is just an identifier for the stmf instance 
> on which the set ALUA state is executed. It isn't a target for the 
> execution of the set ALUA state, i.e. the set is not setting the state 
> for node 0 or node 1, it's setting the state AND setting the node 
> identifier to 0 or 1.
>> But if it successfully sets state and node, it also says it will return
>> STMF_STATUS_SUCCESS???
> Yes, it's just another state change.
> 
> - John


From John.Forte@Sun.COM Sat Aug 29 20:57:03 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7U3v2kO006967
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 29 Aug 2009 20:57:03 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n7U3v236018171
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Sun, 30 Aug 2009 04:57:02 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP600A018AWJ000@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 20:56:56 -0700 (PDT)
Received: from brmea-mail-2.sun.com ([192.18.98.43])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP600AMP8AW9SE0@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Sat,
 29 Aug 2009 20:56:56 -0700 (PDT)
Received: from fe-amer-09.sun.com ([192.18.109.79])
	by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n7U3uurB012664	for
 <PSARC-ext@sun.com>; Sun, 30 Aug 2009 03:56:56 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KP600J0082H1A00@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 21:56:55 -0600 (MDT)
Received: from john-fortes-macbook-pro.local ([unknown] [71.139.30.171])
 by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KP6001828AVK680@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 21:56:55 -0600 (MDT)
Date: Sat, 29 Aug 2009 20:53:40 -0700
From: John Forte <John.Forte@Sun.COM>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <4A99EE16.8070701@sonic.net>
Sender: John.Forte@Sun.COM
To: Don Cragun <dcragun@sonic.net>
Cc: PSARC-ext@Sun.COM
Message-id: <4A99F7C4.5020200@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
 <4A975350.6080108@sonic.net> <4A975AE9.7010201@sun.com>
 <4A99EE16.8070701@sonic.net>
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Status: RO
Content-Length: 1713

Don Cragun wrote:
>>>>
>>>> 4.3 stmfGetAluaState
>>>>
>>>> NAME
>>>>     stmfGetAluaState
>>>>
>>>> SYNOPSIS
>>>>     cc [ flag... ] file... -lstmf [ library... ]
>>>>     #include <libstmf.h>
>>>>
>>>>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>>>>
>>>> PARAMETERS
>>>>     enabled     set to B_TRUE or B_FALSE on success
>>>>
>>>>     node        set to 0 or 1 on success
>>>>
>>>> DESCRIPTION
>>>>     The stmfGetAluaState() function returns the Asymmetric Logical 
>>>> Unit Access
>>>>     State (ALUA) mode for STMF along with the node setting.
>>>>
>>>> RETURN VALUES
>>>>
>>>>     The following values are returned:
>>>>
>>>>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>>>>
>>>>     STMF_STATUS_SUCCESS         The API call was successful
>>>
>>> So, if I call stmfSetAluaState(B_TRUE, 0) and stmfSetAluaState(B_TRUE,
>>> 1) and then call stmfGetAluaState(&state, &node) what is it supposed to
>>> do?
>> Return the last node id set, which in this case would be 1 along with 
>> a state of B_TRUE.
>
> I understand what you're doing now, but I still find "disabled" in this
> presentation mode ambiguous.  I read it as "Either the node (or the
> ALUA) is enabled, or the value of node is a null pointer."
I think you've lost me. If "node" is NULL, it's an error. There is no 
ambiguity there. If the ALUA state is disabled, "enabled" is set to 
B_FALSE.
> Obviously, if either argument is a pointer to any correctly aligned
> valid address this will write over whatever is there.  Is there any
> error reserved for a pointer to unallocated space (other than a null
> pointer), or is the expected result in that case memory fault - core
> dumped?
Core dump.

- John

From dcragun@sonic.net Sat Aug 29 21:15:57 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7U4FuE6007189
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 29 Aug 2009 21:15:56 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n7U4FqP9025081;
	Sun, 30 Aug 2009 05:15:54 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP600I0T96CHY00@nwk-avmta-2.sfbay.sun.com>; Sat,
 29 Aug 2009 21:15:48 -0700 (PDT)
Received: from sca-ea-mail-2.sun.com ([192.18.43.25])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP6009D79688O30@nwk-avmta-2.sfbay.sun.com>; Sat,
 29 Aug 2009 21:15:44 -0700 (PDT)
Received: from relay11i.sun.com
 (ip121.net129179-4.block1.us.syntegra.com [129.179.4.121])
	by sca-ea-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7U48XMq015037;
 Sun, 30 Aug 2009 04:15:44 +0000 (GMT)
Received: from mmp11es.mmp.us.syntegra.com ([160.41.208.11] [160.41.208.11])
 by relay11i.sun.com with ESMTP id BT-MMP-492989; Sun,
 30 Aug 2009 04:15:44 +0000 (Z)
Received: from relay13i.sun.com (relay13i.sun.com [129.179.4.123])
 by mmp11es.mmp.us.syntegra.com with ESMTP id BT-MMP-3802215; Sun,
 30 Aug 2009 04:15:43 +0000 (Z)
Received: from b.mail.sonic.net ([64.142.19.5] [64.142.19.5])
 by relay1i.sun.com with ESMTP id BT-MMP-14272016; Sun,
 30 Aug 2009 04:15:43 +0000 (Z)
Received: from [10.0.0.10]
 (76-191-129-144.dsl.dynamic.sonic.net [76.191.129.144])	(authenticated bits=0)
	by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id n7U4FhgT029591;
 Sat, 29 Aug 2009 21:15:43 -0700
Date: Sat, 29 Aug 2009 21:15:42 -0700
From: Don Cragun <dcragun@sonic.net>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <4A99F7C4.5020200@sun.com>
To: John Forte <John.Forte@sun.com>
Cc: PSARC-ext@sun.com
Message-id: <4A99FCEE.7060306@sonic.net>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
 <4A975350.6080108@sonic.net> <4A975AE9.7010201@sun.com>
 <4A99EE16.8070701@sonic.net> <4A99F7C4.5020200@sun.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Status: RO
Content-Length: 2328

John Forte wrote:
> Don Cragun wrote:
>>>>>
>>>>> 4.3 stmfGetAluaState
>>>>>
>>>>> NAME
>>>>>     stmfGetAluaState
>>>>>
>>>>> SYNOPSIS
>>>>>     cc [ flag... ] file... -lstmf [ library... ]
>>>>>     #include <libstmf.h>
>>>>>
>>>>>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>>>>>
>>>>> PARAMETERS
>>>>>     enabled     set to B_TRUE or B_FALSE on success
>>>>>
>>>>>     node        set to 0 or 1 on success
>>>>>
>>>>> DESCRIPTION
>>>>>     The stmfGetAluaState() function returns the Asymmetric Logical 
>>>>> Unit Access
>>>>>     State (ALUA) mode for STMF along with the node setting.
>>>>>
>>>>> RETURN VALUES
>>>>>
>>>>>     The following values are returned:
>>>>>
>>>>>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>>>>>
>>>>>     STMF_STATUS_SUCCESS         The API call was successful
>>>>
>>>> So, if I call stmfSetAluaState(B_TRUE, 0) and stmfSetAluaState(B_TRUE,
>>>> 1) and then call stmfGetAluaState(&state, &node) what is it supposed to
>>>> do?
>>> Return the last node id set, which in this case would be 1 along with 
>>> a state of B_TRUE.
>>
>> I understand what you're doing now, but I still find "disabled" in this
>> presentation mode ambiguous.  I read it as "Either the node (or the
>> ALUA) is enabled, or the value of node is a null pointer."
> I think you've lost me. If "node" is NULL, it's an error. There is no 
> ambiguity there. If the ALUA state is disabled, "enabled" is set to 
> B_FALSE.

The ambiguity is whether "enabled" is referring to the state of the ALUA
or to the value of the parameter.  If this was presented in a form where
"enabled" was in italics to clearly note that you are talking about the
parameter; it would be clear.  But, on an ASCII man page, there are no
italics.  Your description of these functions talks about the state of
the ALUA being enabled or disabled and uses a parameter named enabled to
specify this.  This makes your description of the STMF_ERROR_INVALID_ARG
condition ambiguous.

  - Don

>> Obviously, if either argument is a pointer to any correctly aligned
>> valid address this will write over whatever is there.  Is there any
>> error reserved for a pointer to unallocated space (other than a null
>> pointer), or is the expected result in that case memory fault - core
>> dumped?
> Core dump.
> 
> - John


From John.Forte@Sun.COM Sat Aug 29 21:39:25 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7U4dPSo007247
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 29 Aug 2009 21:39:25 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7U4dPF7026822
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Sat, 29 Aug 2009 22:39:25 -0600 (MDT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP600J05A9OZ900@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 21:39:24 -0700 (PDT)
Received: from brmea-mail-4.sun.com ([192.18.98.36])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP60090JA9O8O40@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Sat,
 29 Aug 2009 21:39:24 -0700 (PDT)
Received: from fe-amer-10.sun.com ([192.18.109.80])
	by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n7U4dOXx013289	for
 <PSARC-ext@sun.com>; Sun, 30 Aug 2009 04:39:24 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KP600F009YBV200@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 22:39:24 -0600 (MDT)
Received: from john-fortes-macbook-pro.local ([unknown] [71.139.32.205])
 by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KP600DLNA9NO6B0@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 22:39:24 -0600 (MDT)
Date: Sat, 29 Aug 2009 21:36:07 -0700
From: John Forte <John.Forte@Sun.COM>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <4A99FCEE.7060306@sonic.net>
Sender: John.Forte@Sun.COM
To: Don Cragun <dcragun@sonic.net>
Cc: PSARC-ext@Sun.COM
Message-id: <4A9A01B7.5090601@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
 <4A975350.6080108@sonic.net> <4A975AE9.7010201@sun.com>
 <4A99EE16.8070701@sonic.net> <4A99F7C4.5020200@sun.com>
 <4A99FCEE.7060306@sonic.net>
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Status: RO
Content-Length: 2358

Don Cragun wrote:
> John Forte wrote:
>> Don Cragun wrote:
>>>>>>
>>>>>> 4.3 stmfGetAluaState
>>>>>>
>>>>>> NAME
>>>>>>     stmfGetAluaState
>>>>>>
>>>>>> SYNOPSIS
>>>>>>     cc [ flag... ] file... -lstmf [ library... ]
>>>>>>     #include <libstmf.h>
>>>>>>
>>>>>>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>>>>>>
>>>>>> PARAMETERS
>>>>>>     enabled     set to B_TRUE or B_FALSE on success
>>>>>>
>>>>>>     node        set to 0 or 1 on success
>>>>>>
>>>>>> DESCRIPTION
>>>>>>     The stmfGetAluaState() function returns the Asymmetric 
>>>>>> Logical Unit Access
>>>>>>     State (ALUA) mode for STMF along with the node setting.
>>>>>>
>>>>>> RETURN VALUES
>>>>>>
>>>>>>     The following values are returned:
>>>>>>
>>>>>>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>>>>>>
>>>>>>     STMF_STATUS_SUCCESS         The API call was successful
>>>>>
>>>>> So, if I call stmfSetAluaState(B_TRUE, 0) and 
>>>>> stmfSetAluaState(B_TRUE,
>>>>> 1) and then call stmfGetAluaState(&state, &node) what is it 
>>>>> supposed to
>>>>> do?
>>>> Return the last node id set, which in this case would be 1 along 
>>>> with a state of B_TRUE.
>>>
>>> I understand what you're doing now, but I still find "disabled" in this
>>> presentation mode ambiguous.  I read it as "Either the node (or the
>>> ALUA) is enabled, or the value of node is a null pointer."
>> I think you've lost me. If "node" is NULL, it's an error. There is no 
>> ambiguity there. If the ALUA state is disabled, "enabled" is set to 
>> B_FALSE.
>
> The ambiguity is whether "enabled" is referring to the state of the ALUA
> or to the value of the parameter.  If this was presented in a form where
> "enabled" was in italics to clearly note that you are talking about the
> parameter; it would be clear.  But, on an ASCII man page, there are no
> italics.  Your description of these functions talks about the state of
> the ALUA being enabled or disabled and uses a parameter named enabled to
> specify this.  This makes your description of the STMF_ERROR_INVALID_ARG
> condition ambiguous.
>
I didn't realize that you were talking about the RETURN VALUES section. 
I'll change the argument name to "state" but on a call to get the state, 
I'm not sure how else that word "enabled" could be interpreted in the 
context of an invalid argument.

- John

- John


From John.Forte@sun.com Tue Sep  1 15:02:29 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n81M2Sew024639
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 1 Sep 2009 15:02:28 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n81M2I44027359
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 1 Sep 2009 23:02:27 +0100 (BST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KPB00805BW3VJ00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 01 Sep 2009 16:02:27 -0600 (MDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KPB0051KBW2C220@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 01 Sep 2009 16:02:26 -0600 (MDT)
Received: from fe-amer-10.sun.com ([192.18.109.80])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n81M2QXU014591	for
 <PSARC-ext@sun.com>; Tue, 01 Sep 2009 22:02:26 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KPB00G00AVLR900@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 01 Sep 2009 16:02:26 -0600 (MDT)
Received: from [129.146.56.52] ([unknown] [129.146.56.52])
 by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit
 (built Jul  2 2009)) with ESMTPSA id <0KPB00GI4BVKCJ90@mail-amer.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 01 Sep 2009 16:02:09 -0600 (MDT)
Date: Tue, 01 Sep 2009 14:59:25 -0700
From: John Forte <John.Forte@sun.com>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack,
 timeout 09/02/2009] (John Forte)
In-reply-to: <4A9A01B7.5090601@sun.com>
Sender: John.Forte@sun.com
To: Don Cragun <dcragun@sonic.net>
Cc: John Forte <John.Forte@sun.com>, PSARC-ext@sun.com
Message-id: <4A9D993D.5060201@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <mailman.768.1251333011.10227.opensolaris-arc@opensolaris.org>
 <4A975350.6080108@sonic.net> <4A975AE9.7010201@sun.com>
 <4A99EE16.8070701@sonic.net> <4A99F7C4.5020200@sun.com>
 <4A99FCEE.7060306@sonic.net> <4A9A01B7.5090601@sun.com>
User-Agent: Thunderbird 2.0.0.17 (X11/20081014)
Status: RO
Content-Length: 473

John Forte wrote:
> I didn't realize that you were talking about the RETURN VALUES 
> section. I'll change the argument name to "state" but on a call to get 
> the state, I'm not sure how else that word "enabled" could be 
> interpreted in the context of an invalid argument.
>
Just to close on this, I've updated the fasttrack to change the argument 
name from "alua" to "aluaEnabled" to avoid any ambiguity. The updated 
fasttrack is in the materials directory.

- John


From Mark.Carlson@Sun.COM Tue Sep  8 09:49:15 2009
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n88GnFu9018776
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 8 Sep 2009 09:49:15 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n88Gn8Pe009707
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 8 Sep 2009 09:49:14 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KPN0042LW20ZH00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 08 Sep 2009 10:49:12 -0600 (MDT)
Received: from brmea-mail-4.sun.com ([192.18.98.36])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KPN00DBEW1YZKF0@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 08 Sep 2009 10:49:11 -0600 (MDT)
Received: from fe-amer-10.sun.com ([192.18.109.80])
	by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n88GnAwG002704	for
 <PSARC-ext@sun.com>; Tue, 08 Sep 2009 16:49:10 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KPN00C00QRUUL00@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 08 Sep 2009 10:49:10 -0600 (MDT)
Received: from Macintosh-335.local ([unknown] [129.150.33.124])
 by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KPN000C1W1XYT30@mail-amer.sun.com>; Tue,
 08 Sep 2009 10:49:09 -0600 (MDT)
Date: Tue, 08 Sep 2009 10:49:08 -0600
From: "Mark A. Carlson" <Mark.Carlson@Sun.COM>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack
 timeout	09/02/2009]
In-reply-to: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
Sender: Mark.Carlson@Sun.COM
To: John Forte <jforte@sac.sfbay.sun.com>
Cc: PSARC-ext@Sun.COM, John.Forte@Sun.COM
Message-id: <4AA68B04.9010400@sun.com>
MIME-version: 1.0
Content-type: multipart/alternative;
 boundary="Boundary_(ID_TBRPT+2Dv0u6mDHAYbNVFA)"
X-PMX-Version: 5.4.1.325704
References: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Status: RO
Content-Length: 28040

This is a multi-part message in MIME format.

--Boundary_(ID_TBRPT+2Dv0u6mDHAYbNVFA)
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT

+1

-- mark

John Forte wrote:
> I am sponsoring the following fasttrack for myself. Requested binding is
> minor. Timeout is set for 9/02.
>
> - John
>
>
> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
> This information is Copyright 2009 Sun Microsystems
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 COMSTAR ALUA active/standby support
>     1.2. Name of Document Author/Supplier:
> 	 Author:  John Forte
>     1.3  Date of This Document:
> 	26 August, 2009
> 4. Technical Description
>
> COMSTAR (PSARC 2007/523 [1]) supports the SCSI standard [2] for Asymmetric 
> Logical Unit Access (ALUA) but only supports the access state of 
> Active/Optimized. This set of interfaces introduces support for a logical unit
> access state of Standby on a peer node. This support is provided via the
> existing libstmf(3LIB) introduced in PSARC 2007/253 and is targeted towards
> developers of clustered storage systems in 2 node configurations. Use of these 
> interfaces require a peer-to-peer communication channel be established between 
> the two participating nodes in the COMSTAR (STMF) ALUA configuration.
>
>
> 4.1 Interfaces
>
>     Minor binding.
>
>         -------------+-----------------------+-------------------------
>         Interface        Classification         Comments
>         -------------+-----------------------+-------------------------
>         libstmf      |   Committed           |  PSARC 2007/523
>
>
> 4.2 stmfSetAluaState
>
> NAME
>     stmfSetAluaState
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfSetAluaState(boolean_t enabled, uint8_t node)
>
> PARAMETERS
>     enabled     B_TRUE when enabling ALUA mode
>                 B_FALSE when disabling ALUA mode
>
>     node        Must be the value 0 or 1
>
> DESCRIPTION
>     The stmfSetAluaState() function sets the Asymmetric Logical Unit Access
>     State (ALUA) mode for STMF. When enabled is set to B_FALSE, node is ignored,
>     otherwise, node must be set to 0 or 1.  The node setting must be different
>     for each node in a paired config. This should be called only after the
>     STMF proxy door service has been initialized(See stmfInitProxyDoor(3STMF)).
>     When the ALUA state is enabled, all STMF logical units will be
>     registered on the peer node as standby logical units. The standby logical
>     units can then be exported to any SCSI initiator using the existing
>     mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
>     subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
>     it is valid to call this interface again with enabled set to B_TRUE.
>     This action would result in a re-initialization of the ALUA mode. This
>     can be used during recovery of a failed peer node.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_INVALID_ARG      Either enabled or node was incorrectly set.
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
> 4.3 stmfGetAluaState
>
> NAME
>     stmfGetAluaState
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>
> PARAMETERS
>     enabled     set to B_TRUE or B_FALSE on success
>
>     node        set to 0 or 1 on success
>
> DESCRIPTION
>     The stmfGetAluaState() function returns the Asymmetric Logical Unit Access
>     State (ALUA) mode for STMF along with the node setting.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
>
> 4.4 stmfLuStandby
>
> NAME
>     stmfLuStandby
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfLuStandby(stmfGuid *luGuid)
>
> PARAMETERS
>     luGuid      a pointer to an stmfGuid structure containing the guid
>                 of the logical unit to set to standby
>
> DESCRIPTION
>     The stmfLuStandby() function sets the access state of a logical unit to
>     standby mode.  When successfully set, a standby logical unit switches its
>     asymmetric logical unit access state to a one of "Transition to
>     Standby" (see stmfGetLuProp(3STMF). Once moved to this state, the backing
>     store for the logical unit will be released by the logical unit provider
>     (sbd for disk devices). In order to move a logical unit out of "Standby"
>     or the "Transition to Standby" state, stmfImportLu(3STMF) or the import-lu
>     subcommand of stmfadm(1M) must be executed on the logical unit. On a
>     successful logical unit import, the access state of the logical unit will
>     move to Active in addition to sending a message to its peer that will
>     complete the peer's transition to Standby. The current access state for
>     the logical unit can be retrieved using stmfGetLuProp(3STMF) where the
>     property type is STMF_LU_PROP_ACCESS_STATE.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_NOT_FOUND        The guid does not exist
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
>
> 4.5 stmfInitProxyDoor
>
> NAME
>     stmfInitProxyDoor
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfInitProxyDoor(int *hdl, int fd);
>
> PARAMETERS
>     hdl         a pointer to an int. This will contain the handle for
>                 the proxy door to be used in calls to
>                 stmfPostProxyMsg(3STMF) and stmfDestroyProxyDoor(3STMF)
>
>     fd          The door file descriptor for the established door server
>
> DESCRIPTION
>     The stmfInitProxyDoor() function establishes the door server with the
>     STMF proxy service. The STMF proxy service is responsible for sending
>     SCSI commands to the peer node on behalf of a logical unit in the Standby
>     asymmetric logical unit access (ALUA) state. stmfInitProxyDoor(3STMF)
>     should be called once a peer-to-peer communication channel between the two
>     participating ALUA nodes has been established by the caller.
>
>     Door server interface:
>
>     The door_call from the STMF proxy service to the door server will fill in
>     the door_arg_t structure as follows:
>
>         door_arg_t arg;
>         uint32_t result;
>
>         arg.data_ptr = buf;
>         arg.data_size = size;
>         arg.desc_ptr = NULL;
>         arg.desc_num = 0;
>         arg.rbuf = (char *)&result;
>         arg.rsize = sizeof (result);
>
>         The tuple <data_ptr, data_size> is expected to arrive at the
>         peer node STMF proxy service via stmfPostProxyMsg(3STMF).
>
>     The door server is expected to complete the door call with these
>     arguments to door_return:
>
>          uinit32_t result;
>
>          (void) door_return((char *)&result, sizeof(result), NULL, 0);
>
>     where result is of type uint32_t and set to 0 on success, non-zero
>     on failure.
>
>     Non-zero values are logged as errors without further action. No file
>     descriptors will be exchanged by the door call or return.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_DOOR_INSTALLED   A previous door has already been
>                                 established.
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
> 4.6 stmfDestroyProxyDoor
>
> NAME
>     stmfDestroyProxyDoor
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     void stmfDestroyProxyDoor(int hdl);
>
> PARAMETERS
>     hdl         hdl returned from a previous call to
>                 stmfInitProxyDoor(3STMF)
>
> DESCRIPTION
>     The stmfDestroyProxyDoor() function closes the door interface
>     established in the call to stmfInitProxyDoor().
>
> RETURN VALUES
>
>     None
>
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
> 4.7 stmfPostProxyMsg
>
> NAME
>     stmfPostProxyMsg
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfPostProxyMsg(int hdl, void *buf, uint32_t buflen)
>
> PARAMETERS
>     hdl         Returned in a previous successful call to
>                 stmfInitProxyDoor(3STMF)
>
>     buf         Pointer to buffer to received from peer node
>
>     buflen      length of buf
>
> DESCRIPTION
>     The stmfPostProxyMsg() function passes down to the STMF proxy service
>     the message received from the peer node's STMF proxy service door upcall.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_INVALID_ARG      hdl is not valid or buf is NULL
>
>     STMF_POST_MSG_FAILED        Failed to post message
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
>
> 4.8 Changes to stmfGetLuProp(3STMF) manpage
>
>        decimal  representation (that is, no leading "0x"). The prop
>        argument can be one of the following values:
>   
> +      STMF_LU_PROP_ACCESS_STATE 
> +      
> +          Asymmetric access state for the logical unit.
> +          Set to one of:
> +      
> +          "0"   is    Active
> +          "1"   is    Transition to Active
> +          "2"   is    Standby
> +          "3"   is    Transition to Standby
> + 
>        STMF_LU_PROP_ALIAS
>   
>            Up to 255 characters representing a  user  defined  name
>
> 4.9 References
>
>     [1] COMSTAR: Common Multiprotocol SCSI Target
>         http://sac.sfbay/PSARC/2007/523
>
>     [2] SCSI Primary Commands - 3 (SPC-3) revision 23
>         http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc3r23.pdf
>
> 6. Resources and Schedule
>     6.4. Steering Committee requested information
>    	6.4.1. Consolidation C-team Name:
> 		ON
>     6.5. ARC review type: FastTrack
>     6.6. ARC Exposure: open
>
> _______________________________________________
> opensolaris-arc mailing list
> opensolaris-arc@opensolaris.org
>   

-- 
<http://www.sun.com> 	* Mark A. Carlson *
Sr. Architect

*Systems Group*
Phone x69559 / 303-223-6139
Email Mark.Carlson@Sun.COM
	



--Boundary_(ID_TBRPT+2Dv0u6mDHAYbNVFA)
Content-type: text/html; CHARSET=US-ASCII
Content-transfer-encoding: 7BIT

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1">+1<br>
<br>
-- mark<br>
</font><br>
John Forte wrote:
<blockquote cite="mid:200908262321.n7QNL2vh016458@sac.sfbay.sun.com"
 type="cite">
  <pre wrap="">I am sponsoring the following fasttrack for myself. Requested binding is
minor. Timeout is set for 9/02.

- John


Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 COMSTAR ALUA active/standby support
    1.2. Name of Document Author/Supplier:
	 Author:  John Forte
    1.3  Date of This Document:
	26 August, 2009
4. Technical Description

COMSTAR (PSARC 2007/523 [1]) supports the SCSI standard [2] for Asymmetric 
Logical Unit Access (ALUA) but only supports the access state of 
Active/Optimized. This set of interfaces introduces support for a logical unit
access state of Standby on a peer node. This support is provided via the
existing libstmf(3LIB) introduced in PSARC 2007/253 and is targeted towards
developers of clustered storage systems in 2 node configurations. Use of these 
interfaces require a peer-to-peer communication channel be established between 
the two participating nodes in the COMSTAR (STMF) ALUA configuration.


4.1 Interfaces

    Minor binding.

        -------------+-----------------------+-------------------------
        Interface        Classification         Comments
        -------------+-----------------------+-------------------------
        libstmf      |   Committed           |  PSARC 2007/523


4.2 stmfSetAluaState

NAME
    stmfSetAluaState

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include &lt;libstmf.h&gt;

    int stmfSetAluaState(boolean_t enabled, uint8_t node)

PARAMETERS
    enabled     B_TRUE when enabling ALUA mode
                B_FALSE when disabling ALUA mode

    node        Must be the value 0 or 1

DESCRIPTION
    The stmfSetAluaState() function sets the Asymmetric Logical Unit Access
    State (ALUA) mode for STMF. When enabled is set to B_FALSE, node is ignored,
    otherwise, node must be set to 0 or 1.  The node setting must be different
    for each node in a paired config. This should be called only after the
    STMF proxy door service has been initialized(See stmfInitProxyDoor(3STMF)).
    When the ALUA state is enabled, all STMF logical units will be
    registered on the peer node as standby logical units. The standby logical
    units can then be exported to any SCSI initiator using the existing
    mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
    subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
    it is valid to call this interface again with enabled set to B_TRUE.
    This action would result in a re-initialization of the ALUA mode. This
    can be used during recovery of a failed peer node.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      Either enabled or node was incorrectly set.

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|


4.3 stmfGetAluaState

NAME
    stmfGetAluaState

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include &lt;libstmf.h&gt;

    int stmfGetAluaState(boolean_t *enabled, uint8_t *node)

PARAMETERS
    enabled     set to B_TRUE or B_FALSE on success

    node        set to 0 or 1 on success

DESCRIPTION
    The stmfGetAluaState() function returns the Asymmetric Logical Unit Access
    State (ALUA) mode for STMF along with the node setting.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|



4.4 stmfLuStandby

NAME
    stmfLuStandby

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include &lt;libstmf.h&gt;

    int stmfLuStandby(stmfGuid *luGuid)

PARAMETERS
    luGuid      a pointer to an stmfGuid structure containing the guid
                of the logical unit to set to standby

DESCRIPTION
    The stmfLuStandby() function sets the access state of a logical unit to
    standby mode.  When successfully set, a standby logical unit switches its
    asymmetric logical unit access state to a one of "Transition to
    Standby" (see stmfGetLuProp(3STMF). Once moved to this state, the backing
    store for the logical unit will be released by the logical unit provider
    (sbd for disk devices). In order to move a logical unit out of "Standby"
    or the "Transition to Standby" state, stmfImportLu(3STMF) or the import-lu
    subcommand of stmfadm(1M) must be executed on the logical unit. On a
    successful logical unit import, the access state of the logical unit will
    move to Active in addition to sending a message to its peer that will
    complete the peer's transition to Standby. The current access state for
    the logical unit can be retrieved using stmfGetLuProp(3STMF) where the
    property type is STMF_LU_PROP_ACCESS_STATE.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_NOT_FOUND        The guid does not exist

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|



4.5 stmfInitProxyDoor

NAME
    stmfInitProxyDoor

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include &lt;libstmf.h&gt;

    int stmfInitProxyDoor(int *hdl, int fd);

PARAMETERS
    hdl         a pointer to an int. This will contain the handle for
                the proxy door to be used in calls to
                stmfPostProxyMsg(3STMF) and stmfDestroyProxyDoor(3STMF)

    fd          The door file descriptor for the established door server

DESCRIPTION
    The stmfInitProxyDoor() function establishes the door server with the
    STMF proxy service. The STMF proxy service is responsible for sending
    SCSI commands to the peer node on behalf of a logical unit in the Standby
    asymmetric logical unit access (ALUA) state. stmfInitProxyDoor(3STMF)
    should be called once a peer-to-peer communication channel between the two
    participating ALUA nodes has been established by the caller.

    Door server interface:

    The door_call from the STMF proxy service to the door server will fill in
    the door_arg_t structure as follows:

        door_arg_t arg;
        uint32_t result;

        arg.data_ptr = buf;
        arg.data_size = size;
        arg.desc_ptr = NULL;
        arg.desc_num = 0;
        arg.rbuf = (char *)&amp;result;
        arg.rsize = sizeof (result);

        The tuple &lt;data_ptr, data_size&gt; is expected to arrive at the
        peer node STMF proxy service via stmfPostProxyMsg(3STMF).

    The door server is expected to complete the door call with these
    arguments to door_return:

         uinit32_t result;

         (void) door_return((char *)&amp;result, sizeof(result), NULL, 0);

    where result is of type uint32_t and set to 0 on success, non-zero
    on failure.

    Non-zero values are logged as errors without further action. No file
    descriptors will be exchanged by the door call or return.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_DOOR_INSTALLED   A previous door has already been
                                established.

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|

4.6 stmfDestroyProxyDoor

NAME
    stmfDestroyProxyDoor

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include &lt;libstmf.h&gt;

    void stmfDestroyProxyDoor(int hdl);

PARAMETERS
    hdl         hdl returned from a previous call to
                stmfInitProxyDoor(3STMF)

DESCRIPTION
    The stmfDestroyProxyDoor() function closes the door interface
    established in the call to stmfInitProxyDoor().

RETURN VALUES

    None


ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|


4.7 stmfPostProxyMsg

NAME
    stmfPostProxyMsg

SYNOPSIS
    cc [ flag... ] file... -lstmf [ library... ]
    #include &lt;libstmf.h&gt;

    int stmfPostProxyMsg(int hdl, void *buf, uint32_t buflen)

PARAMETERS
    hdl         Returned in a previous successful call to
                stmfInitProxyDoor(3STMF)

    buf         Pointer to buffer to received from peer node

    buflen      length of buf

DESCRIPTION
    The stmfPostProxyMsg() function passes down to the STMF proxy service
    the message received from the peer node's STMF proxy service door upcall.

RETURN VALUES

    The following values are returned:

    STMF_ERROR_INVALID_ARG      hdl is not valid or buf is NULL

    STMF_POST_MSG_FAILED        Failed to post message

    STMF_STATUS_SUCCESS         The API call was successful

ATTRIBUTES
    See attributes(5) for descriptions of the  following  attributes:

    ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Interface Stability         | Committed                   |
    |_____________________________|_____________________________|
    | MT-Level                    | Safe                        |
    |_____________________________|_____________________________|



4.8 Changes to stmfGetLuProp(3STMF) manpage

       decimal  representation (that is, no leading "0x"). The prop
       argument can be one of the following values:
  
+      STMF_LU_PROP_ACCESS_STATE 
+      
+          Asymmetric access state for the logical unit.
+          Set to one of:
+      
+          "0"   is    Active
+          "1"   is    Transition to Active
+          "2"   is    Standby
+          "3"   is    Transition to Standby
+ 
       STMF_LU_PROP_ALIAS
  
           Up to 255 characters representing a  user  defined  name

4.9 References

    [1] COMSTAR: Common Multiprotocol SCSI Target
        <a class="moz-txt-link-freetext" href="http://sac.sfbay/PSARC/2007/523">http://sac.sfbay/PSARC/2007/523</a>

    [2] SCSI Primary Commands - 3 (SPC-3) revision 23
        <a class="moz-txt-link-freetext" href="http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc3r23.pdf">http://www.t10.org/cgi-bin/ac.pl?t=f&amp;f=spc3r23.pdf</a>

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open

_______________________________________________
opensolaris-arc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:opensolaris-arc@opensolaris.org">opensolaris-arc@opensolaris.org</a>
  </pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<title></title>
<table border="0" cellpadding="0" cellspacing="0" width="519">
  <tbody>
    <tr valign="top">
      <td height="121" width="98"><a moz-do-not-send="true"
 href="http://www.sun.com"><img moz-do-not-send="true"
 src="http://www.sun.com/emrkt/sigs/6h_top.gif" border="0" height="92"
 width="98"></a></td>
      <td style="font-family: Arial; font-size: 10px;" height="121"
 width="249"><b> Mark A. Carlson </b><br>
Sr. Architect<br>
      <br>
      <b>Systems Group</b><br>
Phone x69559 / 303-223-6139<br>
Email <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:Mark.Carlson@Sun.COM">Mark.Carlson@Sun.COM</a><br>
      </td>
      <td style="font-family: Arial; font-size: 10px;" width="172"><img
 moz-do-not-send="true" src="http://www.sun.com/emrkt/sigs/q12.gif"
 height="118" width="172"></td>
    </tr>
  </tbody>
</table>
<div class="moz-signature"><br>
</div>
</div>
</body>
</html>

--Boundary_(ID_TBRPT+2Dv0u6mDHAYbNVFA)--

From gdamore@Sun.COM Tue Sep  8 09:53:07 2009
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n88Gr7RN018873
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 8 Sep 2009 09:53:07 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n88GqvJk011534
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 8 Sep 2009 09:53:07 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KPN00F0PW8IGK00@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.COM); Tue, 08 Sep 2009 09:53:06 -0700 (PDT)
Received: from sca-es-mail-1.sun.com ([192.18.43.132])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KPN00EP1W8HCN10@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.COM); Tue,
 08 Sep 2009 09:53:05 -0700 (PDT)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n88Gr55u006803	for
 <PSARC-ext@Sun.COM>; Tue, 08 Sep 2009 09:53:05 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KPN00F00W6BN100@fe-sfbay-10.sun.com> for PSARC-ext@Sun.COM
 (ORCPT PSARC-ext@Sun.COM); Tue, 08 Sep 2009 09:53:05 -0700 (PDT)
Received: from [192.168.251.11] ([unknown] [76.93.15.33])
 by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KPN00KDGW8FU5D0@fe-sfbay-10.sun.com>; Tue,
 08 Sep 2009 09:53:03 -0700 (PDT)
Date: Tue, 08 Sep 2009 09:53:03 -0700
From: "Garrett D'Amore" <gdamore@Sun.COM>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack
 timeout 09/02/2009]
In-reply-to: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
Sender: Garrett.Damore@Sun.COM
To: John Forte <jforte@sac.sfbay.sun.com>
Cc: PSARC-ext@Sun.COM, John.Forte@Sun.COM
Message-id: <4AA68BEF.9080802@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.18 (X11/20081201)
Status: RO
Content-Length: 13522

I've finally found time to go over the case materials, and the backing 
materials in COMSTAR (PSARC 2007/523).

While I would *prefer* to have someone more familiar with COMSTAR 
itself, as well as the ALUA protocol, help review these materials, I 
can't find any thing obviously wrong with this case, and feel I can 
reasonably give it a +1.

    - Garrett

John Forte wrote:
> I am sponsoring the following fasttrack for myself. Requested binding is
> minor. Timeout is set for 9/02.
>
> - John
>
>
> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
> This information is Copyright 2009 Sun Microsystems
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 COMSTAR ALUA active/standby support
>     1.2. Name of Document Author/Supplier:
> 	 Author:  John Forte
>     1.3  Date of This Document:
> 	26 August, 2009
> 4. Technical Description
>
> COMSTAR (PSARC 2007/523 [1]) supports the SCSI standard [2] for Asymmetric 
> Logical Unit Access (ALUA) but only supports the access state of 
> Active/Optimized. This set of interfaces introduces support for a logical unit
> access state of Standby on a peer node. This support is provided via the
> existing libstmf(3LIB) introduced in PSARC 2007/253 and is targeted towards
> developers of clustered storage systems in 2 node configurations. Use of these 
> interfaces require a peer-to-peer communication channel be established between 
> the two participating nodes in the COMSTAR (STMF) ALUA configuration.
>
>
> 4.1 Interfaces
>
>     Minor binding.
>
>         -------------+-----------------------+-------------------------
>         Interface        Classification         Comments
>         -------------+-----------------------+-------------------------
>         libstmf      |   Committed           |  PSARC 2007/523
>
>
> 4.2 stmfSetAluaState
>
> NAME
>     stmfSetAluaState
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfSetAluaState(boolean_t enabled, uint8_t node)
>
> PARAMETERS
>     enabled     B_TRUE when enabling ALUA mode
>                 B_FALSE when disabling ALUA mode
>
>     node        Must be the value 0 or 1
>
> DESCRIPTION
>     The stmfSetAluaState() function sets the Asymmetric Logical Unit Access
>     State (ALUA) mode for STMF. When enabled is set to B_FALSE, node is ignored,
>     otherwise, node must be set to 0 or 1.  The node setting must be different
>     for each node in a paired config. This should be called only after the
>     STMF proxy door service has been initialized(See stmfInitProxyDoor(3STMF)).
>     When the ALUA state is enabled, all STMF logical units will be
>     registered on the peer node as standby logical units. The standby logical
>     units can then be exported to any SCSI initiator using the existing
>     mechanisms in STMF, stmfAddViewEntry(3STMF) or the add-view
>     subcommand of stmfadm(1M). Note: If ALUA mode is already enabled,
>     it is valid to call this interface again with enabled set to B_TRUE.
>     This action would result in a re-initialization of the ALUA mode. This
>     can be used during recovery of a failed peer node.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_INVALID_ARG      Either enabled or node was incorrectly set.
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
> 4.3 stmfGetAluaState
>
> NAME
>     stmfGetAluaState
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfGetAluaState(boolean_t *enabled, uint8_t *node)
>
> PARAMETERS
>     enabled     set to B_TRUE or B_FALSE on success
>
>     node        set to 0 or 1 on success
>
> DESCRIPTION
>     The stmfGetAluaState() function returns the Asymmetric Logical Unit Access
>     State (ALUA) mode for STMF along with the node setting.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_INVALID_ARG      Either enabled or node was NULL.
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
>
> 4.4 stmfLuStandby
>
> NAME
>     stmfLuStandby
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfLuStandby(stmfGuid *luGuid)
>
> PARAMETERS
>     luGuid      a pointer to an stmfGuid structure containing the guid
>                 of the logical unit to set to standby
>
> DESCRIPTION
>     The stmfLuStandby() function sets the access state of a logical unit to
>     standby mode.  When successfully set, a standby logical unit switches its
>     asymmetric logical unit access state to a one of "Transition to
>     Standby" (see stmfGetLuProp(3STMF). Once moved to this state, the backing
>     store for the logical unit will be released by the logical unit provider
>     (sbd for disk devices). In order to move a logical unit out of "Standby"
>     or the "Transition to Standby" state, stmfImportLu(3STMF) or the import-lu
>     subcommand of stmfadm(1M) must be executed on the logical unit. On a
>     successful logical unit import, the access state of the logical unit will
>     move to Active in addition to sending a message to its peer that will
>     complete the peer's transition to Standby. The current access state for
>     the logical unit can be retrieved using stmfGetLuProp(3STMF) where the
>     property type is STMF_LU_PROP_ACCESS_STATE.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_NOT_FOUND        The guid does not exist
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
>
> 4.5 stmfInitProxyDoor
>
> NAME
>     stmfInitProxyDoor
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfInitProxyDoor(int *hdl, int fd);
>
> PARAMETERS
>     hdl         a pointer to an int. This will contain the handle for
>                 the proxy door to be used in calls to
>                 stmfPostProxyMsg(3STMF) and stmfDestroyProxyDoor(3STMF)
>
>     fd          The door file descriptor for the established door server
>
> DESCRIPTION
>     The stmfInitProxyDoor() function establishes the door server with the
>     STMF proxy service. The STMF proxy service is responsible for sending
>     SCSI commands to the peer node on behalf of a logical unit in the Standby
>     asymmetric logical unit access (ALUA) state. stmfInitProxyDoor(3STMF)
>     should be called once a peer-to-peer communication channel between the two
>     participating ALUA nodes has been established by the caller.
>
>     Door server interface:
>
>     The door_call from the STMF proxy service to the door server will fill in
>     the door_arg_t structure as follows:
>
>         door_arg_t arg;
>         uint32_t result;
>
>         arg.data_ptr = buf;
>         arg.data_size = size;
>         arg.desc_ptr = NULL;
>         arg.desc_num = 0;
>         arg.rbuf = (char *)&result;
>         arg.rsize = sizeof (result);
>
>         The tuple <data_ptr, data_size> is expected to arrive at the
>         peer node STMF proxy service via stmfPostProxyMsg(3STMF).
>
>     The door server is expected to complete the door call with these
>     arguments to door_return:
>
>          uinit32_t result;
>
>          (void) door_return((char *)&result, sizeof(result), NULL, 0);
>
>     where result is of type uint32_t and set to 0 on success, non-zero
>     on failure.
>
>     Non-zero values are logged as errors without further action. No file
>     descriptors will be exchanged by the door call or return.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_DOOR_INSTALLED   A previous door has already been
>                                 established.
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
> 4.6 stmfDestroyProxyDoor
>
> NAME
>     stmfDestroyProxyDoor
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     void stmfDestroyProxyDoor(int hdl);
>
> PARAMETERS
>     hdl         hdl returned from a previous call to
>                 stmfInitProxyDoor(3STMF)
>
> DESCRIPTION
>     The stmfDestroyProxyDoor() function closes the door interface
>     established in the call to stmfInitProxyDoor().
>
> RETURN VALUES
>
>     None
>
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
> 4.7 stmfPostProxyMsg
>
> NAME
>     stmfPostProxyMsg
>
> SYNOPSIS
>     cc [ flag... ] file... -lstmf [ library... ]
>     #include <libstmf.h>
>
>     int stmfPostProxyMsg(int hdl, void *buf, uint32_t buflen)
>
> PARAMETERS
>     hdl         Returned in a previous successful call to
>                 stmfInitProxyDoor(3STMF)
>
>     buf         Pointer to buffer to received from peer node
>
>     buflen      length of buf
>
> DESCRIPTION
>     The stmfPostProxyMsg() function passes down to the STMF proxy service
>     the message received from the peer node's STMF proxy service door upcall.
>
> RETURN VALUES
>
>     The following values are returned:
>
>     STMF_ERROR_INVALID_ARG      hdl is not valid or buf is NULL
>
>     STMF_POST_MSG_FAILED        Failed to post message
>
>     STMF_STATUS_SUCCESS         The API call was successful
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attributes:
>
>     ____________________________________________________________
>     |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
>     |_____________________________|_____________________________|
>     | Interface Stability         | Committed                   |
>     |_____________________________|_____________________________|
>     | MT-Level                    | Safe                        |
>     |_____________________________|_____________________________|
>
>
>
> 4.8 Changes to stmfGetLuProp(3STMF) manpage
>
>        decimal  representation (that is, no leading "0x"). The prop
>        argument can be one of the following values:
>   
> +      STMF_LU_PROP_ACCESS_STATE 
> +      
> +          Asymmetric access state for the logical unit.
> +          Set to one of:
> +      
> +          "0"   is    Active
> +          "1"   is    Transition to Active
> +          "2"   is    Standby
> +          "3"   is    Transition to Standby
> + 
>        STMF_LU_PROP_ALIAS
>   
>            Up to 255 characters representing a  user  defined  name
>
> 4.9 References
>
>     [1] COMSTAR: Common Multiprotocol SCSI Target
>         http://sac.sfbay/PSARC/2007/523
>
>     [2] SCSI Primary Commands - 3 (SPC-3) revision 23
>         http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc3r23.pdf
>
> 6. Resources and Schedule
>     6.4. Steering Committee requested information
>    	6.4.1. Consolidation C-team Name:
> 		ON
>     6.5. ARC review type: FastTrack
>     6.6. ARC Exposure: open
>
>   


From John.Forte@sun.com Wed Sep  9 10:55:26 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n89HtQq4011560
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 9 Sep 2009 10:55:26 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n89HtMZM028209
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 9 Sep 2009 10:55:26 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KPP00C29TSD6L00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.COM); Wed, 09 Sep 2009 10:55:25 -0700 (PDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KPP00JK8TSDALA0@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.COM); Wed,
 09 Sep 2009 10:55:25 -0700 (PDT)
Received: from fe-amer-09.sun.com ([192.18.109.79])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n89HtPGx021341	for
 <PSARC-ext@Sun.COM>; Wed, 09 Sep 2009 17:55:25 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KPP00800SSLMQ00@mail-amer.sun.com> for PSARC-ext@Sun.COM
 (ORCPT PSARC-ext@Sun.COM); Wed, 09 Sep 2009 11:55:25 -0600 (MDT)
Received: from [129.146.56.52] ([unknown] [129.146.56.52])
 by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit
 (built Jul  2 2009)) with ESMTPSA id <0KPP000RKTS6KLD0@mail-amer.sun.com> for
 PSARC-ext@Sun.COM (ORCPT PSARC-ext@Sun.COM); Wed,
 09 Sep 2009 11:55:19 -0600 (MDT)
Date: Wed, 09 Sep 2009 10:52:25 -0700
From: John Forte <John.Forte@sun.com>
Subject: Re: COMSTAR ALUA active/standby support [PSARC/2009/465 FastTrack
 timeout 09/02/2009]
In-reply-to: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
Sender: John.Forte@sun.com
To: PSARC-ext@sun.com
Message-id: <4AA7EB59.1010907@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200908262321.n7QNL2vh016458@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.17 (X11/20081014)
Status: RO
Content-Length: 96

The timer on this case had been extended to 9/09/2009 and was approved 
at PSARC today.

- John

