MCPcopy Create free account
hub / github.com/F-Stack/f-stack / parse_data_entry

Function parse_data_entry

dpdk/app/test-bbdev/test_bbdev_vector.c:452–500  ·  view source on GitHub ↗

parse ops data entry (there can be more than 1 input entry, each will be * contained in a separate op_data_buf struct) */

Source from the content-addressed store, hash-verified

450 * contained in a separate op_data_buf struct)
451 */
452static int
453parse_data_entry(const char *key_token, char *token,
454 struct test_bbdev_vector *vector, enum op_data_type type,
455 const char *prefix)
456{
457 int ret;
458 uint32_t data_length = 0;
459 uint32_t *data = NULL;
460 unsigned int id;
461 struct op_data_buf *op_data;
462 unsigned int *nb_ops;
463
464 if (type >= DATA_NUM_TYPES) {
465 printf("Unknown op type: %d!\n", type);
466 return -1;
467 }
468
469 op_data = vector->entries[type].segments;
470 nb_ops = &vector->entries[type].nb_segments;
471
472 if (*nb_ops >= RTE_BBDEV_TURBO_MAX_CODE_BLOCKS) {
473 printf("Too many segments (code blocks defined): %u, max %d!\n",
474 *nb_ops, RTE_BBDEV_TURBO_MAX_CODE_BLOCKS);
475 return -1;
476 }
477
478 if (sscanf(key_token + strlen(prefix), "%u", &id) != 1) {
479 printf("Missing ID of %s\n", prefix);
480 return -1;
481 }
482 if (id != *nb_ops) {
483 printf(
484 "Please order data entries sequentially, i.e. %s0, %s1, ...\n",
485 prefix, prefix);
486 return -1;
487 }
488
489 /* Clear new op data struct */
490 memset(op_data + *nb_ops, 0, sizeof(struct op_data_buf));
491
492 ret = parse_values(token, &data, &data_length);
493 if (!ret) {
494 op_data[*nb_ops].addr = data;
495 op_data[*nb_ops].length = data_length;
496 ++(*nb_ops);
497 }
498
499 return ret;
500}
501
502/* parses turbo decoder parameters and assigns to global variable */
503static int

Callers 6

parse_decoder_paramsFunction · 0.85
parse_encoder_paramsFunction · 0.85
parse_fft_paramsFunction · 0.85
parse_mld_paramsFunction · 0.85

Calls 4

sscanfFunction · 0.85
memsetFunction · 0.85
parse_valuesFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected