diff --git a/lib/idxd/idxd.h b/lib/idxd/idxd.h index 1cc93f47f..78bd0f6ae 100644 --- a/lib/idxd/idxd.h +++ b/lib/idxd/idxd.h @@ -149,11 +149,6 @@ struct idxd_ops { }; SPDK_STATIC_ASSERT(sizeof(struct idxd_ops) == 96, "size mismatch"); -struct idxd_wq { - struct spdk_idxd_device *idxd; - struct idxd_group *group; -}; - struct spdk_idxd_impl { const char *name; int (*probe)(void *cb_ctx, spdk_idxd_attach_cb attach_cb); @@ -174,7 +169,6 @@ struct spdk_idxd_device { pthread_mutex_t num_channels_lock; struct idxd_group *groups; - struct idxd_wq *queues; }; void idxd_impl_register(struct spdk_idxd_impl *impl); diff --git a/lib/idxd/idxd_kernel.c b/lib/idxd/idxd_kernel.c index 3ede6e927..2cf5dedeb 100644 --- a/lib/idxd/idxd_kernel.c +++ b/lib/idxd/idxd_kernel.c @@ -250,7 +250,6 @@ static int kernel_idxd_wq_config(struct spdk_kernel_idxd_device *kernel_idxd) { uint32_t i; - struct idxd_wq *queue; struct spdk_idxd_device *idxd = &kernel_idxd->idxd; /* initialize the group */ @@ -265,20 +264,6 @@ kernel_idxd_wq_config(struct spdk_kernel_idxd_device *kernel_idxd) idxd->groups[i].id = i; } - idxd->queues = calloc(g_kernel_dev_cfg.total_wqs, sizeof(struct idxd_wq)); - if (idxd->queues == NULL) { - SPDK_ERRLOG("Failed to allocate queue memory\n"); - return -ENOMEM; - } - - for (i = 0; i < g_kernel_dev_cfg.total_wqs; i++) { - queue = &idxd->queues[i]; - - /* Not part of the config struct */ - queue->idxd = idxd; - queue->group = &idxd->groups[i % g_kernel_dev_cfg.num_groups]; - } - return 0; } diff --git a/lib/idxd/idxd_user.c b/lib/idxd/idxd_user.c index 172159f32..c82576290 100644 --- a/lib/idxd/idxd_user.c +++ b/lib/idxd/idxd_user.c @@ -251,7 +251,6 @@ static int idxd_wq_config(struct spdk_user_idxd_device *user_idxd) { uint32_t j; - struct idxd_wq *queue; struct spdk_idxd_device *idxd = &user_idxd->idxd; uint32_t wq_size; union idxd_wqcap_register wqcap; @@ -273,16 +272,10 @@ idxd_wq_config(struct spdk_user_idxd_device *user_idxd) * and achieve optimal performance for common cases. */ idxd->chan_per_device = (idxd->total_wq_size >= 128) ? 8 : 4; - idxd->queues = calloc(1, sizeof(struct idxd_wq)); - if (idxd->queues == NULL) { - SPDK_ERRLOG("Failed to allocate queue memory\n"); - return -ENOMEM; - } table_offsets.raw[0] = spdk_mmio_read_8(&user_idxd->registers->offsets.raw[0]); table_offsets.raw[1] = spdk_mmio_read_8(&user_idxd->registers->offsets.raw[1]); - queue = idxd->queues; wqtbl = (struct idxd_wqtbl *)((uint8_t *)user_idxd->registers + (table_offsets.wqcfg * IDXD_TABLE_OFFSET_MULT)); @@ -300,10 +293,6 @@ idxd_wq_config(struct spdk_user_idxd_device *user_idxd) wqcfg.wq_state = WQ_ENABLED; wqcfg.priority = WQ_PRIORITY_1; - /* Not part of the config struct */ - queue->idxd = idxd; - queue->group = idxd->groups; - /* * Now write the work queue config to the device for configured queues */ @@ -388,7 +377,6 @@ idxd_device_configure(struct spdk_user_idxd_device *user_idxd) return rc; err_wq_enable: err_device_enable: - free(idxd->queues); err_wq_cfg: free(idxd->groups); err_group_cfg: @@ -409,7 +397,6 @@ user_idxd_device_destruct(struct spdk_idxd_device *idxd) idxd_unmap_pci_bar(idxd, IDXD_MMIO_BAR); idxd_unmap_pci_bar(idxd, IDXD_WQ_BAR); free(idxd->groups); - free(idxd->queues); spdk_pci_device_detach(user_idxd->device); free(user_idxd); diff --git a/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c b/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c index 675a8baa8..366e55c5d 100644 --- a/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c +++ b/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c @@ -134,8 +134,6 @@ test_idxd_wq_config(void) CU_ASSERT(wqtbl->wq[0].max_xfer_shift == LOG2_WQ_MAX_XFER); CU_ASSERT(wqtbl->wq[0].wq_state == WQ_ENABLED); CU_ASSERT(wqtbl->wq[0].priority == WQ_PRIORITY_1); - CU_ASSERT(idxd->queues->idxd == idxd); - CU_ASSERT(idxd->queues->group == idxd->groups); for (i = 1 ; i < user_idxd.registers->wqcap.num_wqs; i++) { for (j = 0 ; j < (sizeof(union idxd_wqcfg) / sizeof(uint32_t)); j++) { @@ -143,7 +141,6 @@ test_idxd_wq_config(void) } } - free(idxd->queues); free(user_idxd.registers); free(idxd->groups);