All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Jayamohan Kalickal <jayamohank@serverengines.com>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@suse.de,
	sfr@canb.auug.org.au
Subject: Re: [PATCH 4/6] be2iscsi: iscsi hook in and handling codei
Date: Tue, 08 Sep 2009 12:20:13 -0500	[thread overview]
Message-ID: <4AA6924D.9080204@cs.wisc.edu> (raw)
In-Reply-To: <20090908084007.GA19800@serverengines.com>

Sorry for the virt_to_bus screw up.

On 09/08/2009 03:40 AM, Jayamohan Kallickal wrote:
> +struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
> +						 u16 cmds_max,
> +						 u16 qdepth,
> +						 u32 initial_cmdsn)
> +{
> +	struct Scsi_Host *shost;



> +	if (!cls_session)
> +		return NULL;
> +	sess = cls_session->dd_data;
> +	max_size = ALIGN(sizeof(struct be_cmd_bhs), 64) * cmds_max;


Instead of cmds_max you should use session->cmds_max like you do below.

> +	task = sess->cmds[0];
> +	io_task = task->dd_data;


The task and io_task assignment as not needed.

> +	vaddr = pci_alloc_consistent(phba->pcidev,
> +						max_size,
> +						&bus_add);
> +	pa_addr = (__u64) bus_add;
> +
> +	for (num_cmd = 0; num_cmd<  sess->cmds_max; num_cmd++) {
> +		task = sess->cmds[num_cmd];
> +		io_task = task->dd_data;
> +		io_task->cmd_bhs = vaddr;
> +		io_task->bhs_pa.u.a64.address = pa_addr;
> +		io_task->alloc_size = max_size;
> +		vaddr += ALIGN(sizeof(struct be_cmd_bhs), 64);
> +		pa_addr += ALIGN(sizeof(struct be_cmd_bhs), 64);
> +	}
> +	return cls_session;
> +}
> +
> +/**
> + * beiscsi_session_destroy - destroys iscsi session
> + * @cls_session:	pointer to iscsi cls session
> + *
> + * Destroys iSCSI session instance and releases
> + * resources allocated for it.
> + */
> +void beiscsi_session_destroy(struct iscsi_cls_session *cls_session)
> +{
> +	struct iscsi_task *task;
> +	struct beiscsi_io_task *io_task;
> +	struct iscsi_session *sess = cls_session->dd_data;
> +	struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
> +	struct beiscsi_hba *phba = iscsi_host_priv(shost);
> +
> +	task = sess->cmds[0];
> +	io_task = task->dd_data;
> +	pci_free_consistent(phba->pcidev,
> +			    io_task->alloc_size,
> +			    io_task->cmd_bhs,
> +			    io_task->bhs_pa.u.a64.address);
> +	iscsi_session_teardown(cls_session);
> +}
> +

      reply	other threads:[~2009-09-08 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08  8:40 [PATCH 4/6] be2iscsi: iscsi hook in and handling codei Jayamohan Kallickal
2009-09-08 17:20 ` Mike Christie [this message]

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=4AA6924D.9080204@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@suse.de \
    --cc=jayamohank@serverengines.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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.