From: Mike Christie <michael.christie@oracle.com>
To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
target-devel@vger.kernel.org
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH v2 8/8] scsi: target: Export fabric driver direct submit settings
Date: Wed, 27 Sep 2023 21:09:07 -0500 [thread overview]
Message-ID: <20230928020907.5730-8-michael.christie@oracle.com> (raw)
In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com>
This exports the fabric driver's direct submit settings, so users know
what the driver supports. It will be helpful when they are exporting
a device through different targets and one doesn't support direct
submission.
The new files allow the fabric to report what submission types they
default to and if they support direct submission:
default_submit_type:
1 - TARGET_DIRECT_SUBMIT - If the user has not requested a specific
value then the fabric requests direction submission.
2 - TARGET_QUEUE_SUBMIT - If the user has not requested a specific
value then the fabric requests queued submission.
Note that these fabric values are based on what the fabric driver
currently defaults to for compat with exiting setups.
direct_submit_supported:
0 - The fabric does not support direct submission.
1 - The fabric supports direct submission.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
drivers/target/target_core_fabric_configfs.c | 24 ++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c
index b7c637644cd4..7156a4dc1ca7 100644
--- a/drivers/target/target_core_fabric_configfs.c
+++ b/drivers/target/target_core_fabric_configfs.c
@@ -1065,8 +1065,32 @@ target_fabric_wwn_cmd_completion_affinity_store(struct config_item *item,
}
CONFIGFS_ATTR(target_fabric_wwn_, cmd_completion_affinity);
+static ssize_t
+target_fabric_wwn_default_submit_type_show(struct config_item *item,
+ char *page)
+{
+ struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn,
+ param_group);
+ return sysfs_emit(page, "%u\n",
+ wwn->wwn_tf->tf_ops->default_submit_type);
+}
+CONFIGFS_ATTR_RO(target_fabric_wwn_, default_submit_type);
+
+static ssize_t
+target_fabric_wwn_direct_submit_supported_show(struct config_item *item,
+ char *page)
+{
+ struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn,
+ param_group);
+ return sysfs_emit(page, "%u\n",
+ wwn->wwn_tf->tf_ops->direct_submit_supp);
+}
+CONFIGFS_ATTR_RO(target_fabric_wwn_, direct_submit_supported);
+
static struct configfs_attribute *target_fabric_wwn_param_attrs[] = {
&target_fabric_wwn_attr_cmd_completion_affinity,
+ &target_fabric_wwn_attr_default_submit_type,
+ &target_fabric_wwn_attr_direct_submit_supported,
NULL,
};
--
2.34.1
next prev parent reply other threads:[~2023-09-28 2:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 2:09 [PATCH v2 1/8] scsi: target: Make write_pending_must_be_called a bit field Mike Christie
2023-09-28 2:09 ` [PATCH v2 2/8] scsi: target: Have drivers report if they support direct submissions Mike Christie
2023-09-28 2:09 ` [PATCH v2 3/8] target: Move core_alua_check_nonop_delay call Mike Christie
2023-09-28 2:09 ` [PATCH v2 4/8] target: Move buffer clearing hack Mike Christie
2023-09-28 2:09 ` [PATCH v2 5/8] target: Kill transport_handle_cdb_direct Mike Christie
2023-09-28 2:09 ` [PATCH v2 6/8] scsi: target: Allow userspace to request direct submissions Mike Christie
2023-09-28 2:09 ` [PATCH v2 7/8] scsi: target: Unexport target_queue_submission Mike Christie
2023-09-28 2:09 ` Mike Christie [this message]
2023-09-28 2:31 ` [PATCH v2 0/8] scsi: target: Allow userspace to config cmd submission Mike Christie
2023-10-13 19:57 ` Martin K. Petersen
2023-10-17 1:11 ` Martin K. Petersen
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=20230928020907.5730-8-michael.christie@oracle.com \
--to=michael.christie@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).