From: Mike Christie <michaelc@cs.wisc.edu>
To: Jing Huang <huangj@brocade.com>
Cc: James.Bottomley@HansenPartnership.com, kgudipat@brocade.com,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
rvadivel@brocade.com, vravindr@brocade.com
Subject: Re: [PATCH 1/5] bfa: Brocade BFA FC SCSI driver (bfad)
Date: Thu, 19 Mar 2009 12:19:17 -0500 [thread overview]
Message-ID: <49C27E95.4050401@cs.wisc.edu> (raw)
In-Reply-To: <200903142003.n2EK39r4031547@blc-10-6.brocade.com>
some quick general comments:
- Patch needs to be run through checkpatch.pl again.
- If you are not implementing a callout like issue_lip then you do not
need to implement a function that does nothing.
- Remove the OS compat stuff that just calls right into the linux
function. For example kill bfad_os_pci_probe.
Jing Huang wrote:
> +
> +/**
> + * Allocate a Scsi_Host for a port.
> + */
> +int
> +bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port)
> +{
> + int error = 1;
> +
> + if (!idr_pre_get(&bfad_im_port_index, GFP_KERNEL)) {
> + printk(KERN_WARNING "idr_pre_get failure\n");
> + goto out;
> + }
> +
> + error = idr_get_new(&bfad_im_port_index, im_port,
> + &im_port->idr_id);
> + if (error) {
> + printk(KERN_WARNING "idr_get_new failure\n");
> + goto out;
> + }
> +
> + im_port->shost = bfad_os_scsi_host_alloc(im_port, bfad);
> + if (!im_port->shost) {
> + error = 1;
> + goto out_free_idr;
> + }
> +
> + im_port->shost->hostdata[0] = (unsigned long)im_port;
I think I asked about this before. Why do you just not allocate the bfad
or im_port in the hostdata? What is the struct hierarchy? Do you have
one bfad for the entire HBA/pci_device then have a im_port for each port
on the hba?
> + im_port->shost->unique_id = im_port->idr_id;
> + im_port->shost->this_id = -1;
> + im_port->shost->max_id = MAX_FCP_TARGET;
> + im_port->shost->max_lun = MAX_FCP_LUN;
> + im_port->shost->max_cmd_len = 16;
> + im_port->shost->can_queue = bfad->cfg_data.ioc_queue_depth;
> + im_port->shost->transportt = bfad_im_scsi_transport_template;
> +
> + error = bfad_os_scsi_add_host(im_port->shost, im_port, bfad);
> + if (error) {
> + printk(KERN_WARNING "bfad_os_scsi_add_host failure %d\n",
> + error);
> + goto out_fc_rel;
> + }
> +
> + /* setup host fixed attribute if the lk supports */
> + bfad_os_fc_host_init(im_port);
> +
> + return 0;
> +
> +out_fc_rel:
> + scsi_host_put(im_port->shost);
> +
> +out_free_idr:
> + idr_remove(&bfad_im_port_index, im_port->idr_id);
> +out:
> + return error;
> +}
> +
next prev parent reply other threads:[~2009-03-19 17:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-14 20:03 [PATCH 1/5] bfa: Brocade BFA FC SCSI driver (bfad) Jing Huang
2009-03-14 21:11 ` Sam Ravnborg
2009-03-19 17:19 ` Mike Christie [this message]
2009-03-21 23:03 ` Jing Huang
2009-03-21 23:03 ` Jing Huang
2009-03-23 17:17 ` Mike Christie
-- strict thread matches above, loose matches on Subject: below --
2009-03-24 0:10 Krishna Gudipati
2009-03-24 11:05 ` Rolf Eike Beer
2009-03-25 19:36 ` Krishna Gudipati
2009-03-25 19:36 ` Krishna Gudipati
2009-04-02 3:33 Krishna Gudipati
2009-04-02 9:00 ` Rolf Eike Beer
2009-07-20 6:22 Jing Huang
2009-07-20 7:43 ` Sam Ravnborg
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=49C27E95.4050401@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=James.Bottomley@HansenPartnership.com \
--cc=huangj@brocade.com \
--cc=kgudipat@brocade.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rvadivel@brocade.com \
--cc=vravindr@brocade.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.