From 5a8033a5f3d81cf2ce04527489e063e6ed2970bf Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Mon, 29 Jul 2019 04:48:37 -0400 Subject: [PATCH] examples/nvme/arbitration: only do the arbitration get/set_features for supported controllers Change-Id: Ia34564688bdc0dca95d337519b80ef92ef90239d Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463488 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- examples/nvme/arbitration/arbitration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/nvme/arbitration/arbitration.c b/examples/nvme/arbitration/arbitration.c index 36f01e02f..64680af10 100644 --- a/examples/nvme/arbitration/arbitration.c +++ b/examples/nvme/arbitration/arbitration.c @@ -253,6 +253,7 @@ register_ctrlr(struct spdk_nvme_ctrlr *ctrlr) int nsid, num_ns; struct spdk_nvme_ns *ns; struct ctrlr_entry *entry = calloc(1, sizeof(struct ctrlr_entry)); + union spdk_nvme_cap_register cap = spdk_nvme_ctrlr_get_regs_cap(ctrlr); const struct spdk_nvme_ctrlr_data *cdata = spdk_nvme_ctrlr_get_data(ctrlr); if (entry == NULL) { @@ -280,7 +281,8 @@ register_ctrlr(struct spdk_nvme_ctrlr *ctrlr) register_ns(ctrlr, ns); } - if (g_arbitration.arbitration_mechanism == SPDK_NVME_CAP_AMS_WRR) { + if (g_arbitration.arbitration_mechanism == SPDK_NVME_CAP_AMS_WRR && + (cap.bits.ams & SPDK_NVME_CAP_AMS_WRR)) { get_arb_feature(ctrlr); if (g_arbitration.arbitration_config != 0) {