All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Nic Bellinger <nab@daterainc.com>,
	target-devel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 02/11] target_core_alua: Store supported ALUA states
Date: Thu, 17 Oct 2013 07:48:59 +0200	[thread overview]
Message-ID: <525F7A4B.5070508@suse.de> (raw)
In-Reply-To: <1381958347.19256.646.camel@haakon3.risingtidesystems.com>

On 10/16/2013 11:19 PM, Nicholas A. Bellinger wrote:
> On Wed, 2013-10-16 at 09:20 +0200, Hannes Reinecke wrote:
>> The supported ALUA states might be different for individual
>> devices, so store it in a separate field.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>>  drivers/target/target_core_alua.c | 14 ++++++++------
>>  drivers/target/target_core_alua.h | 11 +++++++++++
>>  include/target/target_core_base.h |  1 +
>>  3 files changed, 20 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
>> index 8297d37..255e83c 100644
>> --- a/drivers/target/target_core_alua.c
>> +++ b/drivers/target/target_core_alua.c
>> @@ -117,12 +117,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd)
>>  		/*
>>  		 * Set supported ASYMMETRIC ACCESS State bits
>>  		 */
>> -		buf[off] = 0x80; /* T_SUP */
>> -		buf[off] |= 0x40; /* O_SUP */
>> -		buf[off] |= 0x8; /* U_SUP */
>> -		buf[off] |= 0x4; /* S_SUP */
>> -		buf[off] |= 0x2; /* AN_SUP */
>> -		buf[off++] |= 0x1; /* AO_SUP */
>> +		buf[off++] |= tg_pt_gp->tg_pt_gp_alua_supported_states;
>>  		/*
>>  		 * TARGET PORT GROUP
>>  		 */
>> @@ -1367,6 +1362,13 @@ struct t10_alua_tg_pt_gp *core_alua_allocate_tg_pt_gp(struct se_device *dev,
>>  	tg_pt_gp->tg_pt_gp_trans_delay_msecs = ALUA_DEFAULT_TRANS_DELAY_MSECS;
>>  	tg_pt_gp->tg_pt_gp_implicit_trans_secs = ALUA_DEFAULT_IMPLICIT_TRANS_SECS;
>>  
>> +	/*
>> +	 * Enable all supported states
>> +	 */
>> +	tg_pt_gp->tg_pt_gp_alua_supported_states =
>> +	    ALUA_T_SUP | ALUA_O_SUP | \
>> +	    ALUA_U_SUP | ALUA_S_SUP | ALUA_AN_SUP | ALUA_AO_SUP;
>> +
>>  	if (def_group) {
>>  		spin_lock(&dev->t10_alua.tg_pt_gps_lock);
>>  		tg_pt_gp->tg_pt_gp_id =
>> diff --git a/drivers/target/target_core_alua.h b/drivers/target/target_core_alua.h
>> index 74cf0c0..e826a65 100644
>> --- a/drivers/target/target_core_alua.h
>> +++ b/drivers/target/target_core_alua.h
>> @@ -23,6 +23,17 @@
>>  #define ALUA_ACCESS_STATE_TRANSITION		0xf
>>  
>>  /*
>> + * from spc4r36j section 6.37 Table 306
>> + */
>> +#define ALUA_T_SUP		0x80
>> +#define ALUA_O_SUP		0x40
>> +#define ALUA_LBD_SUP		0x10
>> +#define ALUA_U_SUP		0x08
>> +#define ALUA_S_SUP		0x04
>> +#define ALUA_AN_SUP		0x02
>> +#define ALUA_AO_SUP		0x01
>> +
>> +/*
> 
> How about making these the supported bits, TPGS mode, and ALUA access
> state definitions common between target_core_alua.c and
> scsi_dh_alua.c..?
> 
Sure. Good idea.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

  reply	other threads:[~2013-10-17  5:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  7:20 [PATCH 00/11] target_core_mod: ALUA updates Hannes Reinecke
2013-10-16  7:20 ` [PATCH 01/11] target core: rename (ex,im)plict -> (ex,im)plicit Hannes Reinecke
2013-10-16 21:13   ` Nicholas A. Bellinger
2013-10-16  7:20 ` [PATCH 02/11] target_core_alua: Store supported ALUA states Hannes Reinecke
2013-10-16 21:19   ` Nicholas A. Bellinger
2013-10-17  5:48     ` Hannes Reinecke [this message]
2013-10-16  7:20 ` [PATCH 03/11] target_core_alua: Make supported states configurable Hannes Reinecke
2013-10-16 21:38   ` Nicholas A. Bellinger
2013-10-16  7:20 ` [PATCH 04/11] target_core_alua: Rename ALUA_ACCESS_STATE_OPTIMIZED Hannes Reinecke
2013-10-16  7:20 ` [PATCH 05/11] target_core_alua: spellcheck Hannes Reinecke
2013-10-16  7:20 ` [PATCH 06/11] target_core_alua: Validate ALUA state transition Hannes Reinecke
2013-10-16 21:40   ` Nicholas A. Bellinger
2013-10-16  7:20 ` [PATCH 07/11] target_core_alua: Allocate ALUA metadata on demand Hannes Reinecke
2013-10-16 21:42   ` Nicholas A. Bellinger
2013-10-16  7:20 ` [PATCH 08/11] target_core_alua: store old and pending ALUA state Hannes Reinecke
2013-10-16  7:20 ` [PATCH 09/11] target_core_alua: Use workqueue for ALUA transitioning Hannes Reinecke
2013-10-16 22:06   ` Nicholas A. Bellinger
2013-10-17  6:52     ` Hannes Reinecke
2013-10-18 19:04       ` Nicholas A. Bellinger
2013-10-16 22:09 ` [PATCH 00/11] target_core_mod: ALUA updates Nicholas A. Bellinger
2013-11-06 20:54 ` Nicholas A. Bellinger
2013-11-12 21:49   ` Nicholas A. Bellinger
2013-11-13  6:46     ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=525F7A4B.5070508@suse.de \
    --to=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@daterainc.com \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.