Commit 06988b1f authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

lib/nvme: Attach ctrlr to second process with condition.



If user specify a trid, we should not attach other ctrlrs

Change-Id: I73a4278c1d7551908feb56d01a1c41c0d049bb91
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/377653


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent d8cdbb89
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -428,6 +428,12 @@ spdk_nvme_probe(const struct spdk_nvme_transport_id *trid, void *cb_ctx,
	 */
	if (!spdk_process_is_primary() && (trid->trtype == SPDK_NVME_TRANSPORT_PCIE)) {
		TAILQ_FOREACH(ctrlr, &g_spdk_nvme_driver->attached_ctrlrs, tailq) {
			/* Do not attach other ctrlrs if user specify a valid trid */
			if ((strlen(trid->traddr) != 0) &&
			    (spdk_nvme_transport_id_compare(trid, &ctrlr->trid))) {
				continue;
			}

			nvme_ctrlr_proc_get_ref(ctrlr);

			/*