Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scsi lib #280

Closed
wants to merge 64 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8b00965
target: Convert demo-mode only drivers to target_alloc_session
Jan 9, 2016
1ccafc1
vhost/scsi: Convert to target_alloc_session usage
Jan 9, 2016
910e0c6
tcm_qla2xxx: Convert to target_alloc_session usage
Jan 9, 2016
869525a
tcm_fc: Convert to target_alloc_session usage
Jan 10, 2016
d74a601
ib_srpt: Convert to target_alloc_session usage
Jan 10, 2016
e7741b0
sbp-target: Conversion to percpu_ida tag pre-allocation
Jan 23, 2016
a778862
sbp-target: Convert to TARGET_SCF_ACK_KREF I/O krefs
Jan 25, 2016
1fdf5f7
usb-gadget/tcm: Conversion to percpu_ida tag pre-allocation
Jan 23, 2016
c4468d4
usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs
Jan 25, 2016
194509e
xen-scsiback: Convert to percpu_ida tag allocation
Jan 25, 2016
130e8a2
xen-scsiback: Convert to TARGET_SCF_ACK_KREF I/O krefs
Jan 25, 2016
c8d336d
tcm_fc: Convert to TARGET_SCF_ACK_KREF I/O + TMR krefs
Jan 30, 2016
1335b45
ib_srpt: Convert to percpu_ida tag allocation
Jan 30, 2016
1d5c042
qla2xxx: Add DebugFS node for target sess list.
Feb 4, 2016
b609cc1
iser-target: Fix identification of login rx descriptor type
jennyj-mellanox Feb 24, 2016
eb2770e
iser-target: Add new state ISER_CONN_BOUND to isert_conn
jennyj-mellanox Feb 24, 2016
cd7f942
iser-target: Separate flows for np listeners and connections cma events
jennyj-mellanox Feb 24, 2016
ff93150
iser-target: Rework connection termination
jennyj-mellanox Feb 24, 2016
c3d141c
iser-target: Remove redundant wait in release_conn
jennyj-mellanox Feb 24, 2016
2e54a93
iser-target: Remove impossible condition from isert_wait_conn
jennyj-mellanox Feb 24, 2016
a6324f7
iser-target: Remove ISER_RECV_DATA_SEG_LEN
Feb 24, 2016
7e2f756
iser-target: Split and properly type the login buffer
Feb 24, 2016
c3ddb7f
iser-target: Convert to new CQ API
Feb 24, 2016
fd625eb
iser-target: Kill struct isert_rdma_wr
Feb 24, 2016
2866108
iser-target: Kill the ->isert_cmd back pointer in struct iser_tx_desc
Feb 24, 2016
cf12009
target/iblock: pass WRITE_SAME to device if possible
Feb 24, 2016
0a95b29
target: Remove enum transport_lunflags_table
Feb 25, 2016
ba6b96e
target/user: Use iovec[] to describe continuous area
yasker Feb 26, 2016
62e7b25
target/user: Free data ring in unified function
yasker Feb 26, 2016
a1171a3
target/user: Introduce data_bitmap, replace data_length/data_head/dat…
yasker Feb 26, 2016
dbfc15a
target/user: Don't free expired command when time out
yasker Feb 26, 2016
27d5306
target/user: Fix size_t format-spec build warning
Feb 28, 2016
01d6eea
target/user: Report capability of handling out-of-order completions t…
yasker Mar 1, 2016
2654cf3
target: Avoid DataIN transfers for non-GOOD SAM status
Mar 5, 2016
f630dbf
target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL
Feb 7, 2016
59e9b8e
SCSI Target Changes for VSCSI Target Driver
Mar 14, 2016
9d43b38
Adding the Libsrp library for VSCSI Target driver
Mar 14, 2016
febef65
Adding the Ibmvscsis target driver.
Mar 14, 2016
8074625
Clean up Ibmvscsis
Mar 16, 2016
30ffd09
Revert "powerpc: Simplify module TOC handling"
Mar 17, 2016
009a24a
Merge pull request #5 from powervm/IbmvscsisCleanup
Apr 5, 2016
b8b06b9
Ibmvscsis Misc fixes
Apr 6, 2016
918dac0
Merge branch 'development' of https://github.com/powervm/ibmvscsis in…
Apr 6, 2016
28bb9ed
Merge pull request #6 from powervm/test_prototype
Apr 6, 2016
2ad5b83
scsi_lib.c change function type
Apr 7, 2016
564d3fb
Merge pull request #7 from powervm/scsichanges
Apr 7, 2016
fc4b3e7
Ibmvscsis fixed probe to wait and not dest objs
Apr 11, 2016
e94b3db
Merge pull request #8 from powervm/TCMInitInProbe
Apr 11, 2016
a6a198e
Ibmvscsis - Fix inquiry function
Apr 12, 2016
9c655e5
Merge pull request #9 from powervm/FixInquiry
Apr 12, 2016
5a5a067
Ibmvscsis - changes related to structure cleanup
Apr 14, 2016
ed31b3e
Ibmvscsis - changes related to structure cleanup
Apr 14, 2016
5c3ea77
Merge branch 'development' of https://github.com/powervm/ibmvscsis in…
Apr 18, 2016
ac1e07b
Merge branch 'StructureCleanup' of https://github.com/powervm/ibmvscs…
Apr 18, 2016
0ceb865
Merge pull request #10 from powervm/StructureCleanup
Apr 18, 2016
17d9f48
LIBSRP change to add ilist back
Apr 22, 2016
8ed8541
Merge pull request #11 from powervm/libsrpfix
Apr 22, 2016
ae6c72c
libsrp .h change to fix return type
Apr 22, 2016
df6fba9
Merge pull request #12 from powervm/libsrpchanges
Apr 22, 2016
79ebd68
Ibmvscsis: checkpatch.pl cleanup
Apr 26, 2016
84aba78
Merge pull request #13 from powervm/Cleanup
Apr 26, 2016
2fd5cae
ibmvscsis: changes relating to emulation of srpcmd
Apr 27, 2016
5c9bb04
Ibmvscsis: Target Port Changes
May 2, 2016
58ad70c
Ibmvscsis: reverting scsi_lib changes
May 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
xen-scsiback: Convert to TARGET_SCF_ACK_KREF I/O krefs
Acked-by: Juergen Gross <jgross@suse.com>
Tested-by: Juergen Gross <jgross@suse.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Nicholas Bellinger committed Mar 5, 2016
commit 130e8a224b4fb15f861e7509f5cbc15feec84148
56 changes: 28 additions & 28 deletions drivers/xen/xen-scsiback.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ static void scsiback_cmd_done(struct vscsibk_pend *pending_req)
scsiback_fast_flush_area(pending_req);
scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_req);
scsiback_put(info);
/*
* Drop the extra KREF_ACK reference taken by target_submit_cmd_map_sgls()
* ahead of scsiback_check_stop_free() -> transport_generic_free_cmd()
* final se_cmd->cmd_kref put.
*/
target_put_sess_cmd(&pending_req->se_cmd);
}

