Commit 9e65d3bb authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/nvme: Rename nvme_bdev_ctrlr_trid by nvme_ctrlr_trid



This object is used for failover and per I/O path. A controller may
have multiple of this object. A controller is per path and may be
aggregated by an new object. Hence this object is a lower layer
object.

Based on the new naming rule, rename nvme_bdev_ctrlr_trid by
nvme_ctrlr_trid.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0d5e5812560a6947a0c25af05dea168e8745130e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8380


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarZiye Yang <ziye.yang@intel.com>
parent c4626aa4
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -522,7 +522,7 @@ bdev_nvme_reset_io_complete(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr,
static void
_bdev_nvme_reset_complete(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, int rc)
{
	struct nvme_bdev_ctrlr_trid *curr_trid;
	struct nvme_ctrlr_trid *curr_trid;
	struct spdk_bdev_io *bdev_io = nvme_bdev_ctrlr->reset_bdev_io;

	nvme_bdev_ctrlr->reset_bdev_io = NULL;
@@ -672,7 +672,7 @@ bdev_nvme_reset(struct nvme_ctrlr_channel *ctrlr_ch, struct spdk_bdev_io *bdev_i
static int
_bdev_nvme_failover_start(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, bool remove)
{
	struct nvme_bdev_ctrlr_trid *curr_trid = NULL, *next_trid = NULL;
	struct nvme_ctrlr_trid *curr_trid = NULL, *next_trid = NULL;
	int rc;

	pthread_mutex_lock(&nvme_bdev_ctrlr->mutex);
@@ -1824,7 +1824,7 @@ nvme_bdev_ctrlr_create(struct spdk_nvme_ctrlr *ctrlr,
		       struct nvme_async_probe_ctx *ctx)
{
	struct nvme_bdev_ctrlr *nvme_bdev_ctrlr;
	struct nvme_bdev_ctrlr_trid *trid_entry;
	struct nvme_ctrlr_trid *trid_entry;
	uint32_t i, num_ns;
	int rc;

@@ -2157,7 +2157,7 @@ bdev_nvme_compare_trids(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr,
			struct spdk_nvme_ctrlr *new_ctrlr,
			struct spdk_nvme_transport_id *trid)
{
	struct nvme_bdev_ctrlr_trid *tmp_trid;
	struct nvme_ctrlr_trid *tmp_trid;

	if (trid->trtype == SPDK_NVME_TRANSPORT_PCIE) {
		SPDK_ERRLOG("PCIe failover is not supported.\n");
@@ -2219,7 +2219,7 @@ static int
_bdev_nvme_add_secondary_trid(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr,
			      struct spdk_nvme_transport_id *trid)
{
	struct nvme_bdev_ctrlr_trid *new_trid, *tmp_trid;
	struct nvme_ctrlr_trid *new_trid, *tmp_trid;

	new_trid = calloc(1, sizeof(*new_trid));
	if (new_trid == NULL) {
@@ -2409,7 +2409,7 @@ static int
bdev_nvme_delete_secondary_trid(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr,
				const struct spdk_nvme_transport_id *trid)
{
	struct nvme_bdev_ctrlr_trid	*ctrlr_trid, *tmp_trid;
	struct nvme_ctrlr_trid	*ctrlr_trid, *tmp_trid;

	if (!spdk_nvme_transport_id_compare(trid, nvme_bdev_ctrlr->connected_trid)) {
		return -EBUSY;
@@ -2430,7 +2430,7 @@ int
bdev_nvme_delete(const char *name, const struct spdk_nvme_transport_id *trid)
{
	struct nvme_bdev_ctrlr		*nvme_bdev_ctrlr;
	struct nvme_bdev_ctrlr_trid	*ctrlr_trid;
	struct nvme_ctrlr_trid	*ctrlr_trid;

	if (name == NULL) {
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ nvme_bdev_dump_trid_json(const struct spdk_nvme_transport_id *trid, struct spdk_
void
nvme_bdev_ctrlr_delete(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr)
{
	struct nvme_bdev_ctrlr_trid *trid, *tmp_trid;
	struct nvme_ctrlr_trid *trid, *tmp_trid;
	uint32_t i;

	if (nvme_bdev_ctrlr->opal_dev) {
+3 −3
Original line number Diff line number Diff line
@@ -70,9 +70,9 @@ struct nvme_ns {

struct ocssd_bdev_ctrlr;

struct nvme_bdev_ctrlr_trid {
struct nvme_ctrlr_trid {
	struct spdk_nvme_transport_id		trid;
	TAILQ_ENTRY(nvme_bdev_ctrlr_trid)	link;
	TAILQ_ENTRY(nvme_ctrlr_trid)		link;
	bool					is_failed;
};

@@ -112,7 +112,7 @@ struct nvme_bdev_ctrlr {
	/** linked list pointer for device list */
	TAILQ_ENTRY(nvme_bdev_ctrlr)		tailq;

	TAILQ_HEAD(, nvme_bdev_ctrlr_trid)	trids;
	TAILQ_HEAD(, nvme_ctrlr_trid)		trids;

	pthread_mutex_t				mutex;
};
+3 −3
Original line number Diff line number Diff line
@@ -1028,7 +1028,7 @@ test_reset_ctrlr(void)
	struct spdk_nvme_transport_id trid = {};
	struct spdk_nvme_ctrlr ctrlr = {};
	struct nvme_bdev_ctrlr *nvme_bdev_ctrlr = NULL;
	struct nvme_bdev_ctrlr_trid *curr_trid;
	struct nvme_ctrlr_trid *curr_trid;
	struct spdk_io_channel *ch1, *ch2;
	struct nvme_ctrlr_channel *ctrlr_ch1, *ctrlr_ch2;
	int rc;
@@ -1211,7 +1211,7 @@ test_failover_ctrlr(void)
	struct spdk_nvme_transport_id trid1 = {}, trid2 = {};
	struct spdk_nvme_ctrlr ctrlr = {};
	struct nvme_bdev_ctrlr *nvme_bdev_ctrlr = NULL;
	struct nvme_bdev_ctrlr_trid *curr_trid, *next_trid;
	struct nvme_ctrlr_trid *curr_trid, *next_trid;
	struct spdk_io_channel *ch1, *ch2;
	int rc;

@@ -1929,7 +1929,7 @@ test_remove_trid(void)
	struct spdk_nvme_transport_id trid1 = {}, trid2 = {}, trid3 = {};
	struct spdk_nvme_ctrlr ctrlr = {};
	struct nvme_bdev_ctrlr *nvme_bdev_ctrlr = NULL;
	struct nvme_bdev_ctrlr_trid *ctrid;
	struct nvme_ctrlr_trid *ctrid;
	int rc;

	ut_init_trid(&trid1);
+2 −2
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ create_nvme_bdev_controller(const struct spdk_nvme_transport_id *trid, const cha
{
	struct spdk_nvme_ctrlr *ctrlr;
	struct nvme_bdev_ctrlr *nvme_bdev_ctrlr;
	struct nvme_bdev_ctrlr_trid *trid_entry;
	struct nvme_ctrlr_trid *trid_entry;
	uint32_t nsid;
	int rc;

@@ -220,7 +220,7 @@ create_nvme_bdev_controller(const struct spdk_nvme_transport_id *trid, const cha
	nvme_bdev_ctrlr->namespaces = calloc(ctrlr->ns_count, sizeof(struct nvme_ns *));
	SPDK_CU_ASSERT_FATAL(nvme_bdev_ctrlr->namespaces != NULL);

	trid_entry = calloc(1, sizeof(struct nvme_bdev_ctrlr_trid));
	trid_entry = calloc(1, sizeof(struct nvme_ctrlr_trid));
	SPDK_CU_ASSERT_FATAL(trid_entry != NULL);
	trid_entry->trid = *trid;