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 <benjamin.walker@intel.com>
Change-Id: I044e1f70031ea83ae722ed285b84c06b3e5efb27
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11486
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Ben Walker 2022-02-03 14:06:47 -07:00 committed by Tomasz Zawadzki
parent b3d3f2028b
commit d24bbd592f

View File

@ -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);