Skip to content

Commit 9b17a87

Browse files
committed
fabrics: add default port number for NVMe/TCP I/O controllers
As per section 7.4.9.3 "Transport Service Identifier" of the NVMe over Fabrics 1.1 specification, the default IANA port number for a NVMe/TCP discovery controller is 8009. But at the same time, it also clearly states that NVMe/TCP I/O controllers should not use TCP port number 8009, but may instead use 4420 as the default here. So make sure to fill these values appropriately, and pass it down. Signed-off-by: Martin George <[email protected]> [dwagner: backport from monolithic branch] Signed-off-by: Daniel Wagner <[email protected]>
1 parent fcfc388 commit 9b17a87

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/nvme/tree.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,13 @@ void nvme_free_ctrl(nvme_ctrl_t c)
922922
static void discovery_trsvcid(nvme_ctrl_t c)
923923
{
924924
if (!strcmp(c->transport, "tcp")) {
925-
/* Default port for NVMe/TCP discovery controllers */
926-
c->trsvcid = strdup(__stringify(NVME_DISC_IP_PORT));
925+
if (c->discovery_ctrl) {
926+
/* Default port for NVMe/TCP discovery controllers */
927+
c->trsvcid = strdup(__stringify(NVME_DISC_IP_PORT));
928+
} else {
929+
/* Default port for NVMe/TCP io controllers */
930+
c->trsvcid = __stringify(NVME_RDMA_IP_PORT);
931+
}
927932
} else if (!strcmp(c->transport, "rdma")) {
928933
/* Default port for NVMe/RDMA controllers */
929934
c->trsvcid = strdup(__stringify(NVME_RDMA_IP_PORT));

0 commit comments

Comments
 (0)