From: "Narsimhulu Musini (nmusini)" <nmusini@cisco.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "JBottomley@Parallels.com" <JBottomley@Parallels.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"hare@suse.de" <hare@suse.de>,
"Sesidhar Baddela (sebaddel)" <sebaddel@cisco.com>
Subject: Re: [PATCH v3 1/9] snic: snic module infrastructure
Date: Wed, 8 Apr 2015 08:55:35 +0000 [thread overview]
Message-ID: <D14AE940.1FFAC%nmusini@cisco.com> (raw)
In-Reply-To: <20150402092158.GA6794@infradead.org>
Hi Christoph,
Thank you for reviewing the patch. Please find responses inline.
I will incorporate the comments and suggestions in next patch submittal.
On 02/04/15 2:51 pm, "Christoph Hellwig" <hch@infradead.org> wrote:
>> +/*
>> + * Usage of the scsi_cmnd scratchpad.
>> + * These fields are locked by the hashed req_lock.
>> + */
>> +#define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr)
>> +#define CMD_STATE(Cmnd) ((Cmnd)->SCp.phase)
>> +#define CMD_ABTS_STATUS(Cmnd) ((Cmnd)->SCp.Message)
>> +#define CMD_LR_STATUS(Cmnd) ((Cmnd)->SCp.have_data_in)
>> +#define CMD_TAG(Cmnd) ((Cmnd)->SCp.sent_command)
>> +#define CMD_FLAGS(Cmnd) ((Cmnd)->SCp.Status)
>
>Please don't abuse ->SCp for new drivers. Declare your own structure
>and set .cmd_size in the host template to it's size, then access it
>using scsi_cmd_priv().
Sure, driver will use its own private structure.
> That should also avoid the need for the mempool
>that the driver currently creates.
Yes, agreed. For now, I will just consider making changes to replace
scratch buffer usage. And will take up the mempool creation in future
patches.
>
>> +static int
>> +snic_slave_alloc(struct scsi_device *sdev)
>> +{
>> + u32 qdepth = 0, max_ios = 0;
>> + struct snic_tgt *tgt = starget_to_tgt(scsi_target(sdev));
>> +
>> + if (!tgt || snic_tgt_chkready(tgt))
>> + return -ENXIO;
>> +
>> + max_ios = snic_max_qdepth;
>> + max_ios = snic_max_qdepth;
>> + qdepth = min_t(u32, max_ios, SNIC_MAX_QUEUE_DEPTH);
>> + scsi_change_queue_depth(sdev, qdepth);
>
>Plase set the queue_depth in ->slave_configure like all other drivers.
Sure, I will move it to ->slave_configure.
>
>> + .cmd_per_lun = 3,
>
>why so low?
Thanks for pointing this, will set it to default queue depth.
>
>> +
>> +#ifndef PCI_VENDOR_ID_CISCO
>> +#define PCI_VENDOR_ID_CISCO 0x1137
>> +#endif
>
>Just use the numeric value directly.
Sure.
>
>> +
>> +#define SNIC_OS_TYPE SNIC_OS_LINUX
>> +#define snic_cmd_tag(sc) (((struct scsi_cmnd *) sc)->request->tag)
>> +
>> +extern struct device_attribute *snic_attrs[];
>> +
>> +static inline struct kmem_cache *
>> +snic_cache_create(const char *cache_name, const int sz)
>> +{
>> + void *cp;
>> +
>> + cp = kmem_cache_create(cache_name, sz, SNIC_SG_DESC_ALIGN,
>> + SLAB_HWCACHE_ALIGN, NULL);
>> +
>> + return (struct kmem_cache *) cp;
>> +}
>
>Please remove all the wrappers in the snic_os.h file and use the Linux
>APIs directly.
Sure, I will directly use the APIs, and delete the snic_os.h file.
Thanks
Narsimhulu
>
next prev parent reply other threads:[~2015-04-08 8:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 9:04 [PATCH v3 0/9] snic:initial submission of snic driver for Cisco SCSI HBA Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 1/9] snic: snic module infrastructure Narsimhulu Musini
2015-04-02 9:21 ` Christoph Hellwig
2015-04-08 8:55 ` Narsimhulu Musini (nmusini) [this message]
2015-04-02 9:04 ` [PATCH v3 2/9] snic:Add interrupt, resource firmware interfaces Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 3/9] snic:Add meta request, handling of meta requests Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 4/9] snic:Add snic target discovery Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 5/9] snic:add SCSI handling, AEN, and fwreset handling Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 6/9] snic:Add low level queuing interfaces Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 7/9] snic:Add sysfs entries to list stats and trace data Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 8/9] snic:Add event tracing to capture IO events Narsimhulu Musini
2015-04-02 9:04 ` [PATCH v3 9/9] snic:Add Makefile, patch Kconfig, MAINTAINERS Narsimhulu Musini
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=D14AE940.1FFAC%nmusini@cisco.com \
--to=nmusini@cisco.com \
--cc=JBottomley@Parallels.com \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--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).