| 931 | } |
| 932 | |
| 933 | static int |
| 934 | prepare_bbdev_device(unsigned int dev_id, struct rte_bbdev_info *info, |
| 935 | struct app_config_params *app_params) |
| 936 | { |
| 937 | int ret; |
| 938 | unsigned int q_id, dec_q_id, enc_q_id; |
| 939 | struct rte_bbdev_queue_conf qconf = {0}; |
| 940 | uint16_t dec_qs_nb = app_params->num_dec_cores; |
| 941 | uint16_t enc_qs_nb = app_params->num_enc_cores; |
| 942 | uint16_t tot_qs = dec_qs_nb + enc_qs_nb; |
| 943 | |
| 944 | ret = rte_bbdev_setup_queues(dev_id, tot_qs, info->socket_id); |
| 945 | if (ret < 0) |
| 946 | rte_exit(EXIT_FAILURE, |
| 947 | "ERROR(%d): BBDEV %u not configured properly\n", |
| 948 | ret, dev_id); |
| 949 | |
| 950 | /* setup device DEC queues */ |
| 951 | qconf.socket = info->socket_id; |
| 952 | qconf.queue_size = info->drv.queue_size_lim; |
| 953 | qconf.op_type = RTE_BBDEV_OP_TURBO_DEC; |
| 954 | |
| 955 | for (q_id = 0, dec_q_id = 0; q_id < dec_qs_nb; q_id++) { |
| 956 | ret = rte_bbdev_queue_configure(dev_id, q_id, &qconf); |
| 957 | if (ret < 0) |
| 958 | rte_exit(EXIT_FAILURE, |
| 959 | "ERROR(%d): BBDEV %u DEC queue %u not configured properly\n", |
| 960 | ret, dev_id, q_id); |
| 961 | app_params->dec_queue_ids[dec_q_id++] = q_id; |
| 962 | } |
| 963 | |
| 964 | /* setup device ENC queues */ |
| 965 | qconf.op_type = RTE_BBDEV_OP_TURBO_ENC; |
| 966 | |
| 967 | for (q_id = dec_qs_nb, enc_q_id = 0; q_id < tot_qs; q_id++) { |
| 968 | ret = rte_bbdev_queue_configure(dev_id, q_id, &qconf); |
| 969 | if (ret < 0) |
| 970 | rte_exit(EXIT_FAILURE, |
| 971 | "ERROR(%d): BBDEV %u ENC queue %u not configured properly\n", |
| 972 | ret, dev_id, q_id); |
| 973 | app_params->enc_queue_ids[enc_q_id++] = q_id; |
| 974 | } |
| 975 | |
| 976 | ret = rte_bbdev_start(dev_id); |
| 977 | |
| 978 | if (ret != 0) |
| 979 | rte_exit(EXIT_FAILURE, "ERROR(%d): BBDEV %u not started\n", |
| 980 | ret, dev_id); |
| 981 | |
| 982 | printf("BBdev %u started\n", dev_id); |
| 983 | |
| 984 | return 0; |
| 985 | } |
| 986 | |
| 987 | static inline bool |
| 988 | check_matching_capabilities(uint64_t mask, uint64_t required_mask) |
no test coverage detected