RTE_LCORE_FOREACH(id2) {
if (id1 == id2)
continue;
- c1 = lcore_config[id1].core_id;
- c2 = lcore_config[id2].core_id;
- s1 = lcore_config[id1].socket_id;
- s2 = lcore_config[id2].socket_id;
+
+ c1 = rte_lcore_to_cpu_id(id1);
+ c2 = rte_lcore_to_cpu_id(id2);
+ s1 = rte_lcore_to_socket_id(id1);
+ s2 = rte_lcore_to_socket_id(id2);
if ((c1 == c2) && (s1 == s2)){
lcp->c1 = id1;
lcp->c2 = id2;
RTE_LCORE_FOREACH(id2) {
if (id1 == id2)
continue;
- c1 = lcore_config[id1].core_id;
- c2 = lcore_config[id2].core_id;
- s1 = lcore_config[id1].socket_id;
- s2 = lcore_config[id2].socket_id;
+
+ c1 = rte_lcore_to_cpu_id(id1);
+ c2 = rte_lcore_to_cpu_id(id2);
+ s1 = rte_lcore_to_socket_id(id1);
+ s2 = rte_lcore_to_socket_id(id2);
if ((c1 != c2) && (s1 == s2)){
lcp->c1 = id1;
lcp->c2 = id2;
RTE_LCORE_FOREACH(id2) {
if (id1 == id2)
continue;
- s1 = lcore_config[id1].socket_id;
- s2 = lcore_config[id2].socket_id;
+ s1 = rte_lcore_to_socket_id(id1);
+ s2 = rte_lcore_to_socket_id(id2);
if (s1 != s2){
lcp->c1 = id1;
lcp->c2 = id2;
unsigned i;
void *burst[MAX_BURST] = {0};
- if ( __sync_add_and_fetch(&lcore_count, 1) != 2 )
+#ifdef RTE_USE_C11_MEM_MODEL
+ if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) != 2)
+#else
+ if (__sync_add_and_fetch(&lcore_count, 1) != 2)
+#endif
while(lcore_count != 2)
rte_pause();
unsigned i;
void *burst[MAX_BURST] = {0};
- if ( __sync_add_and_fetch(&lcore_count, 1) != 2 )
+#ifdef RTE_USE_C11_MEM_MODEL
+ if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) != 2)
+#else
+ if (__sync_add_and_fetch(&lcore_count, 1) != 2)
+#endif
while(lcore_count != 2)
rte_pause();