static void scsiback_cmd_exec(struct vscsibk_pend *pending_req)
Expand All @@ -399,7 +405,7 @@ static void scsiback_cmd_exec(struct vscsibk_pend *pending_req)
rc = target_submit_cmd_map_sgls(se_cmd, sess, pending_req->cmnd,
pending_req->sense_buffer, pending_req->v2p->lun,
pending_req->data_len, 0,
pending_req->sc_data_direction, 0,
pending_req->sc_data_direction, TARGET_SCF_ACK_KREF,
pending_req->sgl, pending_req->n_sg,
NULL, 0, NULL, 0);
if (rc < 0) {
Expand Down Expand Up @@ -588,31 +594,28 @@ static void scsiback_disconnect(struct vscsibk_info *info)
static void scsiback_device_action(struct vscsibk_pend *pending_req,
enum tcm_tmreq_table act, int tag)
{
int rc, err = FAILED;
struct scsiback_tpg *tpg = pending_req->v2p->tpg;
struct scsiback_nexus *nexus = tpg->tpg_nexus;
struct se_cmd *se_cmd = &pending_req->se_cmd;
struct scsiback_tmr *tmr;
u64 unpacked_lun = pending_req->v2p->lun;
int rc, err = FAILED;

tmr = kzalloc(sizeof(struct scsiback_tmr), GFP_KERNEL);
if (!tmr)
goto out;
if (!tmr) {
target_put_sess_cmd(se_cmd);
goto err;
}

init_waitqueue_head(&tmr->tmr_wait);

transport_init_se_cmd(se_cmd, tpg->se_tpg.se_tpg_tfo,
tpg->tpg_nexus->tvn_se_sess, 0, DMA_NONE, TCM_SIMPLE_TAG,
&pending_req->sense_buffer[0]);

rc = core_tmr_alloc_req(se_cmd, tmr, act, GFP_KERNEL);
if (rc < 0)
goto out;

se_cmd->se_tmr_req->ref_task_tag = tag;

if (transport_lookup_tmr_lun(se_cmd, pending_req->v2p->lun) < 0)
goto out;
rc = target_submit_tmr(&pending_req->se_cmd, nexus->tvn_se_sess,
&pending_req->sense_buffer[0],
unpacked_lun, tmr, act, GFP_KERNEL,
tag, TARGET_SCF_ACK_KREF);
if (rc)
goto err;

transport_generic_handle_tmr(se_cmd);
wait_event(tmr->tmr_wait, atomic_read(&tmr->tmr_complete));

err = (se_cmd->se_tmr_req->response == TMR_FUNCTION_COMPLETE) ?
Expand All @@ -621,7 +624,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req,
scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
transport_generic_free_cmd(&pending_req->se_cmd, 1);
return;
out:
err:
if (tmr)
kfree(tmr);
scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
Expand Down Expand Up @@ -1366,21 +1369,18 @@ static u32 scsiback_tpg_get_inst_index(struct se_portal_group *se_tpg)

static int scsiback_check_stop_free(struct se_cmd *se_cmd)
{
/*
* Do not release struct se_cmd's containing a valid TMR pointer.
* These will be released directly in scsiback_device_action()
* with transport_generic_free_cmd().
*/
if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)
return 0;

transport_generic_free_cmd(se_cmd, 0);
return 1;
return transport_generic_free_cmd(se_cmd, 0);
}

static void scsiback_release_cmd(struct se_cmd *se_cmd)
{
struct se_session *se_sess = se_cmd->se_sess;
struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;

if (se_tmr && se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) {
struct scsiback_tmr *tmr = se_tmr->fabric_tmr_ptr;
kfree(tmr);
}

percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag);
}
Expand Down