Commit db22de3e authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

scsi: iscsi: Stop using the SCSI pointer



Instead of storing the iSCSI task pointer and the session age in the SCSI
pointer, use command-private variables. This patch prepares for removal of
the SCSI pointer from struct scsi_cmnd.

The list of iSCSI drivers has been obtained as follows:
$ git grep -lw iscsi_host_alloc
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/bnx2i/bnx2i_iscsi.c
drivers/scsi/cxgbi/libcxgbi.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/libiscsi.c
drivers/scsi/qedi/qedi_main.c
drivers/scsi/qla4xxx/ql4_os.c
include/scsi/libiscsi.h

Note: it is not clear to me how the qla4xxx driver can work without this
patch since it uses the scsi_cmnd::SCp.ptr member for two different
purposes:
- The qla4xxx driver uses this member to store a struct srb pointer.
- libiscsi uses this member to store a struct iscsi_task pointer.

Reviewed-by: default avatarLee Duncan <lduncan@suse.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Cc: Chris Leech <cleech@redhat.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Manish Rangankar <mrangankar@marvell.com>
Cc: Karen Xie <kxie@chelsio.com>
Cc: Ketan Mukadam <ketan.mukadam@broadcom.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>

iscsi

Link: https://lore.kernel.org/r/20220218195117.25689-26-bvanassche@acm.org


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6b66f09c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -971,6 +971,7 @@ static struct scsi_host_template iscsi_iser_sht = {
	.proc_name              = "iscsi_iser",
	.this_id                = -1,
	.track_queue_depth	= 1,
	.cmd_size		= sizeof(struct iscsi_cmd),
};

static struct iscsi_transport iscsi_iser_transport = {
+2 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ static char const *cqe_desc[] = {

static int beiscsi_eh_abort(struct scsi_cmnd *sc)
{
	struct iscsi_task *abrt_task = (struct iscsi_task *)sc->SCp.ptr;
	struct iscsi_task *abrt_task = iscsi_cmd(sc)->task;
	struct iscsi_cls_session *cls_session;
	struct beiscsi_io_task *abrt_io_task;
	struct beiscsi_conn *beiscsi_conn;
@@ -403,6 +403,7 @@ static struct scsi_host_template beiscsi_sht = {
	.cmd_per_lun = BEISCSI_CMD_PER_LUN,
	.vendor_id = SCSI_NL_VID_TYPE_PCI | BE_VENDOR_ID,
	.track_queue_depth = 1,
	.cmd_size = sizeof(struct iscsi_cmd),
};

static struct scsi_transport_template *beiscsi_scsi_transport;
+1 −0
Original line number Diff line number Diff line
@@ -2268,6 +2268,7 @@ static struct scsi_host_template bnx2i_host_template = {
	.sg_tablesize		= ISCSI_MAX_BDS_PER_CMD,
	.shost_groups		= bnx2i_dev_groups,
	.track_queue_depth	= 1,
	.cmd_size		= sizeof(struct iscsi_cmd),
};

struct iscsi_transport bnx2i_iscsi_transport = {
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ static struct scsi_host_template cxgb3i_host_template = {
	.dma_boundary	= PAGE_SIZE - 1,
	.this_id	= -1,
	.track_queue_depth = 1,
	.cmd_size	= sizeof(struct iscsi_cmd),
};

static struct iscsi_transport cxgb3i_iscsi_transport = {
+1 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ static struct scsi_host_template cxgb4i_host_template = {
	.dma_boundary	= PAGE_SIZE - 1,
	.this_id	= -1,
	.track_queue_depth = 1,
	.cmd_size	= sizeof(struct iscsi_cmd),
};

static struct iscsi_transport cxgb4i_iscsi_transport = {
Loading