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

Function enable_bbdev

dpdk/examples/bbdev_app/main.c:993–1033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991}
992
993static void
994enable_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
1035int
1036main(int argc, char **argv)

Callers 1

mainFunction · 0.85

Calls 4

rte_bbdev_info_getFunction · 0.85
rte_exitFunction · 0.85
prepare_bbdev_deviceFunction · 0.85

Tested by

no test coverage detected