Commit 32e838af authored by Ben Walker's avatar Ben Walker Committed by Daniel Verkamp
Browse files

nvme: Remove probe_info, just use transport_id



The probe_info was reduced to just containing a
transport_id, so remove probe_info entirely.

Change-Id: Ica9a22d126cd14e282decd3eea1a0afe0460f099
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 6c2e170d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -334,13 +334,13 @@ spdk_nvmf_parse_addr(char *listen_addr, char **host, char **port)
}

static bool
probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	 struct spdk_nvme_ctrlr_opts *opts)
{
	struct spdk_nvmf_probe_ctx *ctx = cb_ctx;
	struct spdk_pci_addr pci_addr;

	if (spdk_pci_addr_parse(&pci_addr, probe_info->trid.traddr)) {
	if (spdk_pci_addr_parse(&pci_addr, trid->traddr)) {
		return false;
	}

@@ -358,7 +358,7 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
}

static void
attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	  struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts)
{
	struct spdk_nvmf_probe_ctx *ctx = cb_ctx;
@@ -367,15 +367,15 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
	int numa_node = -1;
	struct spdk_pci_addr pci_addr;

	spdk_pci_addr_parse(&pci_addr, probe_info->trid.traddr);
	spdk_pci_addr_parse(&pci_addr, trid->traddr);

	SPDK_NOTICELOG("Attaching NVMe device %p at %s to subsystem %s\n",
		       ctrlr,
		       probe_info->trid.traddr,
		       trid->traddr,
		       spdk_nvmf_subsystem_get_nqn(ctx->app_subsystem->subsystem));

	snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/numa_node",
		 probe_info->trid.traddr);
		 trid->traddr);

	numa_node = spdk_get_numa_node_value(path);
	if (numa_node >= 0) {
+4 −4
Original line number Diff line number Diff line
@@ -853,22 +853,22 @@ register_workers(void)
}

static bool
probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	 struct spdk_nvme_ctrlr_opts *opts)
{
	/* Update with user specified arbitration configuration */
	opts->arb_mechanism = g_arbitration.arbitration_mechanism;

	printf("Attaching to %s\n", probe_info->trid.traddr);
	printf("Attaching to %s\n", trid->traddr);

	return true;
}

static void
attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	  struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts)
{
	printf("Attached to %s\n", probe_info->trid.traddr);
	printf("Attached to %s\n", trid->traddr);

	/* Update with actual arbitration configuration in use */
	g_arbitration.arbitration_mechanism = opts->arb_mechanism;
+4 −4
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ struct spdk_fio_thread {
};

static bool
probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	 struct spdk_nvme_ctrlr_opts *opts)
{
	struct fio_file		*f;
@@ -96,7 +96,7 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
	int rc;
	struct spdk_pci_addr pci_addr;

	if (spdk_pci_addr_parse(&pci_addr, probe_info->trid.traddr)) {
	if (spdk_pci_addr_parse(&pci_addr, trid->traddr)) {
		return false;
	}

@@ -119,7 +119,7 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
}

static void
attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	  struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts)
{
	struct thread_data 	*td = cb_ctx;
@@ -130,7 +130,7 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
	unsigned int i;
	struct spdk_pci_addr pci_addr;

	spdk_pci_addr_parse(&pci_addr, probe_info->trid.traddr);
	spdk_pci_addr_parse(&pci_addr, trid->traddr);

	/* Create an fio_ctrlr and add it to the list */
	fio_ctrlr = calloc(1, sizeof(*fio_ctrlr));
+4 −4
Original line number Diff line number Diff line
@@ -238,16 +238,16 @@ hello_world(void)
}

static bool
probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	 struct spdk_nvme_ctrlr_opts *opts)
{
	printf("Attaching to %s\n", probe_info->trid.traddr);
	printf("Attaching to %s\n", trid->traddr);

	return true;
}

static void
attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	  struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts)
{
	int nsid, num_ns;
@@ -260,7 +260,7 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
		exit(1);
	}

	printf("Attached to %s\n", probe_info->trid.traddr);
	printf("Attached to %s\n", trid->traddr);

	snprintf(entry->name, sizeof(entry->name), "%-20.20s (%-20.20s)", cdata->mn, cdata->sn);

+4 −4
Original line number Diff line number Diff line
@@ -262,19 +262,19 @@ print_stats(void)
}

static bool
probe_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	 struct spdk_nvme_ctrlr_opts *opts)
{
	printf("Attaching to %s\n", probe_info->trid.traddr);
	printf("Attaching to %s\n", trid->traddr);

	return true;
}

static void
attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info,
attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	  struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts)
{
	printf("Attached to %s\n", probe_info->trid.traddr);
	printf("Attached to %s\n", trid->traddr);

	register_dev(ctrlr);
}
Loading