From d24bbd592f9734de9d3b3b1041f2d5e478b1b33c Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 3 Feb 2022 14:06:47 -0700 Subject: [PATCH] idxd: Calculate number of descriptors per channel based on total wq size Assume any given WQ we are allocated can submit the full device allowed queue depth. Signed-off-by: Ben Walker Change-Id: I044e1f70031ea83ae722ed285b84c06b3e5efb27 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11486 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse --- lib/idxd/idxd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index a5e6a158c..ff518efcb 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -124,7 +124,7 @@ spdk_idxd_get_channel(struct spdk_idxd_device *idxd) pthread_mutex_unlock(&idxd->num_channels_lock); /* Allocate descriptors and completions */ - num_descriptors = idxd->queues[0].wqcfg.wq_size / idxd->chan_per_device; + num_descriptors = idxd->total_wq_size / idxd->chan_per_device; chan->desc_base = desc = spdk_zmalloc(num_descriptors * sizeof(struct idxd_hw_desc), 0x40, NULL, SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA);