All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Johannes Thumshirn <jthumshirn@suse.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi_transport_fc: implement 'disable_target_scan' module parameter
Date: Wed, 2 Mar 2016 13:59:39 +0800	[thread overview]
Message-ID: <56D6814B.9020302@suse.de> (raw)
In-Reply-To: <20160301131252.GA7786@lst.de>

On 03/01/2016 09:12 PM, Christoph Hellwig wrote:
> On Mon, Feb 22, 2016 at 08:51:01AM +0100, Hannes Reinecke wrote:
>>  /*
>> + * disable_target_scan: Disable target scan per default
>> + *   useful on larger installations where only a small
>> + *   number of LUNs are required for booting.
>> + */
>> +static bool fc_disable_target_scan;
>> +
>> +module_param_named(disable_target_scan, fc_disable_target_scan,
>> +		   bool, S_IRUGO|S_IWUSR);
>> +MODULE_PARM_DESC(disable_target_scan,
>> +		 "Disable target scan on remote ports (default=0)");
>> +
>> +/*
>>   * Redefine so that we can have same named attributes in the
>>   * sdev/starget/host objects.
>>   */
>> @@ -3272,10 +3284,14 @@ fc_scsi_scan_rport(struct work_struct *work)
>>  	struct Scsi_Host *shost = rport_to_shost(rport);
>>  	struct fc_internal *i = to_fc_internal(shost->transportt);
>>  	unsigned long flags;
>> +	bool disable_target_scan;
>> +
>> +	disable_target_scan = fc_disable_target_scan ?
>> +		fc_disable_target_scan : i->f->disable_target_scan;
>>  
>>  	if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
>>  	    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
>> -	    !(i->f->disable_target_scan)) {
>> +	    !disable_target_scan) {
> 
> Wouldn't this be simpler by just writing:
> 
> if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
>     (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
>     !i->f->disable_target_scan && !disable_target_scan) {
> 
> that being said I don't understand why we need this in the FC transport
> class.  What is so special about FC that we do it here and not globally?
> 
Main reasons being that
a) it's most commonly on FC where you end up having thousands of LUNs;
SAS domains are of finite size and you'd need to string quite a few SAS
expanders together to achieve a similar setup. And iSCSI is ... well.
b) FC already has the required infrastructure in place where you easily
can suppress a target scan, making the patch really trivial.

So rather than trying to come up with a generic solution and an overly
complicated patch I opted for the simpler version :-)

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)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-02  5:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22  7:51 [PATCH 0/2][RESEND] scsi_transport_fc: LUN masking Hannes Reinecke
2016-02-22  7:51 ` [PATCH 1/2] scsi_transport_fc: implement 'disable_target_scan' module parameter Hannes Reinecke
2016-03-01  9:06   ` Johannes Thumshirn
2016-03-01 13:12   ` Christoph Hellwig
2016-03-02  5:59     ` Hannes Reinecke [this message]
2016-03-02  9:18       ` Christoph Hellwig
2016-03-02  9:35         ` Hannes Reinecke
2016-02-22  7:51 ` [PATCH 2/2] scsi_transport_fc: Implement 'async_user_scan' " Hannes Reinecke
2016-03-01  5:45   ` Seymour, Shane M
2016-03-01  9:07   ` Johannes Thumshirn
2016-03-01 13:15   ` Christoph Hellwig
2016-02-22 11:39 ` [PATCH 0/2][RESEND] scsi_transport_fc: LUN masking Seymour, Shane M
2016-02-23 10:21   ` Hannes Reinecke
2016-02-24  0:35     ` Seymour, Shane M
2016-03-01 19:54     ` Ewan Milne
2016-03-02  6:35       ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2015-11-11 10:34 [PATCH 0/2] " Hannes Reinecke
2015-11-11 10:34 ` [PATCH 1/2] scsi_transport_fc: implement 'disable_target_scan' module parameter Hannes Reinecke
2016-03-01  5:48   ` Seymour, Shane M

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=56D6814B.9020302@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jthumshirn@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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.