| 289 | } |
| 290 | |
| 291 | static int |
| 292 | check_dev_cap(const struct rte_bbdev_info *dev_info) |
| 293 | { |
| 294 | unsigned int i; |
| 295 | unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, |
| 296 | nb_harq_inputs, nb_harq_outputs; |
| 297 | const struct rte_bbdev_op_cap *op_cap = dev_info->drv.capabilities; |
| 298 | uint8_t dev_data_endianness = dev_info->drv.data_endianness; |
| 299 | |
| 300 | nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; |
| 301 | nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; |
| 302 | nb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments; |
| 303 | nb_harq_inputs = test_vector.entries[DATA_HARQ_INPUT].nb_segments; |
| 304 | nb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments; |
| 305 | |
| 306 | for (i = 0; op_cap->type != RTE_BBDEV_OP_NONE; ++i, ++op_cap) { |
| 307 | if (op_cap->type != test_vector.op_type) |
| 308 | continue; |
| 309 | |
| 310 | if (dev_data_endianness == RTE_BIG_ENDIAN) |
| 311 | convert_op_data_to_be(); |
| 312 | |
| 313 | if (op_cap->type == RTE_BBDEV_OP_TURBO_DEC) { |
| 314 | const struct rte_bbdev_op_cap_turbo_dec *cap = |
| 315 | &op_cap->cap.turbo_dec; |
| 316 | /* Ignore lack of soft output capability, just skip |
| 317 | * checking if soft output is valid. |
| 318 | */ |
| 319 | if ((test_vector.turbo_dec.op_flags & |
| 320 | RTE_BBDEV_TURBO_SOFT_OUTPUT) && |
| 321 | !(cap->capability_flags & |
| 322 | RTE_BBDEV_TURBO_SOFT_OUTPUT)) { |
| 323 | printf( |
| 324 | "INFO: Device \"%s\" does not support soft output - soft output flags will be ignored.\n", |
| 325 | dev_info->dev_name); |
| 326 | clear_soft_out_cap( |
| 327 | &test_vector.turbo_dec.op_flags); |
| 328 | } |
| 329 | |
| 330 | if (!flags_match(test_vector.turbo_dec.op_flags, |
| 331 | cap->capability_flags)) |
| 332 | return TEST_FAILED; |
| 333 | if (nb_inputs > cap->num_buffers_src) { |
| 334 | printf("Too many inputs defined: %u, max: %u\n", |
| 335 | nb_inputs, cap->num_buffers_src); |
| 336 | return TEST_FAILED; |
| 337 | } |
| 338 | if (nb_soft_outputs > cap->num_buffers_soft_out && |
| 339 | (test_vector.turbo_dec.op_flags & |
| 340 | RTE_BBDEV_TURBO_SOFT_OUTPUT)) { |
| 341 | printf( |
| 342 | "Too many soft outputs defined: %u, max: %u\n", |
| 343 | nb_soft_outputs, |
| 344 | cap->num_buffers_soft_out); |
| 345 | return TEST_FAILED; |
| 346 | } |
| 347 | if (nb_hard_outputs > cap->num_buffers_hard_out) { |
| 348 | printf( |
no test coverage detected