From 26fdb2d8b3185acd75666b32d7e2b04c34827fb4 Mon Sep 17 00:00:00 2001 From: paul luse Date: Mon, 8 Feb 2021 13:38:32 -0500 Subject: [PATCH] lib/idxd: remove unsed config elements and add a config print Add print to confirm how groups/queues/engines are being programmed based on the init RPC used. Signed-off-by: paul luse Change-Id: Ic9462c19c6899478a803433f90d9db9249dd5ca1 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6325 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- lib/idxd/idxd.c | 17 ++++++++++------- lib/idxd/idxd.h | 2 -- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index b08a7d093..f1683d940 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -62,8 +62,6 @@ struct device_config *g_dev_cfg = NULL; struct device_config g_dev_cfg0 = { .config_num = 0, .num_groups = 1, - .num_wqs_per_group = 1, - .num_engines_per_group = 4, .total_wqs = 1, .total_engines = 4, }; @@ -71,8 +69,6 @@ struct device_config g_dev_cfg0 = { struct device_config g_dev_cfg1 = { .config_num = 1, .num_groups = 2, - .num_wqs_per_group = 2, - .num_engines_per_group = 2, .total_wqs = 4, .total_engines = 4, }; @@ -439,6 +435,7 @@ idxd_group_config(struct spdk_idxd_device *idxd) { int i; uint64_t base_offset; + struct idxd_grpcfg *grpcfg; assert(g_dev_cfg->num_groups <= idxd->registers.groupcap.num_groups); idxd->groups = calloc(idxd->registers.groupcap.num_groups, sizeof(struct idxd_group)); @@ -473,16 +470,22 @@ idxd_group_config(struct spdk_idxd_device *idxd) */ for (i = 0 ; i < idxd->registers.groupcap.num_groups; i++) { + grpcfg = &idxd->groups[i].grpcfg; + if (i < g_dev_cfg->num_groups) { + SPDK_DEBUGLOG(idxd, "Group #%u: wqueue_cfg 0x%lx, engine_cfg 0x%lx, flags 0x%x\n", i, + grpcfg->wqs[0], grpcfg->engines, grpcfg->flags.raw); + } + base_offset = idxd->grpcfg_offset + i * 64; /* GRPWQCFG, work queues config */ - _idxd_write_8(idxd, base_offset, idxd->groups[i].grpcfg.wqs[0]); + _idxd_write_8(idxd, base_offset, grpcfg->wqs[0]); /* GRPENGCFG, engine config */ - _idxd_write_8(idxd, base_offset + CFG_ENGINE_OFFSET, idxd->groups[i].grpcfg.engines); + _idxd_write_8(idxd, base_offset + CFG_ENGINE_OFFSET, grpcfg->engines); /* GRPFLAGS, flags config */ - _idxd_write_8(idxd, base_offset + CFG_FLAG_OFFSET, idxd->groups[i].grpcfg.flags.raw); + _idxd_write_8(idxd, base_offset + CFG_FLAG_OFFSET, grpcfg->flags.raw); } return 0; diff --git a/lib/idxd/idxd.h b/lib/idxd/idxd.h index 085823bff..10cb5b998 100644 --- a/lib/idxd/idxd.h +++ b/lib/idxd/idxd.h @@ -91,8 +91,6 @@ struct idxd_batch { struct device_config { uint8_t config_num; - uint8_t num_wqs_per_group; - uint8_t num_engines_per_group; uint8_t num_groups; uint16_t total_wqs; uint16_t total_engines;