I am sponsoring this fasttrack for Sue Gleeson. Requested binding is minor. Timeout is set for 11/25/2009.
- 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 SRPT Port Provider Management 1.2. Name of Document Author/Supplier: Author: Susan Gleeson 1.3 Date of This Document: 18 November, 2009 4. Technical Description The COMSTAR Infiniband SRP Target project (PSARC/2009/111 [1]) introduced the SRP protocol port provider to Solaris. When the SRP port provider SMF service is enabled, COMSTAR targets are created for every Infiniband HCA discovered on the system. It has become clear that a finer level of control is required, and this set of interfaces will allow for changing the default behavior when the service is activated as well as enabling and disabling SRP services on a per-HCA basis. This case introduces a new library, libsrpt and a new CLI, srptadm as described below. 4.1 Interfaces Minor binding. -------------+-----------------------+------------------------- Interface Classification Comments -------------+-----------------------+------------------------- libsrpt | Committed | srptadm | Committed 4.2 srpt_SetDefaultState/srpt_GetDefaultState NAME srpt_SetDefaultState, srpt_GetDefaultState - set and retrieve the default state setting for the SRP Target service. SYNOPSIS cc [ flag... ] file... -lsrpt [ library... ] #include <libsrpt.h> int srpt_SetDefaultState(boolean_t enabled); int srpt_GetDefaultState(boolean_t *enabled); PARAMETERS enabled boolean value indicating whether COMSTAR SRP targets should be created. DESCRIPTION The srpt_SetDefaultState() function sets the default behavior of the SRP Target service. If enabled is B_TRUE, SRP targets will be created for all discovered HCAs that have not been specifically disabled. If enabled is B_FALSE, targets will not be created unless the HCA has been specifically enabled. See also srpt_SetTargetState() for enabling or disabling specific HCAs. If the default state is changed when the SRP service is online, the state of existing targets is not changed until the service is restarted. The srpt_GetDefaultState() function returns the current value for enabled. RETURN VALUES ENOMEM Could not allocate resources EINVAL Invalid parameter ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| | MT-Level | MT-Safe | |_____________________________|_____________________________| SEE ALSO srpt_SetTargetState(3SRPT), libsrpt(3LIB) 4.3 srpt_SetTargetState/srpt_GetTargetState NAME srpt_SetTargetState, srpt_GetTargetState, srpt_ResetTarget - set and retrieve SRP Target state for a specific HCA. SYNOPSIS cc [ flag... ] file... -lsrpt [ library... ] #include <libsrpt.h> int srpt_SetTargetState(char *hca_guid, boolean_t enabled); int srpt_GetTargetState(char *hca_guid, boolean_t *enabled); int srpt_ResetTarget(char *hca_guid); PARAMETERS hc_guid HCA GUID. Must be in one of the following forms: 3BA000100CD18 - base hex form 0003BA000100CD18 - base hex form with leading zeroes hca:3BA000100CD18 - form from cfgadm eui.0003BA000100CD18 - EUI form enabled boolean value indicating whether a COMSTAR SRP target should be created for this HCA. DESCRIPTION The srpt_SetTargetState() function controls whether a COMSTAR SRP target will be created for the specified HCA. If enabled is B_TRUE, an SRP target will be created for this HCA. If enabled is B_FALSE, a target will not be created. This function overrides the default setting for the SRP Target service as set by srpt_SetDefaultState(). Changing the target state takes effect immediately if the SRP target service is online. Targets set to disabled will be offlined and removed; targets set to enabled will be immediately created. The srpt_GetTargetState() function retrieves the current setting for the specified HCA. The srpt_ResetTarget() function clears HCA-specific settings. The service-wide defaults will control SRP Target creation for this HCA. RETURN VALUES ENOMEM Could not allocate resources EINVAL Invalid parameter ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| | MT-Level | MT-Safe | |_____________________________|_____________________________| SEE ALSO srpt_SetDefaultState(3SRPT), libsrpt(3LIB) 4.4 srptadm System Administration Commands srptadm(1M) NAME srptadm - administer SRP Targets SYNOPSIS srptadm modify-target [-e, --enable] [-d, --disable] [-r, --reset] <hca_guid> srptadm list-target [<hca_guid>] srptadm modify-defaults [-e, --enable] [-d, --disable] srptadm list-defaults ARGUMENTS hca_guid GUID of the InfiniBand Host Channel Adapter (HCA) on this system for which SRP Target Services may be provided. The GUID must be in one of the following forms: 3BA000100CD18 - base hex form 0003BA000100CD18 - base hex form with leading zeroes hca:3BA000100CD18 - form from cfgadm eui.0003BA000100CD18 - EUI form DESCRIPTION The srptadm command manages SRP target ports within the SCSI Target Mode Framework described in stmfadm(1M) and libstmf(3LIB). This allows SRP initiators to access STMF logical units using the iSCSI protocol. srptadm is implemented as a set of subcommands with options and operands for each subcommand. These subcommands are described in their own section, below. SUBCOMMANDS srptadm modify-defaults [-e, --enable] [-d, --disable] Modify default parameters. Options are as follows. -e, --enable Enable SRP target creation for all HCAs that have not been explicitly disabled with modify-target. -d, --disable Disable SRP target creation for all HCAs that have not been explicitly enabled with modify-target. srptadm list-defaults Lists information about the default properties. This subcommand has no options. srptadm modify-target <hca_guid> Sets SRP Target properties for the specified HCA. Options are as follows. -e, --enable enables SRP target creation on this HCA -d, --disable disables SRP target creation on this HCA -r, --reset clears HCA-specific information and resets to defaults. The SRP Target, if any, associated with this HCA will not be modified as a result of this option until the SRP Target SMF service is restarted. srptadm list-target [hca_guid] If hca_guid is specified, lists the properties of the target HCA. Otherwise, properties are listed for all HCAs. NOTES: If the default state is changed when the SRP service is online, the state of existing targets is not changed until the service is restarted. Changing the target state takes effect immediately if the SRP target service is online. Targets set to disabled will be offlined and removed; targets set to enabled will be immediately created. EXAMPLES: List the default SRP Target Service properties: # srptadm list-defaults SRP Target Service Default Properties: Target creation enabled by default: true Change the default behavior of the SRP Target service to not create SRP Targets when the service is enabled: # srptadm modify-defaults -d List SRP Target properties for a specific HCA: # cfgadm | grep hca hca:3BA000100CD18 IB-HCA connected configured ok hca:3BA000100D030 IB-HCA connected configured ok # srptadm list-target hca:3BA000100CD18 Target HCA 3BA000100CD18: Enabled : true SRP Target Name : eui.0003BA000100CD18 Operational Status : online Disable SRP Target services for a specific HCA: # srptadm modify-target -d 3BA000100CD18 Use the same list command to see the changes: # srptadm list-target hca:3BA000100CD18 Target HCA 3BA000100CD18: Enabled : false SRP Target Name : eui.0003BA000100CD18 Operational Status : - Re-enable SRP Target services, and look at the SRP and STMF target properties: # srptadm modify-target -e 3BA000100CD18 # srptadm list-target hca:3BA000100CD18 Target HCA 3BA000100CD18: Enabled : true SRP Target Name : eui.0003BA000100CD18 Operational Status : online # stmfadm list-target -v eui.0003BA000100CD18 Target: eui.0003BA000100CD18 Operational Status: Online Provider Name : srpt Alias : - Protocol : SRP Sessions : 0 ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWsrptu | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| SEE ALSO stmfadm(1M), srpt(7D), libsrpt(3LIB), attributes(5) 5. Reference Documents: SRP Target PSARC case (PSARC/2009/111) http://arc.opensolaris.org/caselog/PSARC/2009/111/ 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