From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagi Grimberg Subject: [PATCH nvme-cli 13/11] fabrics: add tcp port tsas decoding Date: Thu, 15 Nov 2018 09:16:25 -0800 Message-ID: <20181115171626.9306-14-sagi@lightbitslabs.com> References: <20181115171626.9306-1-sagi@lightbitslabs.com> Cc: linux-block@vger.kernel.org, netdev@vger.kernel.org, Christoph Hellwig , Keith Busch To: linux-nvme@lists.infradead.org Return-path: Received: from bombadil.infradead.org ([198.137.202.133]:46210 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388798AbeKPDZX (ORCPT ); Thu, 15 Nov 2018 22:25:23 -0500 In-Reply-To: <20181115171626.9306-1-sagi@lightbitslabs.com> Sender: netdev-owner@vger.kernel.org List-ID: tcp tsas include sectype indication for unsecured/tls ports. Signed-off-by: Sagi Grimberg --- fabrics.c | 14 ++++++++++++++ linux/nvme.h | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/fabrics.c b/fabrics.c index 6fd9dfaa5d79..774ea94dc0db 100644 --- a/fabrics.c +++ b/fabrics.c @@ -141,6 +141,16 @@ static inline const char *treq_str(__u8 treq) return arg_str(treqs, ARRAY_SIZE(treqs), treq); } +static const char * const sectypes[] = { + [NVMF_TCP_SECTYPE_NONE] = "none", + [NVMF_TCP_SECTYPE_TLS] = "tls", +}; + +static inline const char *sectype_str(__u8 sectype) +{ + return arg_str(sectypes, ARRAY_SIZE(sectypes), sectype); +} + static const char * const prtypes[] = { [NVMF_RDMA_PRTYPE_NOT_SPECIFIED] = "not specified", [NVMF_RDMA_PRTYPE_IB] = "infiniband", @@ -450,6 +460,10 @@ static void print_discovery_log(struct nvmf_disc_rsp_page_hdr *log, int numrec) printf("rdma_pkey: 0x%04x\n", e->tsas.rdma.pkey); break; + case NVMF_TRTYPE_TCP: + printf("sectype: %s\n", + sectype_str(e->tsas.tcp.sectype)); + break; } } } diff --git a/linux/nvme.h b/linux/nvme.h index 7a600c791877..68000eb8c1dc 100644 --- a/linux/nvme.h +++ b/linux/nvme.h @@ -91,6 +91,13 @@ enum { NVMF_RDMA_CMS_RDMA_CM = 1, /* Sockets based endpoint addressing */ }; +/* TCP port security type for Discovery Log Page entry TSAS + */ +enum { + NVMF_TCP_SECTYPE_NONE = 0, /* No Security */ + NVMF_TCP_SECTYPE_TLS = 1, /* Transport Layer Security */ +}; + #define NVME_AQ_DEPTH 32 #define NVME_NR_AEN_COMMANDS 1 #define NVME_AQ_BLK_MQ_DEPTH (NVME_AQ_DEPTH - NVME_NR_AEN_COMMANDS) @@ -1184,6 +1191,9 @@ struct nvmf_disc_rsp_page_entry { __u16 pkey; __u8 resv10[246]; } rdma; + struct tcp { + __u8 sectype; + } tcp; } tsas; }; -- 2.17.1