Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
nvme-cli
0011-nvme-add-fabrics-discovery-controller-defa...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0011-nvme-add-fabrics-discovery-controller-default-port-n.patch of Package nvme-cli
From: Sagi Grimberg <sagi@grimberg.me> Date: Fri, 14 Aug 2020 13:42:37 -0700 Subject: [PATCH] nvme: add fabrics discovery controller default port number References: bsc#1180505 Git-commit: 5cde509ee656141b88498726478df5c57a394926 The IANA port number for a discovery controller is 8009 for NVMe/TCP and 4420 for any NVMe/RDMA port number. So make sure to fill it and pass it down, it will help us as we track and match connection arguments for filtering purposes. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org> --- common.h | 3 +++ fabrics.c | 17 +++++++++++++++++ linux/nvme.h | 1 + 3 files changed, 21 insertions(+) --- a/common.h +++ b/common.h @@ -9,4 +9,7 @@ #define min(x, y) ((x) > (y) ? (y) : (x)) #define max(x, y) ((x) > (y) ? (x) : (y)) +#define __stringify_1(x...) #x +#define __stringify(x...) __stringify_1(x) + #endif --- a/fabrics.c +++ b/fabrics.c @@ -855,6 +855,17 @@ static int build_options(char *argstr, i return 0; } +static void discovery_trsvcid(struct config *cfg) +{ + if (!strcmp(cfg->transport, "tcp")) { + /* Default port for NVMe/TCP discovery controllers */ + cfg->trsvcid = __stringify(NVME_DISC_IP_PORT); + } else if (!strcmp(cfg->transport, "rdma")) { + /* Default port for NVMe/RDMA controllers */ + cfg->trsvcid = __stringify(NVME_RDMA_IP_PORT); + } +} + static void set_discovery_kato(struct config *cfg) { /* Set kato to NVMF_DEF_DISC_TMO for persistent controllers */ @@ -1234,6 +1245,9 @@ static int discover_from_conf_file(const set_discovery_kato(&cfg); + if (!cfg.trsvcid) + discovery_trsvcid(&cfg); + err = build_options(argstr, BUF_SIZE, true); if (err) { ret = err; @@ -1299,6 +1313,9 @@ int discover(const char *desc, int argc, } else { set_discovery_kato(&cfg); + if (!cfg.trsvcid) + discovery_trsvcid(&cfg); + ret = build_options(argstr, BUF_SIZE, true); if (ret) goto out; --- a/linux/nvme.h +++ b/linux/nvme.h @@ -70,6 +70,7 @@ static inline uint64_t le64_to_cpu(__le6 #define NVME_DISC_SUBSYS_NAME "nqn.2014-08.org.nvmexpress.discovery" #define NVME_RDMA_IP_PORT 4420 +#define NVME_DISC_IP_PORT 8009 #define NVME_NSID_ALL 0xffffffff
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor