summaryrefslogtreecommitdiffstats
path: root/include/target/target_core_fabric.h
Commit message (Collapse)AuthorAgeFilesLines
...
* target: remove transport_generic_process_writeChristoph Hellwig2012-07-171-1/+1
| | | | | | | | Just call target_execute_cmd directly. Also, convert loopback, sbp, usb-gadget to use the newly exported target_execute_cmd(). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Add TFO->put_session() caller for HW fabric session shutdownJoern Engel2012-06-131-0/+1
| | | | | | | | | | | | | This patch adds an optional target_core_fabric_ops->put_session() caller within the existing target_put_session() code path. This is required by tcm_qla2xxx code in order to invoke it's own fabric specific session shutdown handler using se_session->sess_kref. Signed-off-by: Joern Engel <joern@logfs.org> Cc: Roland Dreier <roland@purestorage.com> Cc: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: make target_put_session voidJörn Engel2012-05-121-1/+1
| | | | | | | No real change, it effectively already was. Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Rename target_allocate_tasks to target_setup_cmd_from_cdbAndy Grover2012-04-151-1/+1
| | | | | | | | | | | This patch renames a horribly misnamed function that no longer allocate tasks to something more descriptive for it's modern use in target core. (nab: Fix up ib_srpt to use this as well ahead of a target_submit_cmd conversion) Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Remove transport_do_task_sg_chain() and associated detritusRoland Dreier2012-04-151-7/+0Star
| | | | | | | | | | | | | Now that all fabrics are converted over to using se_cmd->t_data_sg directly, we can drop the task sg chaining support. With the modern memory allocation in target core, task sg chaining is needless overhead -- we would split up the main cmd sglist into pieces, and then splice those pieces back together instead of just using the original list directly. Signed-off-by: Roland Dreier <roland@purestorage.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Drop unused legacy target_core_fabric_ops API callersNicholas Bellinger2012-03-101-4/+0Star
| | | | | | | | | | | | | | This patch drops the following unused legacy API callers from target_core_fabric.h: *) TFO->fall_back_to_erl0() *) TFO->stop_session() *) TFO->sess_logged_in() *) TFO->is_state_remove() This patch also removes the stub usage in loopback, tcm_fc, iscsi_target, and ib_srpt fabric modules. Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Add se_node_acl->acl_kref for ->acl_free_comp usageNicholas Bellinger2012-03-101-0/+1
| | | | | | | | | | | | | | | | | This patch adds se_node_acl->acl_kref for use with ->acl_free_comp during explict se_node_acl release. It adds kref_init() during se_node_acl setup, kref_get() during __transport_register_session() -> target_put_nacl() with existing transport_deregister_session() fabric callback usage. It also moves transport_free_session() to release *se_sess memory after target_put_nacl() execution in transport_deregister_session() Cc: Roland Dreier <roland@purestorage.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Joern Engel <joern@logfs.org> Cc: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Add se_sess->sess_kref + get/put helpersNicholas Bellinger2012-03-101-0/+2
| | | | | | | | | | | | | This patch adds basic se_session->sess_kref and get/put helpers for fabric session reference counting. It sets the initial kref in transport_init_session() and adds a target_release_session() callback to invoke TFO->close_session() for final session shutdown. Cc: Roland Dreier <roland@purestorage.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Joern Engel <joern@logfs.org> Cc: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Allow target_submit_tmr interrupt context + pass ABORT_TASK tagNicholas Bellinger2012-02-261-1/+2
| | | | | | | | | | | | | | This patch allows target_submit_tmr() to pass gfp_t for se_cmd->se_tmr_req allocation, and also set up se_cmd->se_tmr_req->ref_task_tag for passed tag with TMR_ABORT_TASK. Also update tcm_fc(fcoe) parameter usgae and add ref_task_tag FIXME for TMR_ABORT_TASK usage, Cc: Andy Grover <agrover@redhat.com> Cc: Kiran Patil <kiran.patil@intel.com> Cc: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Fix target_submit_tmr se_tmr_req allocation failuresNicholas Bellinger2012-02-261-1/+1
| | | | | | | | | | | This patch makes target_submit_tmr() se_tmr_req allocation occur before target_get_sess_cmd(), and changes target_submit_tmr() to return a failure w/ non zero status to the fabric caller upon core_tmr_alloc_req() failure. Cc: Andy Grover <agrover@redhat.com> Cc: Kiran Patil <kiran.patil@intel.com> Cc: Arun Easi <arun.easi@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Export transport_generic_request_failure symbolNicholas Bellinger2012-02-251-0/+1
| | | | | | | | | | | | | | transport_generic_request_failure() is a wrapper around calling transport_send_check_condition_and_sense() that is required once an se_cmd->cmd_kref has been obtained via target_submit_cmd() -> target_get_sess_cmd(). tcm_qla2xxx currently requires this, and since it's necessary for other callers using target_submit_cmd() make it exportable now. Reported-by: Roland Dreier <roland@purestorage.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Add target_submit_tmr helper functionAndy Grover2012-02-251-0/+3
| | | | | | | | | | | Similar to target_submit_cmd, this function lets fabrics call one function (albeit with a lot of parameters) instead of 3 or more. (nab: Add missing return for transport_lookup_tmr_lun failure) Signed-off-by: Andy Grover <agrover@redhat.com> Cc: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Add SCF_SCSI_TMR_CDB usage and drop se_tmr_req_cacheAndy Grover2012-02-251-1/+1
| | | | | | | | | | | | Change the test for if a cmd is a tmr request to checking if SCF_SCSI_TMR_CDB (a new flag) is set in cmd->se_cmd_flags. Also remove se_tmr_req_cache usage in favor of kzalloc usage, and make core_tmr_alloc_req() return int + setup se_cmd->se_tmr_req directly and fix up various fabric module usages Cc: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Change target_submit_cmd() to return voidAndy Grover2012-02-071-1/+1
| | | | | | | | | | | | | | | | Retval not very useful, and may even be harmful. Once submitted, fabrics should expect a sense error if anything goes wrong. All fabrics checking of this retval are useless or broken: fc checks it just to emit more debug output. ib_srpt trickles retval up, then it is ignored. qla2xxx trickles it up, which then causes a bug because the abort goto in qla_target.c thinks cmd hasn't been sent to target. Just returning nothing is best. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Remove TFO->check_release_cmd() fabric API callerNicholas Bellinger2011-12-141-4/+0Star
| | | | | | | | Remove the now unused target_core_fabric_ops->check_release_cmd() as target_core handles this directly for se_cmd->cmd_kref objects now. Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: Add target_submit_cmd() for process context fabric submissionNicholas Bellinger2011-12-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a target_submit_cmd() caller that can be used by fabrics to submit an uninitialized se_cmd descriptor to an struct se_session + unpacked_lun from workqueue process context. This call will invoke the following steps: - transport_init_se_cmd() to setup se_cmd specific pointers - Obtain se_cmd->cmd_kref references with target_get_sess_cmd() - set se_cmd->t_tasks_bidi - transport_lookup_cmd_lun() to setup struct se_cmd->se_lun from the passed unpacked_lun - transport_generic_allocate_tasks() to setup the passed *cdb, and - transport_handle_cdb_direct() handle READ dispatch or WRITE ready-to-transfer callback to fabric v2 changes from hch feedback: *) Add target_sc_flags_table for target_submit_cmd flags *) Rename bidi parameter to flags, add TARGET_SCF_BIDI_OP *) Convert checks to BUG_ON *) Add out_check_cond for transport_send_check_condition_and_sense usage v3 changes: *) Add TARGET_SCF_ACK_KREF for target_submit_cmd into target_get_sess_cmd to determine when the fabric caller is expecting a second kref_put() from fabric packet acknowledgement. Cc: Christoph Hellwig <hch@lst.de> Cc: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* target: header reshuffle, part2Christoph Hellwig2011-12-141-0/+189
This reorganized the headers under include/target into: - target_core_base.h stays as is with all target-wide data stuctures and defines - target_core_backend.h contains the whole interface to I/O backends - target_core_fabric.h contains the whole interface to fabric modules Except for those only the various configfs macro headers stay around. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>