summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2026-03-01 05:05:49 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2026-03-01 05:05:49 +0300
commit1bf5c303eb9898930c5313769df14a76c51075c1 (patch)
treef69630478f69a4a6d9655735bbd1da48a0ed6bf8 /include
parent7179e626b76eb42f2529c6f6dd6ba88ea2445372 (diff)
parenta4d72d2dd0cbc3ff20f66a9168dd68b191c57409 (diff)
downloadlinux-1bf5c303eb9898930c5313769df14a76c51075c1.tar.xz
Merge patch series "scsi: target: Add support for completing commands from backend context"
The following patches made over Linus's current tree allow users to tell the target layer to perform direct completions instead of always deferring to LIO's completion workqueue. When the frontend driver already has multiple worker threads (or you are doing a LUN per target with a single thread per target) then bypassing the LIO workqueue can increase performance 20-30%. Link: https://patch.msgid.link/20260222232946.7637-1-michael.christie@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/target/target_core_base.h10
-rw-r--r--include/target/target_core_fabric.h12
2 files changed, 19 insertions, 3 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index b62d5fcce950..9a0e9f9e1ec4 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -111,6 +111,15 @@
/* Peripheral Device Text Identification Information */
#define PD_TEXT_ID_INFO_LEN 256
+enum target_compl_type {
+ /* Use the fabric driver's default completion type */
+ TARGET_FABRIC_DEFAULT_COMPL,
+ /* Complete from the backend calling context */
+ TARGET_DIRECT_COMPL,
+ /* Defer completion to the LIO workqueue */
+ TARGET_QUEUE_COMPL,
+};
+
enum target_submit_type {
/* Use the fabric driver's default submission type */
TARGET_FABRIC_DEFAULT_SUBMIT,
@@ -741,6 +750,7 @@ struct se_dev_attrib {
u32 atomic_granularity;
u32 atomic_max_with_boundary;
u32 atomic_max_boundary;
+ u8 complete_type;
u8 submit_type;
struct se_device *da_dev;
struct config_group da_group;
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 3378ff9ee271..e9039e73d058 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -119,14 +119,20 @@ struct target_core_fabric_ops {
*/
unsigned int write_pending_must_be_called:1;
/*
+ * Set this if the driver does not require calling queue_data_in
+ * queue_status and check_stop_free from a worker thread when
+ * completing successful commands.
+ */
+ unsigned int direct_compl_supp:1;
+ /*
* Set this if the driver supports submitting commands to the backend
* from target_submit/target_submit_cmd.
*/
unsigned int direct_submit_supp:1;
- /*
- * Set this to a target_submit_type value.
- */
+ /* Set this to a target_submit_type value. */
u8 default_submit_type;
+ /* Set this to the target_compl_type value. */
+ u8 default_compl_type;
};
int target_register_template(const struct target_core_fabric_ops *fo);