Skip to content

Commit 316dabe

Browse files
Hannes Reineckekeithbusch
authored andcommitted
nvmet: add tls_concat and tls_key debugfs entries
Add debugfs entries to display the 'concat' and 'tls_key' controller attributes. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent fa2e0f8 commit 316dabe

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

drivers/nvme/target/debugfs.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ static int nvmet_ctrl_host_traddr_show(struct seq_file *m, void *p)
132132
}
133133
NVMET_DEBUGFS_ATTR(nvmet_ctrl_host_traddr);
134134

135+
#ifdef CONFIG_NVME_TARGET_TCP_TLS
136+
static int nvmet_ctrl_tls_key_show(struct seq_file *m, void *p)
137+
{
138+
struct nvmet_ctrl *ctrl = m->private;
139+
key_serial_t keyid = nvmet_queue_tls_keyid(ctrl->sqs[0]);
140+
141+
seq_printf(m, "%08x\n", keyid);
142+
return 0;
143+
}
144+
NVMET_DEBUGFS_ATTR(nvmet_ctrl_tls_key);
145+
146+
static int nvmet_ctrl_tls_concat_show(struct seq_file *m, void *p)
147+
{
148+
struct nvmet_ctrl *ctrl = m->private;
149+
150+
seq_printf(m, "%d\n", ctrl->concat);
151+
return 0;
152+
}
153+
NVMET_DEBUGFS_ATTR(nvmet_ctrl_tls_concat);
154+
#endif
155+
135156
int nvmet_debugfs_ctrl_setup(struct nvmet_ctrl *ctrl)
136157
{
137158
char name[32];
@@ -157,6 +178,12 @@ int nvmet_debugfs_ctrl_setup(struct nvmet_ctrl *ctrl)
157178
&nvmet_ctrl_state_fops);
158179
debugfs_create_file("host_traddr", S_IRUSR, ctrl->debugfs_dir, ctrl,
159180
&nvmet_ctrl_host_traddr_fops);
181+
#ifdef CONFIG_NVME_TARGET_TCP_TLS
182+
debugfs_create_file("tls_concat", S_IRUSR, ctrl->debugfs_dir, ctrl,
183+
&nvmet_ctrl_tls_concat_fops);
184+
debugfs_create_file("tls_key", S_IRUSR, ctrl->debugfs_dir, ctrl,
185+
&nvmet_ctrl_tls_key_fops);
186+
#endif
160187
return 0;
161188
}
162189

0 commit comments

Comments
 (0)