- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
/* create the same ring simultaneously on all threads */
for (i = 0; i < MAX_ITER_TIMES; i++) {
rp = rte_ring_create("fr_test_once", 4096, SOCKET_ID_ANY, 0);
/* create the same ring simultaneously on all threads */
for (i = 0; i < MAX_ITER_TIMES; i++) {
rp = rte_ring_create("fr_test_once", 4096, SOCKET_ID_ANY, 0);
- rte_snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
rp = rte_ring_create(ring_name, 4096, SOCKET_ID_ANY, 0);
if (NULL == rp)
return -1;
rp = rte_ring_create(ring_name, 4096, SOCKET_ID_ANY, 0);
if (NULL == rp)
return -1;
- rte_snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_id, i);
+ snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_id, i);
/* create the same hash simultaneously on all threads */
hash_params.name = "fr_test_once";
for (i = 0; i < MAX_ITER_TIMES; i++) {
/* create the same hash simultaneously on all threads */
hash_params.name = "fr_test_once";
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_id, i);
+ snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_id, i);
/* create the same fbk hash table simultaneously on all threads */
fbk_params.name = "fr_test_once";
for (i = 0; i < MAX_ITER_TIMES; i++) {
/* create the same fbk hash table simultaneously on all threads */
fbk_params.name = "fr_test_once";
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
- rte_snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_id, i);
+ snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_id, i);
- lpm = rte_lpm_create("fr_test_once", SOCKET_ID_ANY, 4, RTE_LPM_HEAP);
+ lpm = rte_lpm_create("fr_test_once", SOCKET_ID_ANY, &config);
if ((NULL == lpm) && (rte_lpm_find_existing("fr_test_once") == NULL))
return -1;
}
/* create mutiple fbk tables simultaneously */
for (i = 0; i < MAX_LPM_ITER_TIMES; i++) {
if ((NULL == lpm) && (rte_lpm_find_existing("fr_test_once") == NULL))
return -1;
}
/* create mutiple fbk tables simultaneously */
for (i = 0; i < MAX_LPM_ITER_TIMES; i++) {
- rte_snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
- lpm = rte_lpm_create(lpm_name, SOCKET_ID_ANY, 4, RTE_LPM_HEAP);
+ snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
+ lpm = rte_lpm_create(lpm_name, SOCKET_ID_ANY, &config);
- rte_snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
{ test_eal_init_once, NULL, NULL, "eal init once" },
{ ring_create_lookup, NULL, NULL, "ring create/lookup" },
{ mempool_create_lookup, NULL, NULL, "mempool create/lookup" },
{ test_eal_init_once, NULL, NULL, "eal init once" },
{ ring_create_lookup, NULL, NULL, "ring create/lookup" },
{ mempool_create_lookup, NULL, NULL, "mempool create/lookup" },
{ hash_create_free, NULL, hash_clean, "hash create/free" },
{ fbk_create_free, NULL, fbk_clean, "fbk create/free" },
{ hash_create_free, NULL, hash_clean, "hash create/free" },
{ fbk_create_free, NULL, fbk_clean, "fbk create/free" },
{ lpm_create_free, NULL, lpm_clean, "lpm create/free" },
{ lpm_create_free, NULL, lpm_clean, "lpm create/free" },
if (launch_test(pt_case) < 0) {
printf("Func-ReEnt CASE %"PRIu32": %s FAIL\n", case_id, pt_case->name);
return -1;
if (launch_test(pt_case) < 0) {
printf("Func-ReEnt CASE %"PRIu32": %s FAIL\n", case_id, pt_case->name);
return -1;
+
+static struct test_command func_reentrancy_cmd = {
+ .command = "func_reentrancy_autotest",
+ .callback = test_func_reentrancy,
+};
+REGISTER_TEST_COMMAND(func_reentrancy_cmd);