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

Function scheduler_testsuite_setup

dpdk/app/test/test_cryptodev.c:16014–16065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16012uint8_t aesni_ids[2];
16013
16014static int
16015scheduler_testsuite_setup(void)
16016{
16017 uint32_t i = 0;
16018 int32_t nb_devs, ret;
16019 char vdev_args[VDEV_ARGS_SIZE] = {""};
16020 char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
16021 "ordering=enable,name=cryptodev_test_scheduler,corelist="};
16022 uint16_t worker_core_count = 0;
16023 uint16_t socket_id = 0;
16024
16025 if (gbl_driver_id == rte_cryptodev_driver_id_get(
16026 RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
16027
16028 /* Identify the Worker Cores
16029 * Use 2 worker cores for the device args
16030 */
16031 RTE_LCORE_FOREACH_WORKER(i) {
16032 if (worker_core_count > 1)
16033 break;
16034 snprintf(vdev_args, sizeof(vdev_args),
16035 "%s%d", temp_str, i);
16036 strcpy(temp_str, vdev_args);
16037 strlcat(temp_str, ";", sizeof(temp_str));
16038 worker_core_count++;
16039 socket_id = rte_lcore_to_socket_id(i);
16040 }
16041 if (worker_core_count != 2) {
16042 RTE_LOG(ERR, USER1,
16043 "Cryptodev scheduler test require at least "
16044 "two worker cores to run. "
16045 "Please use the correct coremask.\n");
16046 return TEST_FAILED;
16047 }
16048 strcpy(temp_str, vdev_args);
16049 snprintf(vdev_args, sizeof(vdev_args), "%s,socket_id=%d",
16050 temp_str, socket_id);
16051 RTE_LOG(DEBUG, USER1, "vdev_args: %s\n", vdev_args);
16052 nb_devs = rte_cryptodev_device_count_by_driver(
16053 rte_cryptodev_driver_id_get(
16054 RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD)));
16055 if (nb_devs < 1) {
16056 ret = rte_vdev_init(
16057 RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD),
16058 vdev_args);
16059 TEST_ASSERT(ret == 0,
16060 "Failed to create instance %u of pmd : %s",
16061 i, RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
16062 }
16063 }
16064 return testsuite_setup();
16065}
16066
16067static int
16068test_scheduler_attach_worker_op(void)

Callers

nothing calls this directly

Calls 7

snprintfFunction · 0.85
rte_lcore_to_socket_idFunction · 0.85
rte_vdev_initFunction · 0.85
testsuite_setupFunction · 0.70
strlcatFunction · 0.50

Tested by

no test coverage detected