| 991 | } |
| 992 | |
| 993 | static void |
| 994 | enable_bbdev(struct app_config_params *app_params) |
| 995 | { |
| 996 | struct rte_bbdev_info dev_info; |
| 997 | const struct rte_bbdev_op_cap *op_cap; |
| 998 | uint16_t bbdev_id = app_params->bbdev_id; |
| 999 | bool encoder_capable = false; |
| 1000 | bool decoder_capable = false; |
| 1001 | |
| 1002 | rte_bbdev_info_get(bbdev_id, &dev_info); |
| 1003 | op_cap = dev_info.drv.capabilities; |
| 1004 | |
| 1005 | while (op_cap->type != RTE_BBDEV_OP_NONE) { |
| 1006 | if (op_cap->type == RTE_BBDEV_OP_TURBO_ENC) { |
| 1007 | if (check_matching_capabilities( |
| 1008 | op_cap->cap.turbo_enc.capability_flags, |
| 1009 | def_op_enc.op_flags)) |
| 1010 | encoder_capable = true; |
| 1011 | } |
| 1012 | |
| 1013 | if (op_cap->type == RTE_BBDEV_OP_TURBO_DEC) { |
| 1014 | if (check_matching_capabilities( |
| 1015 | op_cap->cap.turbo_dec.capability_flags, |
| 1016 | def_op_dec.op_flags)) |
| 1017 | decoder_capable = true; |
| 1018 | } |
| 1019 | |
| 1020 | op_cap++; |
| 1021 | } |
| 1022 | |
| 1023 | if (encoder_capable == false) |
| 1024 | rte_exit(EXIT_FAILURE, |
| 1025 | "The specified BBDev %u doesn't have required encoder capabilities!\n", |
| 1026 | bbdev_id); |
| 1027 | if (decoder_capable == false) |
| 1028 | rte_exit(EXIT_FAILURE, |
| 1029 | "The specified BBDev %u doesn't have required decoder capabilities!\n", |
| 1030 | bbdev_id); |
| 1031 | |
| 1032 | prepare_bbdev_device(bbdev_id, &dev_info, app_params); |
| 1033 | } |
| 1034 | |
| 1035 | int |
| 1036 | main(int argc, char **argv) |
no test coverage detected