From: Christoph Hellwig <hch@infradead.org>
To: Narsimhulu Musini <nmusini@cisco.com>
Cc: JBottomley@Parallels.com, linux-scsi@vger.kernel.org,
hare@suse.de, Sesidhar Baddela <sebaddel@cisco.com>
Subject: Re: [PATCH v3 1/9] snic: snic module infrastructure
Date: Thu, 2 Apr 2015 02:21:58 -0700 [thread overview]
Message-ID: <20150402092158.GA6794@infradead.org> (raw)
In-Reply-To: <1427965488-12073-2-git-send-email-nmusini@cisco.com>
> +/*
> + * 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(). That should also avoid the need for the mempool
that the driver currently creates.
> +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.
> + .cmd_per_lun = 3,
why so low?
> +
> +#ifndef PCI_VENDOR_ID_CISCO
> +#define PCI_VENDOR_ID_CISCO 0x1137
> +#endif
Just use the numeric value directly.
> +
> +#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.
next prev parent reply other threads:[~2015-04-02 9:22 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 [this message]
2015-04-08 8:55 ` Narsimhulu Musini (nmusini)
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=20150402092158.GA6794@infradead.org \
--to=hch@infradead.org \
--cc=JBottomley@Parallels.com \
--cc=hare@suse.de \
--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).