linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Narsimhulu Musini (nmusini)" <nmusini@cisco.com>,
	"JBottomley@Parallels.com" <JBottomley@Parallels.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"hch@infradead.org" <hch@infradead.org>
Cc: "Sesidhar Baddela (sebaddel)" <sebaddel@cisco.com>
Subject: Re: [PATCH v4 4/9] snic:Add snic target discovery
Date: Mon, 13 Apr 2015 16:29:23 +0200	[thread overview]
Message-ID: <552BD2C3.8010103@suse.de> (raw)
In-Reply-To: <D1514FCB.207B3%nmusini@cisco.com>

On 04/13/2015 07:25 AM, Narsimhulu Musini (nmusini) wrote:
> Hi Hannes,
> 
>   Thank you for reviewing patches. Please find responses inline.
> 
> 
> 
> On 09/04/15 6:29 pm, "Hannes Reinecke" <hare@suse.de> wrote:
> 
>>
>> On 04/09/2015 01:49 PM, Narsimhulu Musini wrote:
[ .. ]
>>> +/* snic_tgt_create: checks for existence of snic_tgt, if it doesn't
>>> + * it creates one.
>>> + */
>>> +static struct snic_tgt *
>>> +snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid)
>>> +{
>>> +	struct snic_tgt *tgt = NULL;
>>> +	unsigned long flags;
>>> +	int ret;
>>> +
>>> +	tgt = snic_tgt_lookup(snic, tgtid);
>>> +	if (tgt) {
>>> +		/* update the information if required */
>>> +		return tgt;
>>> +	}
>>> +
>>> +	tgt = kzalloc(sizeof(*tgt), GFP_KERNEL);
>>> +	if (!tgt) {
>>> +		SNIC_HOST_ERR(snic->shost, "Failure to allocate snic_tgt.\n");
>>> +		ret = -ENOMEM;
>>> +
>>> +		return tgt;
>>> +	}
>>> +
>>> +	INIT_LIST_HEAD(&tgt->list);
>>> +	tgt->id = tgtid->tgt_id;
>>> +	tgt->channel = 0;
>>> +
>>> +	SNIC_BUG_ON(tgtid->tgt_type > SNIC_TGT_SAN);
>>> +	tgt->tdata.typ = tgtid->tgt_type;
>>> +
>>> +	/*
>>> +	 * Plugging into SML Device Tree
>>> +	 */
>>> +	tgt->tdata.disc_id = 0;
>>> +	tgt->state = SNIC_TGT_STAT_INIT;
>>> +	device_initialize(&tgt->dev);
>>> +	tgt->dev.parent = get_device(&snic->shost->shost_gendev);
>>> +	tgt->dev.release = snic_tgt_dev_release;
>> Why do you use your own scsi target instantiation here?
>> If it's equivalent to the scsi target than you should rather use the
>> 'scsi_target' structure here and attach driver-specific information
>> to either hostdata or starget_data.
> I got your idea, we followed an approach similar to fc (fc_rport_create()
> in scsi_transport_fc.c).
> Both are valid approaches. We opted for current approach, and gone through
> good amount of testing.
> I would like to keep the way it is. Please share your thoughts.

scsi_transport_fc() creates its own sysfs hierarchy for the remote
port, which is inserted between scsi_host and scsi_target:

/sys/devices/pci0000:00/0000:00:03.0/0000:07:00.3/host2/rport-2:0-13/target2:0:11/2:0:11:7

here, the fc_rport structure corresponds to the FC sysfs hierarchy,
containing all FC-related sysfs attributes. And as such makes sense
have a distinct object.

In your case no such hiearchy exists, and there are no additional
sysfs attributes which would warrant the creation of a distinct object.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (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:[~2015-04-13 14:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 11:49 [PATCH v4 0/9] snic:initial submission of snic driver for Cisco SCSI HBA Narsimhulu Musini
2015-04-09 11:49 ` [PATCH v4 1/9] snic: snic module infrastructure Narsimhulu Musini
2015-04-09 12:40   ` Hannes Reinecke
2015-04-09 11:49 ` [PATCH v4 2/9] snic:Add interrupt, resource firmware interfaces Narsimhulu Musini
2015-04-09 12:46   ` Hannes Reinecke
2015-04-09 11:49 ` [PATCH v4 3/9] snic:Add meta request, handling of meta requests Narsimhulu Musini
2015-04-09 12:50   ` Hannes Reinecke
2015-04-09 11:49 ` [PATCH v4 4/9] snic:Add snic target discovery Narsimhulu Musini
2015-04-09 12:59   ` Hannes Reinecke
2015-04-13  5:25     ` Narsimhulu Musini (nmusini)
2015-04-13 14:29       ` Hannes Reinecke [this message]
2015-04-14 10:15         ` Narsimhulu Musini (nmusini)
2015-04-09 11:49 ` [PATCH v4 5/9] snic:add SCSI handling, AEN, and fwreset handling Narsimhulu Musini
2015-04-09 13:16   ` Hannes Reinecke
2015-04-13  5:37     ` Narsimhulu Musini (nmusini)
2015-04-09 11:49 ` [PATCH v4 6/9] snic:Add low level queuing interfaces Narsimhulu Musini
2015-04-09 13:23   ` Hannes Reinecke
2015-04-13  5:40     ` Narsimhulu Musini (nmusini)
2015-04-09 11:49 ` [PATCH v4 7/9] snic:Add sysfs entries to list stats and trace data Narsimhulu Musini
2015-04-09 13:23   ` Hannes Reinecke
2015-04-09 11:49 ` [PATCH v4 8/9] snic:Add event tracing to capture IO events Narsimhulu Musini
2015-04-09 13:24   ` Hannes Reinecke
2015-04-09 11:49 ` [PATCH v4 9/9] snic:Add Makefile, patch Kconfig, MAINTAINERS Narsimhulu Musini
2015-04-09 13:25   ` 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=552BD2C3.8010103@suse.de \
    --to=hare@suse.de \
    --cc=JBottomley@Parallels.com \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nmusini@cisco.com \
    --cc=sebaddel@cisco.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 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).