Lines Matching refs:iaa_device
387 get_iaa_device_compression_mode(struct iaa_device *iaa_device, int idx) in get_iaa_device_compression_mode() argument
389 return iaa_device->compression_modes[idx]; in get_iaa_device_compression_mode()
392 static void free_device_compression_mode(struct iaa_device *iaa_device, in free_device_compression_mode() argument
396 struct device *dev = &iaa_device->idxd->pdev->dev; in free_device_compression_mode()
419 static int init_device_compression_mode(struct iaa_device *iaa_device, in init_device_compression_mode() argument
424 struct device *dev = &iaa_device->idxd->pdev->dev; in init_device_compression_mode()
453 iaa_device->compression_modes[idx] = device_mode; in init_device_compression_mode()
456 mode->name, iaa_device->idxd->id); in init_device_compression_mode()
463 mode->name, iaa_device->idxd->id); in init_device_compression_mode()
465 free_device_compression_mode(iaa_device, device_mode); in init_device_compression_mode()
469 static int init_device_compression_modes(struct iaa_device *iaa_device, in init_device_compression_modes() argument
480 ret = init_device_compression_mode(iaa_device, mode, i, wq); in init_device_compression_modes()
488 static void remove_device_compression_modes(struct iaa_device *iaa_device) in remove_device_compression_modes() argument
494 device_mode = iaa_device->compression_modes[i]; in remove_device_compression_modes()
500 free_device_compression_mode(iaa_device, device_mode); in remove_device_compression_modes()
501 iaa_device->compression_modes[i] = NULL; in remove_device_compression_modes()
505 static struct iaa_device *iaa_device_alloc(void) in iaa_device_alloc()
507 struct iaa_device *iaa_device; in iaa_device_alloc() local
509 iaa_device = kzalloc(sizeof(*iaa_device), GFP_KERNEL); in iaa_device_alloc()
510 if (!iaa_device) in iaa_device_alloc()
513 INIT_LIST_HEAD(&iaa_device->wqs); in iaa_device_alloc()
515 return iaa_device; in iaa_device_alloc()
518 static bool iaa_has_wq(struct iaa_device *iaa_device, struct idxd_wq *wq) in iaa_has_wq() argument
522 list_for_each_entry(iaa_wq, &iaa_device->wqs, list) { in iaa_has_wq()
530 static struct iaa_device *add_iaa_device(struct idxd_device *idxd) in add_iaa_device()
532 struct iaa_device *iaa_device; in add_iaa_device() local
534 iaa_device = iaa_device_alloc(); in add_iaa_device()
535 if (!iaa_device) in add_iaa_device()
538 iaa_device->idxd = idxd; in add_iaa_device()
540 list_add_tail(&iaa_device->list, &iaa_devices); in add_iaa_device()
544 return iaa_device; in add_iaa_device()
547 static int init_iaa_device(struct iaa_device *iaa_device, struct iaa_wq *iaa_wq) in init_iaa_device() argument
551 ret = init_device_compression_modes(iaa_device, iaa_wq->wq); in init_iaa_device()
558 static void del_iaa_device(struct iaa_device *iaa_device) in del_iaa_device() argument
560 list_del(&iaa_device->list); in del_iaa_device()
565 static int add_iaa_wq(struct iaa_device *iaa_device, struct idxd_wq *wq, in add_iaa_wq() argument
568 struct idxd_device *idxd = iaa_device->idxd; in add_iaa_wq()
578 iaa_wq->iaa_device = iaa_device; in add_iaa_wq()
581 list_add_tail(&iaa_wq->list, &iaa_device->wqs); in add_iaa_wq()
583 iaa_device->n_wq++; in add_iaa_wq()
589 wq->id, iaa_device->idxd->id, iaa_device->n_wq); in add_iaa_wq()
594 static void del_iaa_wq(struct iaa_device *iaa_device, struct idxd_wq *wq) in del_iaa_wq() argument
596 struct idxd_device *idxd = iaa_device->idxd; in del_iaa_wq()
601 list_for_each_entry(iaa_wq, &iaa_device->wqs, list) { in del_iaa_wq()
604 iaa_device->n_wq--; in del_iaa_wq()
607 wq->id, iaa_device->idxd->id, in del_iaa_wq()
608 iaa_device->n_wq, nr_iaa); in del_iaa_wq()
610 if (iaa_device->n_wq == 0) in del_iaa_wq()
611 del_iaa_device(iaa_device); in del_iaa_wq()
627 static void free_iaa_device(struct iaa_device *iaa_device) in free_iaa_device() argument
629 if (!iaa_device) in free_iaa_device()
632 remove_device_compression_modes(iaa_device); in free_iaa_device()
633 kfree(iaa_device); in free_iaa_device()
638 struct iaa_device *iaa_device; in __free_iaa_wq() local
643 iaa_device = iaa_wq->iaa_device; in __free_iaa_wq()
644 if (iaa_device->n_wq == 0) in __free_iaa_wq()
645 free_iaa_device(iaa_wq->iaa_device); in __free_iaa_wq()
746 struct iaa_device *iaa_device, *found = NULL; in save_iaa_wq() local
752 list_for_each_entry(iaa_device, &iaa_devices, list) { in save_iaa_wq()
753 if (iaa_device->idxd == wq->idxd) { in save_iaa_wq()
754 idxd = iaa_device->idxd; in save_iaa_wq()
761 if (iaa_has_wq(iaa_device, wq)) { in save_iaa_wq()
763 iaa_device); in save_iaa_wq()
767 found = iaa_device; in save_iaa_wq()
769 ret = add_iaa_wq(iaa_device, wq, NULL); in save_iaa_wq()
778 struct iaa_device *new_device; in save_iaa_wq()
815 struct iaa_device *iaa_device; in remove_iaa_wq() local
817 list_for_each_entry(iaa_device, &iaa_devices, list) { in remove_iaa_wq()
818 if (iaa_has_wq(iaa_device, wq)) { in remove_iaa_wq()
819 del_iaa_wq(iaa_device, wq); in remove_iaa_wq()
834 struct iaa_device *iaa_device, *found_device = NULL; in wq_table_add_wqs() local
841 list_for_each_entry(iaa_device, &iaa_devices, list) { in wq_table_add_wqs()
842 idxd = iaa_device->idxd; in wq_table_add_wqs()
851 found_device = iaa_device; in wq_table_add_wqs()
859 struct iaa_device, list); in wq_table_add_wqs()
1029 struct iaa_device *iaa_device; in iaa_desc_complete() local
1039 iaa_device = iaa_wq->iaa_device; in iaa_desc_complete()
1040 idxd = iaa_device->idxd; in iaa_desc_complete()
1044 active_compression_mode = get_iaa_device_compression_mode(iaa_device, in iaa_desc_complete()
1134 struct iaa_device *iaa_device; in iaa_compress() local
1144 iaa_device = iaa_wq->iaa_device; in iaa_compress()
1145 idxd = iaa_device->idxd; in iaa_compress()
1149 active_compression_mode = get_iaa_device_compression_mode(iaa_device, ctx->mode); in iaa_compress()
1251 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_remap_for_verify()
1264 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_remap_for_verify()
1286 struct iaa_device *iaa_device; in iaa_compress_verify() local
1296 iaa_device = iaa_wq->iaa_device; in iaa_compress_verify()
1297 idxd = iaa_device->idxd; in iaa_compress_verify()
1301 active_compression_mode = get_iaa_device_compression_mode(iaa_device, ctx->mode); in iaa_compress_verify()
1373 struct iaa_device *iaa_device; in iaa_decompress() local
1383 iaa_device = iaa_wq->iaa_device; in iaa_decompress()
1384 idxd = iaa_device->idxd; in iaa_decompress()
1388 active_compression_mode = get_iaa_device_compression_mode(iaa_device, ctx->mode); in iaa_decompress()
1549 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_comp_acompress()
1562 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_comp_acompress()
1643 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_comp_adecompress_alloc_dest()
1666 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_comp_adecompress_alloc_dest()
1744 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_comp_adecompress()
1757 " wq %d: ret=%d\n", iaa_wq->iaa_device->idxd->id, in iaa_comp_adecompress()