linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Andy Grover <agrover@redhat.com>, target-devel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 32/32] target: Increase MAX_LUNS_PER_TPG to 16384
Date: Mon, 16 Dec 2013 10:20:12 +0100	[thread overview]
Message-ID: <52AEC5CC.9050701@suse.de> (raw)
In-Reply-To: <1386979160-6928-33-git-send-email-agrover@redhat.com>

On 12/14/2013 12:59 AM, Andy Grover wrote:
> Indicate support for hierarchical LUN addressing.
> 
> Set address method field in each LUN reported by REPORT LUNS to 1, in
> accordance with SCSI SAM specs.
> 
> Signed-off-by: Andy Grover <agrover@redhat.com>
> ---
>  drivers/target/target_core_spc.c  |    8 ++++++--
>  include/target/target_core_base.h |    4 ++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
> index 0b678fc..04690bf 100644
> --- a/drivers/target/target_core_spc.c
> +++ b/drivers/target/target_core_spc.c
> @@ -79,7 +79,7 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
>  	buf[2] = 0x05; /* SPC-3 */
>  
>  	/*
> -	 * NORMACA and HISUP = 0, RESPONSE DATA FORMAT = 2
> +	 * NORMACA = 0, HISUP = 1, RESPONSE DATA FORMAT = 2
>  	 *
>  	 * SPC4 says:
>  	 *   A RESPONSE DATA FORMAT field set to 2h indicates that the
> @@ -88,7 +88,7 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
>  	 *   obsolete. Response data format values greater than 2h are
>  	 *   reserved.
>  	 */
> -	buf[3] = 2;
> +	buf[3] = 0x12;
>  
>  	/*
>  	 * Enable SCCS and TPGS fields for Emulated ALUA
> @@ -1164,6 +1164,10 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd)
>  			break;
>  
>  		int_to_scsilun(deve->mapped_lun, (struct scsi_lun *)&buf[offset]);
> +
> +		/* Address method 1 for hier flat-space address. see SAM-5 */
> +		buf[offset] |= (1 << 6);
> +
>  		offset += 8;
>  	}
>  	spin_unlock_irq(&sess->se_node_acl->device_list_lock);
> diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
> index 08ecfed..537cc67 100644
> --- a/include/target/target_core_base.h
> +++ b/include/target/target_core_base.h
> @@ -14,8 +14,8 @@
>  #define TARGET_CORE_VERSION		TARGET_CORE_MOD_VERSION
>  
>  /* Maximum Number of LUNs per Target Portal Group */
> -/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
> -#define TRANSPORT_MAX_LUNS_PER_TPG		256
> +/* Don't raise above 16384 or a different format in report_luns is needed */
> +#define TRANSPORT_MAX_LUNS_PER_TPG		16384
>  /*
>   * By default we use 32-byte CDBs in TCM Core and subsystem plugin code.
>   *
> 
NO WAY.

TCM is (currently) keeping the LUNs in a static array.
Which is sort-of-okay if the number of LUNs is somewhat reasonable,
as it was for 256.
But 16k is way beyond any sensible number and will increase the
memory footprint by a massive amount, irrespective whether someone
will actually _use_ such a large number of LUNs.

Before attempting that one would need to convert the LUN array into
something scalable, like a linked list or somesuch.

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-12-16  9:20 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 23:58 [PATCH 0/32] Refcounts and rbtrees to increase luns above 255 Andy Grover
2013-12-13 23:58 ` [PATCH 01/32] target: Remove unused ua_dev_list member in struct se_ua Andy Grover
2013-12-16 20:39   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 02/32] target: Don't keep looping in report_luns if too big Andy Grover
2013-12-16 20:41   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 03/32] target: Allocate more room for port default groups Andy Grover
2013-12-16 20:43   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 04/32] target: Fix sizeof in kmalloc for some default_groups arrays Andy Grover
2013-12-16 20:43   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 05/32] target: Rename some list heads used as nodes Andy Grover
2013-12-16 20:45   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 06/32] target: Convert lu_gp_ref_cnt to kref Andy Grover
2013-12-16 20:52   ` Nicholas A. Bellinger
2014-02-05 22:02     ` Andy Grover
2014-02-06 23:51       ` Nicholas A. Bellinger
2014-02-07  2:56         ` Andy Grover
2014-02-07 19:17           ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 07/32] target: Convert struct alua_lu_gp_member " Andy Grover
2013-12-16 20:56   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 08/32] target: Convert tg_pt_gp_ref_cnt " Andy Grover
2013-12-16 21:00   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 09/32] target: convert tg_pt_gp_mem_ref_cnt " Andy Grover
2013-12-16 21:08   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 10/32] target: Change sep_tg_pt_ref_cnt to use kref Andy Grover
2013-12-16 21:11   ` Nicholas A. Bellinger
2013-12-13 23:58 ` [PATCH 11/32] target: Convert se_dev_entry to kref Andy Grover
2013-12-16 21:15   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 12/32] target: Convert t10_pr_registration " Andy Grover
2013-12-16 21:20   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 13/32] target: Move spinlock inside core_release_port Andy Grover
2013-12-16 21:21   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 14/32] target: Remove extra percpu_ref_init Andy Grover
2013-12-16 21:23   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 15/32] target: Refer to u32 luns as unpacked_lun Andy Grover
2013-12-16 21:25   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 16/32] target: Rename core_tpg_{pre,post}_addlun for clarity Andy Grover
2013-12-16 21:29   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 17/32] target: Don't use void* when passing dev in core_tpg_add_lun Andy Grover
2013-12-16 21:29   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 18/32] target: More core_dev_del cleanups Andy Grover
2013-12-16 21:35   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 19/32] target: Convert to rbtree for se_dev_entry in se_node_acl Andy Grover
2013-12-16 21:40   ` Nicholas A. Bellinger
2013-12-17  1:00     ` Andy Grover
2013-12-17  1:54       ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 20/32] target: Convert to rbtree for se_lun list in se_portal_group Andy Grover
2013-12-16 21:42   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 21/32] target: Remove lun_link and device magic Andy Grover
2013-12-16 21:44   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 22/32] target: Convert percpu_ref to kref Andy Grover
2013-12-16 21:44   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 23/32] target: Add lun->lun_tpg pointer Andy Grover
2013-12-16 21:45   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 24/32] target: Remove tpg from core_dev_export/unexport params Andy Grover
2013-12-16 21:46   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 25/32] target: Call remove_lun instead of del_lun in fabric_port_unlink Andy Grover
2013-12-16 21:47   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 26/32] target: Convert tpg_pr_ref_count to kref Andy Grover
2013-12-16 21:50   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 27/32] target: Move call to remove_lun to the release function from drop_link Andy Grover
2013-12-16 21:51   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 28/32] target: Convert acl_pr_ref_count to kref Andy Grover
2013-12-16 21:58   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 29/32] target: Simplify params to core_tpg_del_initiator_node_acl Andy Grover
2013-12-16 22:00   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 30/32] target: Change nacl's session refcount to use existing refcount Andy Grover
2013-12-16 22:01   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 31/32] target: Don't release and re-acquire some spinlocks in loops Andy Grover
2013-12-16 22:01   ` Nicholas A. Bellinger
2013-12-13 23:59 ` [PATCH 32/32] target: Increase MAX_LUNS_PER_TPG to 16384 Andy Grover
2013-12-16  9:20   ` Hannes Reinecke [this message]
2013-12-16  9:24     ` Hannes Reinecke
2013-12-16 22:01   ` Nicholas A. Bellinger
2013-12-16 22:03 ` [PATCH 0/32] Refcounts and rbtrees to increase luns above 255 Nicholas A. Bellinger
2013-12-17  1:49   ` Andy Grover
2013-12-17  1:59     ` Nicholas A. Bellinger
2013-12-17  2:03       ` Andy Grover
2013-12-17  3:03         ` Nicholas A. Bellinger
2013-12-17 10:53   ` Hannes Reinecke
2013-12-17 17:10     ` Andy Grover
2013-12-17 21:25       ` Nicholas A. Bellinger

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=52AEC5CC.9050701@suse.de \
    --to=hare@suse.de \
    --cc=agrover@redhat.com \
    --cc=linux-scsi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).