Skip to content

Commit aa67023

Browse files
authored
Merge pull request #557 from igaw/misc-fabric-fixes
Miscellaneous fabric fixes/improvements
2 parents f83b2c4 + 25fad54 commit aa67023

6 files changed

Lines changed: 13 additions & 5 deletions

File tree

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ project(
1313
default_options: [
1414
'c_std=gnu99',
1515
'warning_level=1',
16-
'buildtype=release',
17-
'prefix=/usr',
16+
'buildtype=debug',
17+
'prefix=/usr/local',
1818
]
1919
)
2020

src/nvme/fabrics.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const char *nvmf_treq_str(__u8 treq)
114114
}
115115

116116
static const char * const eflags_strings[] = {
117-
[NVMF_DISC_EFLAGS_NONE] = "not specified",
117+
[NVMF_DISC_EFLAGS_NONE] = "none",
118118
[NVMF_DISC_EFLAGS_EPCSD] = "explicit discovery connections",
119119
[NVMF_DISC_EFLAGS_DUPRETINFO] = "duplicate discovery information",
120120
[NVMF_DISC_EFLAGS_EPCSD |
@@ -561,6 +561,9 @@ static int __nvmf_add_ctrl(nvme_root_t r, const char *argstr)
561561
case EOPNOTSUPP:
562562
ret = -ENVME_CONNECT_OPNOTSUPP;
563563
break;
564+
case ECONNREFUSED :
565+
ret = -ENVME_CONNECT_CONNREFUSED;
566+
break;
564567
default:
565568
ret = -ENVME_CONNECT_WRITE;
566569
break;
@@ -658,7 +661,8 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c,
658661
return -1;
659662
}
660663

661-
nvme_msg(h->r, LOG_INFO, "nvme%d: ctrl connected\n", ret);
664+
nvme_msg(h->r, LOG_INFO, "nvme%d: %s connected\n", ret,
665+
nvme_ctrl_get_subsysnqn(c));
662666
return nvme_init_ctrl(h, c, ret);
663667
}
664668

src/nvme/ioctl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,6 +3752,7 @@ static inline int nvme_fdp_reclaim_unit_handle_status(int fd, __u32 nsid,
37523752
.nsid = nsid,
37533753
.data_len = data_len,
37543754
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
3755+
.mos = 0,
37553756
.mo = NVME_IO_MGMT_RECV_RUH_STATUS,
37563757
};
37573758

src/nvme/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ int nvme_disconnect_ctrl(nvme_ctrl_t c)
931931
c->name, errno);
932932
return ret;
933933
}
934-
nvme_msg(r, LOG_INFO, "%s: disconnected\n", c->name);
934+
nvme_msg(r, LOG_INFO, "%s: %s disconnected\n", c->name, c->subsysnqn);
935935
nvme_deconfigure_ctrl(c);
936936
return 0;
937937
}

src/nvme/util.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ static const char * const libnvme_status[] = {
564564
[ENVME_CONNECT_ADDRINUSE] = "hostnqn already in use",
565565
[ENVME_CONNECT_NODEV] = "invalid interface",
566566
[ENVME_CONNECT_OPNOTSUPP] ="not supported",
567+
[ENVME_CONNECT_CONNREFUSED] = "connection refused",
567568
};
568569

569570
const char *nvme_errno_to_string(int status)

src/nvme/util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* @ENVME_CONNECT_ADDRINUSE: hostnqn already in use
3737
* @ENVME_CONNECT_NODEV: invalid interface
3838
* @ENVME_CONNECT_OPNOTSUPP: not supported
39+
* @ENVME_CONNECT_CONNREFUSED: connection refused
3940
*/
4041
enum nvme_connect_err {
4142
ENVME_CONNECT_RESOLVE = 1000,
@@ -55,6 +56,7 @@ enum nvme_connect_err {
5556
ENVME_CONNECT_ADDRINUSE,
5657
ENVME_CONNECT_NODEV,
5758
ENVME_CONNECT_OPNOTSUPP,
59+
ENVME_CONNECT_CONNREFUSED,
5860
};
5961

6062
/**

0 commit comments

Comments
 (0)