Skip to content

Commit 6dbc829

Browse files
mikechristiemartinkpetersen
authored andcommitted
scsi: target: Export fabric driver direct submit settings
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 direct 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e344c00 commit 6dbc829

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/target/target_core_fabric_configfs.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,32 @@ target_fabric_wwn_cmd_completion_affinity_store(struct config_item *item,
10651065
}
10661066
CONFIGFS_ATTR(target_fabric_wwn_, cmd_completion_affinity);
10671067

1068+
static ssize_t
1069+
target_fabric_wwn_default_submit_type_show(struct config_item *item,
1070+
char *page)
1071+
{
1072+
struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn,
1073+
param_group);
1074+
return sysfs_emit(page, "%u\n",
1075+
wwn->wwn_tf->tf_ops->default_submit_type);
1076+
}
1077+
CONFIGFS_ATTR_RO(target_fabric_wwn_, default_submit_type);
1078+
1079+
static ssize_t
1080+
target_fabric_wwn_direct_submit_supported_show(struct config_item *item,
1081+
char *page)
1082+
{
1083+
struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn,
1084+
param_group);
1085+
return sysfs_emit(page, "%u\n",
1086+
wwn->wwn_tf->tf_ops->direct_submit_supp);
1087+
}
1088+
CONFIGFS_ATTR_RO(target_fabric_wwn_, direct_submit_supported);
1089+
10681090
static struct configfs_attribute *target_fabric_wwn_param_attrs[] = {
10691091
&target_fabric_wwn_attr_cmd_completion_affinity,
1092+
&target_fabric_wwn_attr_default_submit_type,
1093+
&target_fabric_wwn_attr_direct_submit_supported,
10701094
NULL,
10711095
};
10721096

0 commit comments

Comments
 (0)