From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>,
linux-scsi@vger.kernel.org, John Garry <john.garry@huawei.com>,
Bart van Assche <bvanassche@acm.org>,
Hannes Reinecke <hare@suse.de>
Subject: [PATCH 11/15] aacraid: move container ID into struct fib
Date: Thu, 25 Nov 2021 16:10:44 +0100 [thread overview]
Message-ID: <20211125151048.103910-12-hare@suse.de> (raw)
In-Reply-To: <20211125151048.103910-1-hare@suse.de>
Add a new field 'cid' to struct fib to hold the container ID this
I/O is destined for.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/aacraid/aachba.c | 19 +++++++++++--------
drivers/scsi/aacraid/aacraid.h | 6 +++++-
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 289c4968a92e..2cc9f79c75ff 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -646,7 +646,7 @@ static void _aac_probe_container2(void * context, struct fib * fibptr)
struct aac_mount * dresp = (struct aac_mount *) fib_data(fibptr);
__le32 sup_options2;
- fsa_dev_ptr += scmd_id(scsicmd);
+ fsa_dev_ptr += fibptr->cid;
sup_options2 =
fibptr->dev->supplement_adapter_info.supported_options2;
@@ -718,7 +718,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)
else
dinfo->command = cpu_to_le32(VM_NameServe64);
- dinfo->count = cpu_to_le32(scmd_id(scsicmd));
+ dinfo->count = cpu_to_le32(fibptr->cid);
dinfo->type = cpu_to_le32(FT_FILESYS);
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
@@ -739,7 +739,8 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)
}
}
-static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(struct scsi_cmnd *))
+static int _aac_probe_container(struct scsi_cmnd * scsicmd, unsigned int cid,
+ int (*callback)(struct scsi_cmnd *))
{
struct fib * fibptr;
int status = -ENOMEM;
@@ -748,6 +749,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru
struct aac_query_mount *dinfo;
aac_fib_init(fibptr);
+ fibptr->cid = cid;
dinfo = (struct aac_query_mount *)fib_data(fibptr);
@@ -757,7 +759,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru
else
dinfo->command = cpu_to_le32(VM_NameServe);
- dinfo->count = cpu_to_le32(scmd_id(scsicmd));
+ dinfo->count = cpu_to_le32(fibptr->cid);
dinfo->type = cpu_to_le32(FT_FILESYS);
scsicmd->SCp.ptr = (char *)callback;
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
@@ -784,7 +786,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru
if (status < 0) {
struct fsa_dev_info *fsa_dev_ptr = ((struct aac_dev *)(scsicmd->device->host->hostdata))->fsa_dev;
if (fsa_dev_ptr) {
- fsa_dev_ptr += scmd_id(scsicmd);
+ fsa_dev_ptr += cid;
if ((fsa_dev_ptr->valid & 1) == 0) {
fsa_dev_ptr->valid = 0;
return (*callback)(scsicmd);
@@ -812,7 +814,7 @@ static void aac_probe_container_scsi_done(struct scsi_cmnd *scsi_cmnd)
aac_probe_container_callback1(scsi_cmnd);
}
-int aac_probe_container(struct aac_dev *dev, int cid)
+int aac_probe_container(struct aac_dev *dev, unsigned int cid)
{
struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd), GFP_KERNEL);
struct scsi_device *scsidev = kzalloc(sizeof(*scsidev), GFP_KERNEL);
@@ -829,7 +831,8 @@ int aac_probe_container(struct aac_dev *dev, int cid)
scsidev->id = cid;
scsidev->host = dev->scsi_host_ptr;
- status = _aac_probe_container(scsicmd, aac_probe_container_callback1);
+ status = _aac_probe_container(scsicmd, cid,
+ aac_probe_container_callback1);
if (status == 0)
while (scsicmd->device == scsidev)
schedule();
@@ -2811,7 +2814,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
case TEST_UNIT_READY:
if (dev->in_reset)
return SCSI_MLQUEUE_DEVICE_BUSY;
- return _aac_probe_container(scsicmd,
+ return _aac_probe_container(scsicmd, cid,
aac_probe_container_callback2);
default:
break;
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3733df77bc65..90705c4f8ec8 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1298,6 +1298,10 @@ struct fib {
* The Adapter that this I/O is destined for.
*/
struct aac_dev *dev;
+ /*
+ * The Container that this I/O is destined for.
+ */
+ u32 cid;
/*
* This is the event the sendfib routine will wait on if the
* caller did not pass one and this is synch io.
@@ -2734,7 +2738,7 @@ int aac_fib_adapter_complete(struct fib * fibptr, unsigned short size);
struct aac_driver_ident* aac_get_driver_ident(int devtype);
int aac_get_adapter_info(struct aac_dev* dev);
int aac_send_shutdown(struct aac_dev *dev);
-int aac_probe_container(struct aac_dev *dev, int cid);
+int aac_probe_container(struct aac_dev *dev, unsigned int cid);
int _aac_rx_init(struct aac_dev *dev);
int aac_rx_select_comm(struct aac_dev *dev, int comm);
int aac_rx_deliver_producer(struct fib * fib);
--
2.29.2
next prev parent reply other threads:[~2021-11-25 15:13 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 15:10 [PATCHv9 00/15] scsi: enabled reserved commands for LLDDs Hannes Reinecke
2021-11-25 15:10 ` [PATCH 01/15] scsi: allocate host device Hannes Reinecke
2021-11-25 23:16 ` Bart Van Assche
2021-11-27 16:21 ` Hannes Reinecke
2021-11-26 2:47 ` chenxiang (M)
2021-11-27 16:52 ` Hannes Reinecke
2021-11-29 10:59 ` Hannes Reinecke
2021-11-25 15:10 ` [PATCH 02/15] scsi: add scsi_{get,put}_internal_cmd() helper Hannes Reinecke
2021-11-26 9:58 ` John Garry
2021-11-26 23:13 ` Bart Van Assche
2021-11-28 10:36 ` Hannes Reinecke
2021-12-06 17:15 ` John Garry
2021-12-06 17:46 ` Hannes Reinecke
2021-12-07 12:50 ` John Garry
2021-11-26 23:12 ` Bart Van Assche
2021-11-28 12:44 ` Hannes Reinecke
2021-11-30 4:17 ` Martin K. Petersen
2021-11-30 6:51 ` Hannes Reinecke
2021-11-28 3:33 ` Bart Van Assche
2021-11-28 13:05 ` Hannes Reinecke
2021-11-25 15:10 ` [PATCH 03/15] scsi: implement reserved command handling Hannes Reinecke
2021-11-26 23:15 ` Bart Van Assche
2021-11-29 19:15 ` Asutosh Das (asd)
2021-11-25 15:10 ` [PATCH 04/15] hpsa: move hpsa_hba_inquiry after scsi_add_host() Hannes Reinecke
2021-11-25 15:10 ` [PATCH 05/15] hpsa: use reserved commands Hannes Reinecke
2021-11-25 15:10 ` [PATCH 06/15] hpsa: use scsi_host_busy_iter() to traverse outstanding commands Hannes Reinecke
2021-11-26 9:33 ` John Garry
2021-11-27 17:00 ` Hannes Reinecke
2021-11-25 15:10 ` [PATCH 07/15] hpsa: drop refcount field from CommandList Hannes Reinecke
2021-11-25 15:10 ` [PATCH 08/15] aacraid: return valid status from aac_scsi_cmd() Hannes Reinecke
2021-11-25 15:10 ` [PATCH 09/15] aacraid: don't bother with setting SCp.Status Hannes Reinecke
2021-11-25 15:10 ` [PATCH 10/15] aacraid: move scsi_add_host() Hannes Reinecke
2021-11-25 15:10 ` Hannes Reinecke [this message]
2021-11-25 15:10 ` [PATCH 12/15] aacraid: fsa_dev pointer is always valid Hannes Reinecke
2021-11-25 15:10 ` [PATCH 13/15] aacraid: store callback in scsi_cmnd.host_scribble Hannes Reinecke
2021-11-25 15:10 ` [PATCH 14/15] aacraid: use scsi_get_internal_cmd() Hannes Reinecke
2021-11-25 15:10 ` [PATCH 15/15] aacraid: use scsi_host_busy_iter() to traverse outstanding commands 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=20211125151048.103910-12-hare@suse.de \
--to=hare@suse.de \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=john.garry@huawei.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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