| 29 | }; |
| 30 | |
| 31 | const struct rte_compressdev_capabilities * |
| 32 | rte_compressdev_capability_get(uint8_t dev_id, |
| 33 | enum rte_comp_algorithm algo) |
| 34 | { |
| 35 | const struct rte_compressdev_capabilities *capability; |
| 36 | struct rte_compressdev_info dev_info; |
| 37 | int i = 0; |
| 38 | |
| 39 | if (dev_id >= compressdev_globals.nb_devs) { |
| 40 | COMPRESSDEV_LOG(ERR, "Invalid dev_id=%d", dev_id); |
| 41 | return NULL; |
| 42 | } |
| 43 | rte_compressdev_info_get(dev_id, &dev_info); |
| 44 | |
| 45 | while ((capability = &dev_info.capabilities[i++])->algo != |
| 46 | RTE_COMP_ALGO_UNSPECIFIED){ |
| 47 | if (capability->algo == algo) |
| 48 | return capability; |
| 49 | } |
| 50 | |
| 51 | return NULL; |
| 52 | } |
| 53 | |
| 54 | const char * |
| 55 | rte_compressdev_get_feature_name(uint64_t flag) |