RTE_LCORE_FOREACH(id[1]) {
if (id[0] == id[1])
continue;
- core[0] = lcore_config[id[0]].core_id;
- core[1] = lcore_config[id[1]].core_id;
- socket[0] = lcore_config[id[0]].socket_id;
- socket[1] = lcore_config[id[1]].socket_id;
+ core[0] = rte_lcore_to_cpu_id(id[0]);
+ core[1] = rte_lcore_to_cpu_id(id[1]);
+ socket[0] = rte_lcore_to_socket_id(id[0]);
+ socket[1] = rte_lcore_to_socket_id(id[1]);
if ((core[0] == core[1]) && (socket[0] == socket[1])) {
lcp->c1 = id[0];
lcp->c2 = id[1];
RTE_LCORE_FOREACH(id[1]) {
if (id[0] == id[1])
continue;
- core[0] = lcore_config[id[0]].core_id;
- core[1] = lcore_config[id[1]].core_id;
- socket[0] = lcore_config[id[0]].socket_id;
- socket[1] = lcore_config[id[1]].socket_id;
+ core[0] = rte_lcore_to_cpu_id(id[0]);
+ core[1] = rte_lcore_to_cpu_id(id[1]);
+ socket[0] = rte_lcore_to_socket_id(id[0]);
+ socket[1] = rte_lcore_to_socket_id(id[1]);
if ((core[0] != core[1]) && (socket[0] == socket[1])) {
lcp->c1 = id[0];
lcp->c2 = id[1];
RTE_LCORE_FOREACH(id[1]) {
if (id[0] == id[1])
continue;
- socket[0] = lcore_config[id[0]].socket_id;
- socket[1] = lcore_config[id[1]].socket_id;
+ socket[0] = rte_lcore_to_socket_id(id[0]);
+ socket[1] = rte_lcore_to_socket_id(id[1]);
if (socket[0] != socket[1]) {
lcp->c1 = id[0];
lcp->c2 = id[1];
}
static int
-test_stack_perf(void)
+__test_stack_perf(uint32_t flags)
{
struct lcore_pair cores;
struct rte_stack *s;
rte_atomic32_init(&lcore_barrier);
- s = rte_stack_create(STACK_NAME, STACK_SIZE, rte_socket_id(), 0);
+ s = rte_stack_create(STACK_NAME, STACK_SIZE, rte_socket_id(), flags);
if (s == NULL) {
printf("[%s():%u] failed to create a stack\n",
__func__, __LINE__);
return 0;
}
+static int
+test_stack_perf(void)
+{
+ return __test_stack_perf(0);
+}
+
+static int
+test_lf_stack_perf(void)
+{
+ return __test_stack_perf(RTE_STACK_F_LF);
+}
+
REGISTER_TEST_COMMAND(stack_perf_autotest, test_stack_perf);
+REGISTER_TEST_COMMAND(stack_lf_perf_autotest, test_lf_stack_perf);