| 663 | }; |
| 664 | |
| 665 | int |
| 666 | qat_comp_dev_create(struct qat_pci_device *qat_pci_dev, |
| 667 | struct qat_dev_cmd_param *qat_dev_cmd_param) |
| 668 | { |
| 669 | int i = 0; |
| 670 | struct qat_device_info *qat_dev_instance = |
| 671 | &qat_pci_devs[qat_pci_dev->qat_dev_id]; |
| 672 | struct rte_compressdev_pmd_init_params init_params = { |
| 673 | .name = "", |
| 674 | .socket_id = qat_dev_instance->pci_dev->device.numa_node, |
| 675 | }; |
| 676 | char name[RTE_COMPRESSDEV_NAME_MAX_LEN]; |
| 677 | char capa_memz_name[RTE_COMPRESSDEV_NAME_MAX_LEN]; |
| 678 | struct rte_compressdev *compressdev; |
| 679 | struct qat_comp_dev_private *comp_dev; |
| 680 | struct qat_comp_capabilities_info capabilities_info; |
| 681 | const struct rte_compressdev_capabilities *capabilities; |
| 682 | const struct qat_comp_gen_dev_ops *qat_comp_gen_ops = |
| 683 | &qat_comp_gen_dev_ops[qat_pci_dev->qat_dev_gen]; |
| 684 | uint64_t capa_size; |
| 685 | |
| 686 | snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, "%s_%s", |
| 687 | qat_pci_dev->name, "comp"); |
| 688 | QAT_LOG(DEBUG, "Creating QAT COMP device %s", name); |
| 689 | |
| 690 | if (qat_comp_gen_ops->compressdev_ops == NULL) { |
| 691 | QAT_LOG(DEBUG, "Device %s does not support compression", name); |
| 692 | return -ENOTSUP; |
| 693 | } |
| 694 | |
| 695 | /* Populate subset device to use in compressdev device creation */ |
| 696 | qat_dev_instance->comp_rte_dev.driver = &compdev_qat_driver; |
| 697 | qat_dev_instance->comp_rte_dev.numa_node = |
| 698 | qat_dev_instance->pci_dev->device.numa_node; |
| 699 | qat_dev_instance->comp_rte_dev.devargs = NULL; |
| 700 | |
| 701 | compressdev = rte_compressdev_pmd_create(name, |
| 702 | &(qat_dev_instance->comp_rte_dev), |
| 703 | sizeof(struct qat_comp_dev_private), |
| 704 | &init_params); |
| 705 | |
| 706 | if (compressdev == NULL) |
| 707 | return -ENODEV; |
| 708 | |
| 709 | compressdev->dev_ops = qat_comp_gen_ops->compressdev_ops; |
| 710 | |
| 711 | compressdev->enqueue_burst = (compressdev_enqueue_pkt_burst_t) |
| 712 | qat_enqueue_comp_op_burst; |
| 713 | compressdev->dequeue_burst = qat_comp_pmd_dequeue_first_op_burst; |
| 714 | compressdev->feature_flags = |
| 715 | qat_comp_gen_ops->qat_comp_get_feature_flags(); |
| 716 | |
| 717 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 718 | return 0; |
| 719 | |
| 720 | snprintf(capa_memz_name, RTE_COMPRESSDEV_NAME_MAX_LEN, |
| 721 | "QAT_COMP_CAPA_GEN_%d", |
| 722 | qat_pci_dev->qat_dev_gen); |
nothing calls this directly
no test coverage detected