* [PATCH v1 0/5] prefix lcore role enum values
@ 2026-06-17 10:28 Huisong Li
2026-06-17 10:28 ` [PATCH v1 1/5] eal: " Huisong Li
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Huisong Li @ 2026-06-17 10:28 UTC (permalink / raw)
To: thomas; +Cc: mb, andrew.rybchenko, dev, zhanjie9, lihuisong
Add the RTE_LCORE_ prefix to the lcore role enum values in rte_lcore_role_t
to follow DPDK naming conventions.
- ROLE_RTE -> RTE_LCORE_ROLE_RTE
- ROLE_OFF -> RTE_LCORE_ROLE_OFF
- ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
- ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
Old names are kept as macros aliasing to the new names to preserve
backward compatibility.
Huisong Li (5):
eal: prefix lcore role enum values
eal: use new lcore role enum names
graph: use new lcore role enum names
net/softnic: use new lcore role enum names
test: use new lcore role enum names
app/test/test_lcores.c | 2 +-
app/test/test_mempool.c | 2 +-
drivers/net/softnic/rte_eth_softnic_thread.c | 4 +--
lib/eal/common/eal_common_lcore.c | 34 ++++++++++----------
lib/eal/common/eal_common_options.c | 28 ++++++++--------
lib/eal/common/eal_private.h | 4 +--
lib/eal/common/rte_service.c | 12 +++----
lib/eal/include/rte_lcore.h | 17 +++++++---
lib/graph/graph.c | 2 +-
9 files changed, 56 insertions(+), 49 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v1 1/5] eal: prefix lcore role enum values
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
@ 2026-06-17 10:28 ` Huisong Li
2026-06-17 10:28 ` [PATCH v1 2/5] eal: use new lcore role enum names Huisong Li
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Huisong Li @ 2026-06-17 10:28 UTC (permalink / raw)
To: thomas; +Cc: mb, andrew.rybchenko, dev, zhanjie9, lihuisong
Add the RTE_LCORE_ prefix to the lcore role enum values in
rte_lcore_role_t to follow DPDK naming conventions.
- ROLE_RTE -> RTE_LCORE_ROLE_RTE
- ROLE_OFF -> RTE_LCORE_ROLE_OFF
- ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
- ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
Old names are kept as macros aliasing to the new names to preserve
backward compatibility.
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
lib/eal/include/rte_lcore.h | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h
index 10f965b4f0..2fc4d0b15b 100644
--- a/lib/eal/include/rte_lcore.h
+++ b/lib/eal/include/rte_lcore.h
@@ -31,12 +31,18 @@ RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
* The lcore role (used in RTE or not).
*/
enum rte_lcore_role_t {
- ROLE_RTE,
- ROLE_OFF,
- ROLE_SERVICE,
- ROLE_NON_EAL,
+ RTE_LCORE_ROLE_RTE,
+ RTE_LCORE_ROLE_OFF,
+ RTE_LCORE_ROLE_SERVICE,
+ RTE_LCORE_ROLE_NON_EAL,
};
+/* Old lcore role aliases for backward compatibility. */
+#define ROLE_RTE RTE_LCORE_ROLE_RTE
+#define ROLE_OFF RTE_LCORE_ROLE_OFF
+#define ROLE_SERVICE RTE_LCORE_ROLE_SERVICE
+#define ROLE_NON_EAL RTE_LCORE_ROLE_NON_EAL
+
/**
* Get a lcore's role.
*
@@ -308,7 +314,8 @@ rte_lcore_callback_unregister(void *handle);
typedef int (*rte_lcore_iterate_cb)(unsigned int lcore_id, void *arg);
/**
- * Iterate on all active lcores (ROLE_RTE, ROLE_SERVICE and ROLE_NON_EAL).
+ * Iterate on all active lcores (RTE_LCORE_ROLE_RTE, RTE_LCORE_ROLE_SERVICE
+ * and RTE_LCORE_ROLE_NON_EAL).
* No modification on the lcore states is allowed in the callback.
*
* Note: as opposed to init/uninit callbacks, iteration callbacks can be
--
2.33.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v1 2/5] eal: use new lcore role enum names
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
2026-06-17 10:28 ` [PATCH v1 1/5] eal: " Huisong Li
@ 2026-06-17 10:28 ` Huisong Li
2026-06-17 10:28 ` [PATCH v1 3/5] graph: " Huisong Li
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Huisong Li @ 2026-06-17 10:28 UTC (permalink / raw)
To: thomas; +Cc: mb, andrew.rybchenko, dev, zhanjie9, lihuisong
Replace old lcore role enum names with new RTE_LCORE_ prefixed names
in EAL common code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
lib/eal/common/eal_common_lcore.c | 34 ++++++++++++++---------------
lib/eal/common/eal_common_options.c | 28 ++++++++++++------------
lib/eal/common/eal_private.h | 4 ++--
lib/eal/common/rte_service.c | 12 +++++-----
4 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 39411f9370..021687599b 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -76,7 +76,7 @@ rte_eal_lcore_role(unsigned int lcore_id)
struct rte_config *cfg = rte_eal_get_configuration();
if (lcore_id >= RTE_MAX_LCORE)
- return ROLE_OFF;
+ return RTE_LCORE_ROLE_OFF;
return cfg->lcore_role[lcore_id];
}
@@ -99,7 +99,7 @@ int rte_lcore_is_enabled(unsigned int lcore_id)
if (lcore_id >= RTE_MAX_LCORE)
return 0;
- return cfg->lcore_role[lcore_id] == ROLE_RTE;
+ return cfg->lcore_role[lcore_id] == RTE_LCORE_ROLE_RTE;
}
RTE_EXPORT_SYMBOL(rte_get_next_lcore)
@@ -176,7 +176,7 @@ rte_eal_cpu_init(void)
lcore_to_socket_id[lcore_id] = socket_id;
if (eal_cpu_detected(lcore_id) == 0) {
- config->lcore_role[lcore_id] = ROLE_OFF;
+ config->lcore_role[lcore_id] = RTE_LCORE_ROLE_OFF;
lcore_config[lcore_id].core_index = -1;
continue;
}
@@ -185,8 +185,8 @@ rte_eal_cpu_init(void)
CPU_SET(lcore_id, &lcore_config[lcore_id].cpuset);
/* By default, each detected core is enabled */
- config->lcore_role[lcore_id] = ROLE_RTE;
- lcore_config[lcore_id].core_role = ROLE_RTE;
+ config->lcore_role[lcore_id] = RTE_LCORE_ROLE_RTE;
+ lcore_config[lcore_id].core_role = RTE_LCORE_ROLE_RTE;
lcore_config[lcore_id].core_id = eal_cpu_core_id(lcore_id);
lcore_config[lcore_id].numa_id = socket_id;
EAL_LOG(DEBUG, "Detected lcore %u as "
@@ -314,7 +314,7 @@ rte_lcore_callback_register(const char *name, rte_lcore_init_cb init,
if (callback->init == NULL)
goto no_init;
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
- if (cfg->lcore_role[lcore_id] == ROLE_OFF)
+ if (cfg->lcore_role[lcore_id] == RTE_LCORE_ROLE_OFF)
continue;
if (callback_init(callback, lcore_id) == 0)
continue;
@@ -322,7 +322,7 @@ rte_lcore_callback_register(const char *name, rte_lcore_init_cb init,
* previous lcore.
*/
while (lcore_id-- != 0) {
- if (cfg->lcore_role[lcore_id] == ROLE_OFF)
+ if (cfg->lcore_role[lcore_id] == RTE_LCORE_ROLE_OFF)
continue;
callback_uninit(callback, lcore_id);
}
@@ -354,7 +354,7 @@ rte_lcore_callback_unregister(void *handle)
if (callback->uninit == NULL)
goto no_uninit;
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
- if (cfg->lcore_role[lcore_id] == ROLE_OFF)
+ if (cfg->lcore_role[lcore_id] == RTE_LCORE_ROLE_OFF)
continue;
callback_uninit(callback, lcore_id);
}
@@ -376,9 +376,9 @@ eal_lcore_non_eal_allocate(void)
rte_rwlock_write_lock(&lcore_lock);
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
- if (cfg->lcore_role[lcore_id] != ROLE_OFF)
+ if (cfg->lcore_role[lcore_id] != RTE_LCORE_ROLE_OFF)
continue;
- cfg->lcore_role[lcore_id] = ROLE_NON_EAL;
+ cfg->lcore_role[lcore_id] = RTE_LCORE_ROLE_NON_EAL;
cfg->lcore_count++;
break;
}
@@ -399,7 +399,7 @@ eal_lcore_non_eal_allocate(void)
}
EAL_LOG(DEBUG, "Initialization refused for lcore %u.",
lcore_id);
- cfg->lcore_role[lcore_id] = ROLE_OFF;
+ cfg->lcore_role[lcore_id] = RTE_LCORE_ROLE_OFF;
cfg->lcore_count--;
lcore_id = RTE_MAX_LCORE;
goto out;
@@ -416,11 +416,11 @@ eal_lcore_non_eal_release(unsigned int lcore_id)
struct lcore_callback *callback;
rte_rwlock_write_lock(&lcore_lock);
- if (cfg->lcore_role[lcore_id] != ROLE_NON_EAL)
+ if (cfg->lcore_role[lcore_id] != RTE_LCORE_ROLE_NON_EAL)
goto out;
TAILQ_FOREACH(callback, &lcore_callbacks, next)
callback_uninit(callback, lcore_id);
- cfg->lcore_role[lcore_id] = ROLE_OFF;
+ cfg->lcore_role[lcore_id] = RTE_LCORE_ROLE_OFF;
cfg->lcore_count--;
out:
rte_rwlock_write_unlock(&lcore_lock);
@@ -436,7 +436,7 @@ rte_lcore_iterate(rte_lcore_iterate_cb cb, void *arg)
rte_rwlock_read_lock(&lcore_lock);
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
- if (cfg->lcore_role[lcore_id] == ROLE_OFF)
+ if (cfg->lcore_role[lcore_id] == RTE_LCORE_ROLE_OFF)
continue;
ret = cb(lcore_id, arg);
if (ret != 0)
@@ -450,11 +450,11 @@ static const char *
lcore_role_str(enum rte_lcore_role_t role)
{
switch (role) {
- case ROLE_RTE:
+ case RTE_LCORE_ROLE_RTE:
return "RTE";
- case ROLE_SERVICE:
+ case RTE_LCORE_ROLE_SERVICE:
return "SERVICE";
- case ROLE_NON_EAL:
+ case RTE_LCORE_ROLE_NON_EAL:
return "NON_EAL";
default:
return "UNKNOWN";
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 1049838d73..6dd748e37e 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -898,10 +898,10 @@ eal_parse_service_coremask(const char *coremask)
return -1;
}
- if (cfg->lcore_role[idx] == ROLE_RTE)
+ if (cfg->lcore_role[idx] == RTE_LCORE_ROLE_RTE)
taken_lcore_count++;
- lcore_config[idx].core_role = ROLE_SERVICE;
+ lcore_config[idx].core_role = RTE_LCORE_ROLE_SERVICE;
count++;
}
}
@@ -938,7 +938,7 @@ update_lcore_config(const rte_cpuset_t *cpuset, bool remap, uint16_t remap_base)
/* set everything to disabled first, then set up values */
for (i = 0; i < RTE_MAX_LCORE; i++) {
- cfg->lcore_role[i] = ROLE_OFF;
+ cfg->lcore_role[i] = RTE_LCORE_ROLE_OFF;
lcore_config[i].core_index = -1;
}
@@ -966,7 +966,7 @@ update_lcore_config(const rte_cpuset_t *cpuset, bool remap, uint16_t remap_base)
continue;
}
- cfg->lcore_role[lcore_id] = ROLE_RTE;
+ cfg->lcore_role[lcore_id] = RTE_LCORE_ROLE_RTE;
lcore_config[lcore_id].core_index = count;
CPU_ZERO(&lcore_config[lcore_id].cpuset);
CPU_SET(i, &lcore_config[lcore_id].cpuset);
@@ -1138,12 +1138,12 @@ eal_parse_service_corelist(const char *corelist)
if (min == RTE_MAX_LCORE)
min = idx;
for (idx = min; idx <= max; idx++) {
- if (cfg->lcore_role[idx] != ROLE_SERVICE) {
- if (cfg->lcore_role[idx] == ROLE_RTE)
+ if (cfg->lcore_role[idx] != RTE_LCORE_ROLE_SERVICE) {
+ if (cfg->lcore_role[idx] == RTE_LCORE_ROLE_RTE)
taken_lcore_count++;
lcore_config[idx].core_role =
- ROLE_SERVICE;
+ RTE_LCORE_ROLE_SERVICE;
count++;
}
}
@@ -1166,7 +1166,7 @@ eal_parse_service_corelist(const char *corelist)
rte_cpuset_t service_cpuset;
CPU_ZERO(&service_cpuset);
for (i = 0; i < RTE_MAX_LCORE; i++) {
- if (lcore_config[i].core_role == ROLE_SERVICE)
+ if (lcore_config[i].core_role == RTE_LCORE_ROLE_SERVICE)
CPU_SET(i, &service_cpuset);
}
if (CPU_COUNT(&service_cpuset) > 0) {
@@ -1195,12 +1195,12 @@ eal_parse_main_lcore(const char *arg)
return -1;
/* ensure main core is not used as service core */
- if (lcore_config[cfg->main_lcore].core_role == ROLE_SERVICE) {
+ if (lcore_config[cfg->main_lcore].core_role == RTE_LCORE_ROLE_SERVICE) {
EAL_LOG(ERR, "Error: Main lcore is used as a service core");
return -1;
}
/* check that we have the core recorded in the core list */
- if (cfg->lcore_role[cfg->main_lcore] != ROLE_RTE) {
+ if (cfg->lcore_role[cfg->main_lcore] != RTE_LCORE_ROLE_RTE) {
EAL_LOG(ERR, "Error: Main lcore is not enabled for DPDK");
return -1;
}
@@ -1389,7 +1389,7 @@ eal_parse_lcores(const char *lcores)
/* Reset lcore config */
for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
- cfg->lcore_role[idx] = ROLE_OFF;
+ cfg->lcore_role[idx] = RTE_LCORE_ROLE_OFF;
lcore_config[idx].core_index = -1;
CPU_ZERO(&lcore_config[idx].cpuset);
}
@@ -1451,9 +1451,9 @@ eal_parse_lcores(const char *lcores)
continue;
set_count--;
- if (cfg->lcore_role[idx] != ROLE_RTE) {
+ if (cfg->lcore_role[idx] != RTE_LCORE_ROLE_RTE) {
lcore_config[idx].core_index = count;
- cfg->lcore_role[idx] = ROLE_RTE;
+ cfg->lcore_role[idx] = RTE_LCORE_ROLE_RTE;
count++;
}
@@ -2432,7 +2432,7 @@ compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
unsigned int lcore_id;
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
- if (rte_lcore_has_role(lcore_id, ROLE_OFF))
+ if (rte_lcore_has_role(lcore_id, RTE_LCORE_ROLE_OFF))
continue;
RTE_CPU_OR(cpuset, cpuset, &lcore_config[lcore_id].cpuset);
}
diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h
index 0c0544beaf..dff3565099 100644
--- a/lib/eal/common/eal_private.h
+++ b/lib/eal/common/eal_private.h
@@ -430,7 +430,7 @@ uint64_t get_tsc_freq_arch(void);
* Allocate a free lcore to associate to a non-EAL thread.
*
* @return
- * - the id of a lcore with role ROLE_NON_EAL on success.
+ * - the id of a lcore with role RTE_LCORE_ROLE_NON_EAL on success.
* - RTE_MAX_LCORE if none was available or initializing was refused (see
* rte_lcore_callback_register).
*/
@@ -441,7 +441,7 @@ unsigned int eal_lcore_non_eal_allocate(void);
* Counterpart of eal_lcore_non_eal_allocate().
*
* @param lcore_id
- * The lcore with role ROLE_NON_EAL to release.
+ * The lcore with role RTE_LCORE_ROLE_NON_EAL to release.
*/
void eal_lcore_non_eal_release(unsigned int lcore_id);
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index d2ac9d3f14..5c3a350ae8 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -107,7 +107,7 @@ rte_service_init(void)
int i;
struct rte_config *cfg = rte_eal_get_configuration();
for (i = 0; i < RTE_MAX_LCORE; i++) {
- if (lcore_config[i].core_role == ROLE_SERVICE) {
+ if (lcore_config[i].core_role == RTE_LCORE_ROLE_SERVICE) {
if ((unsigned int)i == cfg->main_lcore)
continue;
rte_service_lcore_add(i);
@@ -718,7 +718,7 @@ set_lcore_state(uint32_t lcore, int32_t state)
lcore_config[lcore].core_role = state;
/* update per-lcore optimized state tracking */
- cs->is_service_core = (state == ROLE_SERVICE);
+ cs->is_service_core = (state == RTE_LCORE_ROLE_SERVICE);
rte_eal_trace_service_lcore_state_change(lcore, state);
}
@@ -734,7 +734,7 @@ rte_service_lcore_reset_all(void)
if (cs->is_service_core) {
rte_bitset_clear_all(cs->mapped_services, RTE_SERVICE_NUM_MAX);
- set_lcore_state(i, ROLE_RTE);
+ set_lcore_state(i, RTE_LCORE_ROLE_RTE);
/* runstate act as guard variable Use
* store-release memory order here to synchronize
* with load-acquire in runstate read functions.
@@ -761,7 +761,7 @@ rte_service_lcore_add(uint32_t lcore)
if (cs->is_service_core)
return -EALREADY;
- set_lcore_state(lcore, ROLE_SERVICE);
+ set_lcore_state(lcore, RTE_LCORE_ROLE_SERVICE);
/* ensure that after adding a core the mask and state are defaults */
rte_bitset_clear_all(cs->mapped_services, RTE_SERVICE_NUM_MAX);
@@ -793,7 +793,7 @@ rte_service_lcore_del(uint32_t lcore)
RUNSTATE_STOPPED)
return -EBUSY;
- set_lcore_state(lcore, ROLE_RTE);
+ set_lcore_state(lcore, RTE_LCORE_ROLE_RTE);
rte_smp_wmb();
return 0;
@@ -1126,7 +1126,7 @@ rte_service_dump(FILE *f, uint32_t id)
fprintf(f, "Service Cores Summary\n");
for (i = 0; i < RTE_MAX_LCORE; i++) {
- if (lcore_config[i].core_role != ROLE_SERVICE)
+ if (lcore_config[i].core_role != RTE_LCORE_ROLE_SERVICE)
continue;
service_dump_calls_per_lcore(f, i);
--
2.33.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v1 3/5] graph: use new lcore role enum names
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
2026-06-17 10:28 ` [PATCH v1 1/5] eal: " Huisong Li
2026-06-17 10:28 ` [PATCH v1 2/5] eal: use new lcore role enum names Huisong Li
@ 2026-06-17 10:28 ` Huisong Li
2026-06-17 10:28 ` [PATCH v1 4/5] net/softnic: " Huisong Li
` (2 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Huisong Li @ 2026-06-17 10:28 UTC (permalink / raw)
To: thomas; +Cc: mb, andrew.rybchenko, dev, zhanjie9, lihuisong
Replace old lcore role enum names with new RTE_LCORE_ prefixed names
in graph library.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
lib/graph/graph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/graph/graph.c b/lib/graph/graph.c
index 5f8ada2185..8165a0a932 100644
--- a/lib/graph/graph.c
+++ b/lib/graph/graph.c
@@ -359,7 +359,7 @@ rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore)
goto fail;
}
- if (rte_lcore_has_role(lcore, ROLE_OFF))
+ if (rte_lcore_has_role(lcore, RTE_LCORE_ROLE_OFF))
SET_ERR_JMP(ENOLINK, fail, "lcore %d is invalid", lcore);
STAILQ_FOREACH(graph, &graph_list, next)
--
2.33.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v1 4/5] net/softnic: use new lcore role enum names
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
` (2 preceding siblings ...)
2026-06-17 10:28 ` [PATCH v1 3/5] graph: " Huisong Li
@ 2026-06-17 10:28 ` Huisong Li
2026-06-17 10:28 ` [PATCH v1 5/5] test: " Huisong Li
2026-06-17 11:48 ` [PATCH v1 0/5] prefix lcore role enum values Morten Brørup
5 siblings, 0 replies; 15+ messages in thread
From: Huisong Li @ 2026-06-17 10:28 UTC (permalink / raw)
To: thomas; +Cc: mb, andrew.rybchenko, dev, zhanjie9, lihuisong
Replace old lcore role enum names with new RTE_LCORE_ prefixed names
in softnic driver.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/net/softnic/rte_eth_softnic_thread.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index f72c836199..a6d47c8b33 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -98,9 +98,9 @@ thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)
if (thread_id == rte_get_main_lcore())
return 0; /* FALSE */
- if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE))
+ if (softnic->params.sc && rte_lcore_has_role(thread_id, RTE_LCORE_ROLE_SERVICE))
return 1; /* TRUE */
- if (!softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_RTE))
+ if (!softnic->params.sc && rte_lcore_has_role(thread_id, RTE_LCORE_ROLE_RTE))
return 1; /* TRUE */
return 0; /* FALSE */
--
2.33.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v1 5/5] test: use new lcore role enum names
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
` (3 preceding siblings ...)
2026-06-17 10:28 ` [PATCH v1 4/5] net/softnic: " Huisong Li
@ 2026-06-17 10:28 ` Huisong Li
2026-06-17 11:48 ` [PATCH v1 0/5] prefix lcore role enum values Morten Brørup
5 siblings, 0 replies; 15+ messages in thread
From: Huisong Li @ 2026-06-17 10:28 UTC (permalink / raw)
To: thomas; +Cc: mb, andrew.rybchenko, dev, zhanjie9, lihuisong
Replace old lcore role enum names with new RTE_LCORE_ prefixed names
in test applications.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
app/test/test_lcores.c | 2 +-
app/test/test_mempool.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test/test_lcores.c b/app/test/test_lcores.c
index 13842615d5..60354b3f7f 100644
--- a/app/test/test_lcores.c
+++ b/app/test/test_lcores.c
@@ -396,7 +396,7 @@ test_lcores(void)
unsigned int i;
for (i = 0; i < RTE_MAX_LCORE; i++) {
- if (!rte_lcore_has_role(i, ROLE_OFF))
+ if (!rte_lcore_has_role(i, RTE_LCORE_ROLE_OFF))
eal_threads_count++;
}
if (eal_threads_count == 0) {
diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c
index e54249ce61..38f0b6e712 100644
--- a/app/test/test_mempool.c
+++ b/app/test/test_mempool.c
@@ -353,7 +353,7 @@ test_mempool_sp_sc(void)
ret = -1;
goto err;
}
- if (rte_eal_lcore_role(lcore_next) != ROLE_RTE) {
+ if (rte_eal_lcore_role(lcore_next) != RTE_LCORE_ROLE_RTE) {
ret = -1;
goto err;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* RE: [PATCH v1 0/5] prefix lcore role enum values
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
` (4 preceding siblings ...)
2026-06-17 10:28 ` [PATCH v1 5/5] test: " Huisong Li
@ 2026-06-17 11:48 ` Morten Brørup
2026-06-18 16:19 ` Thomas Monjalon
2026-06-19 2:03 ` Stephen Hemminger
5 siblings, 2 replies; 15+ messages in thread
From: Morten Brørup @ 2026-06-17 11:48 UTC (permalink / raw)
To: Huisong Li, thomas; +Cc: andrew.rybchenko, dev, zhanjie9
> From: Huisong Li [mailto:lihuisong@huawei.com]
> Sent: Wednesday, 17 June 2026 12.28
>
> Add the RTE_LCORE_ prefix to the lcore role enum values in
> rte_lcore_role_t
> to follow DPDK naming conventions.
>
> - ROLE_RTE -> RTE_LCORE_ROLE_RTE
> - ROLE_OFF -> RTE_LCORE_ROLE_OFF
> - ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
> - ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
>
> Old names are kept as macros aliasing to the new names to preserve
> backward compatibility.
>
Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1 0/5] prefix lcore role enum values
2026-06-17 11:48 ` [PATCH v1 0/5] prefix lcore role enum values Morten Brørup
@ 2026-06-18 16:19 ` Thomas Monjalon
2026-06-18 18:52 ` Morten Brørup
2026-06-19 2:03 ` Stephen Hemminger
1 sibling, 1 reply; 15+ messages in thread
From: Thomas Monjalon @ 2026-06-18 16:19 UTC (permalink / raw)
To: Huisong Li
Cc: dev, andrew.rybchenko, zhanjie9, Morten Brørup,
David Marchand
17/06/2026 13:48, Morten Brørup:
> > From: Huisong Li [mailto:lihuisong@huawei.com]
> > Sent: Wednesday, 17 June 2026 12.28
> >
> > Add the RTE_LCORE_ prefix to the lcore role enum values in
> > rte_lcore_role_t
> > to follow DPDK naming conventions.
> >
> > - ROLE_RTE -> RTE_LCORE_ROLE_RTE
> > - ROLE_OFF -> RTE_LCORE_ROLE_OFF
> > - ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
> > - ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
> >
> > Old names are kept as macros aliasing to the new names to preserve
> > backward compatibility.
> >
>
> Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
Squashed and applied, thanks.
I have a doubt about RTE_LCORE_ROLE_RTE: could we find a better name?
Also we should probably add some comments to explain each role.
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v1 0/5] prefix lcore role enum values
2026-06-18 16:19 ` Thomas Monjalon
@ 2026-06-18 18:52 ` Morten Brørup
0 siblings, 0 replies; 15+ messages in thread
From: Morten Brørup @ 2026-06-18 18:52 UTC (permalink / raw)
To: Thomas Monjalon, Huisong Li
Cc: dev, andrew.rybchenko, zhanjie9, David Marchand, Bruce Richardson
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, 18 June 2026 18.20
>
> 17/06/2026 13:48, Morten Brørup:
> > > From: Huisong Li [mailto:lihuisong@huawei.com]
> > > Sent: Wednesday, 17 June 2026 12.28
> > >
> > > Add the RTE_LCORE_ prefix to the lcore role enum values in
> > > rte_lcore_role_t
> > > to follow DPDK naming conventions.
> > >
> > > - ROLE_RTE -> RTE_LCORE_ROLE_RTE
> > > - ROLE_OFF -> RTE_LCORE_ROLE_OFF
> > > - ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
> > > - ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
> > >
> > > Old names are kept as macros aliasing to the new names to preserve
> > > backward compatibility.
> > >
> >
> > Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
>
> Squashed and applied, thanks.
>
> I have a doubt about RTE_LCORE_ROLE_RTE: could we find a better name?
Yes, it made more sense when lcores were either used by DPDK or not.
Note that it's used by both workers and the main lcore.
>
> Also we should probably add some comments to explain each role.
+1
BTW, I thought the Non-EAL role was for registered control plane threads. But then I looked into Grout.
Grout uses the Non-EAL role for its dataplane threads. And the RTE role for its main thread, which is handling the control plane (which I suppose is not unusual).
Lcore roles and CPU core isolation is very flexible in DPDK. Maybe too flexible.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1 0/5] prefix lcore role enum values
2026-06-17 11:48 ` [PATCH v1 0/5] prefix lcore role enum values Morten Brørup
2026-06-18 16:19 ` Thomas Monjalon
@ 2026-06-19 2:03 ` Stephen Hemminger
2026-06-19 7:28 ` Thomas Monjalon
1 sibling, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2026-06-19 2:03 UTC (permalink / raw)
To: Morten Brørup; +Cc: Huisong Li, thomas, andrew.rybchenko, dev, zhanjie9
On Wed, 17 Jun 2026 13:48:37 +0200
Morten Brørup <mb@smartsharesystems.com> wrote:
> > From: Huisong Li [mailto:lihuisong@huawei.com]
> > Sent: Wednesday, 17 June 2026 12.28
> >
> > Add the RTE_LCORE_ prefix to the lcore role enum values in
> > rte_lcore_role_t
> > to follow DPDK naming conventions.
> >
> > - ROLE_RTE -> RTE_LCORE_ROLE_RTE
> > - ROLE_OFF -> RTE_LCORE_ROLE_OFF
> > - ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
> > - ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
> >
> > Old names are kept as macros aliasing to the new names to preserve
> > backward compatibility.
> >
>
> Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
>
The problem with this patch it causes build failures now with abi diff.
Example build log...
2 functions with some indirect sub-type change:
[C] 'function rte_lcore_role_t rte_eal_lcore_role(unsigned int)' at eal_common_lcore.c:74:1 has some indirect sub-type changes:
return type changed:
type size hasn't changed
4 enumerator deletions:
'rte_lcore_role_t::ROLE_RTE' value '0'
'rte_lcore_role_t::ROLE_OFF' value '1'
'rte_lcore_role_t::ROLE_SERVICE' value '2'
'rte_lcore_role_t::ROLE_NON_EAL' value '3'
4 enumerator insertions:
'rte_lcore_role_t::RTE_LCORE_ROLE_RTE' value '0'
'rte_lcore_role_t::RTE_LCORE_ROLE_OFF' value '1'
'rte_lcore_role_t::RTE_LCORE_ROLE_SERVICE' value '2'
'rte_lcore_role_t::RTE_LCORE_ROLE_NON_EAL' value '3'
[C] 'function int rte_lcore_has_role(unsigned int, rte_lcore_role_t)' at eal_common_lcore.c:85:1 has some indirect sub-type changes:
parameter 2 of type 'enum rte_lcore_role_t' has sub-type changes:
enum type 'enum rte_lcore_role_t' changed at rte_lcore.h:33:1, as reported earlier
Error: ABI issue reported for abidiff --suppr /home/runner/work/dpdk/dpdk/devtools/libabigail.abignore --no-added-syms --headers-dir1 reference/usr/local/include --headers-dir2 install/usr/local/include reference/usr/local/lib/librte_eal.so.26.1 install/usr/local/lib/librte_eal.so.26.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1 0/5] prefix lcore role enum values
2026-06-19 2:03 ` Stephen Hemminger
@ 2026-06-19 7:28 ` Thomas Monjalon
2026-06-19 7:54 ` Morten Brørup
0 siblings, 1 reply; 15+ messages in thread
From: Thomas Monjalon @ 2026-06-19 7:28 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Morten Brørup, Huisong Li, andrew.rybchenko, dev, zhanjie9
19/06/2026 04:03, Stephen Hemminger:
> On Wed, 17 Jun 2026 13:48:37 +0200
> Morten Brørup <mb@smartsharesystems.com> wrote:
>
> > > From: Huisong Li [mailto:lihuisong@huawei.com]
> > > Sent: Wednesday, 17 June 2026 12.28
> > >
> > > Add the RTE_LCORE_ prefix to the lcore role enum values in
> > > rte_lcore_role_t
> > > to follow DPDK naming conventions.
> > >
> > > - ROLE_RTE -> RTE_LCORE_ROLE_RTE
> > > - ROLE_OFF -> RTE_LCORE_ROLE_OFF
> > > - ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
> > > - ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
> > >
> > > Old names are kept as macros aliasing to the new names to preserve
> > > backward compatibility.
> > >
> >
> > Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
> >
>
> The problem with this patch it causes build failures now with abi diff.
It is probably a bug of an old version of abidiff.
I recommend updating.
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v1 0/5] prefix lcore role enum values
2026-06-19 7:28 ` Thomas Monjalon
@ 2026-06-19 7:54 ` Morten Brørup
2026-06-19 15:39 ` Stephen Hemminger
0 siblings, 1 reply; 15+ messages in thread
From: Morten Brørup @ 2026-06-19 7:54 UTC (permalink / raw)
To: Thomas Monjalon, Stephen Hemminger
Cc: Huisong Li, andrew.rybchenko, dev, zhanjie9
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Friday, 19 June 2026 09.28
>
> 19/06/2026 04:03, Stephen Hemminger:
> > On Wed, 17 Jun 2026 13:48:37 +0200
> > Morten Brørup <mb@smartsharesystems.com> wrote:
> >
> > > > From: Huisong Li [mailto:lihuisong@huawei.com]
> > > > Sent: Wednesday, 17 June 2026 12.28
> > > >
> > > > Add the RTE_LCORE_ prefix to the lcore role enum values in
> > > > rte_lcore_role_t
> > > > to follow DPDK naming conventions.
> > > >
> > > > - ROLE_RTE -> RTE_LCORE_ROLE_RTE
> > > > - ROLE_OFF -> RTE_LCORE_ROLE_OFF
> > > > - ROLE_SERVICE -> RTE_LCORE_ROLE_SERVICE
> > > > - ROLE_NON_EAL -> RTE_LCORE_ROLE_NON_EAL
> > > >
> > > > Old names are kept as macros aliasing to the new names to
> preserve
> > > > backward compatibility.
> > > >
> > >
> > > Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
> > >
> >
> > The problem with this patch it causes build failures now with abi
> diff.
>
> It is probably a bug of an old version of abidiff.
> I recommend updating.
With the #define's the ABI has not changed. It's probably too indirect for abidiff to understand.
If we absolutely want to please abidiff, we could keep the existing enums and #define RTE_LCORE_ROLE_RTE ROLE_RTE for now.
But I'm in favor of what was done already.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1 0/5] prefix lcore role enum values
2026-06-19 7:54 ` Morten Brørup
@ 2026-06-19 15:39 ` Stephen Hemminger
2026-06-19 20:11 ` Morten Brørup
0 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2026-06-19 15:39 UTC (permalink / raw)
To: Morten Brørup
Cc: Thomas Monjalon, Huisong Li, andrew.rybchenko, dev, zhanjie9
On Fri, 19 Jun 2026 09:54:51 +0200
Morten Brørup <mb@smartsharesystems.com> wrote:
> > > The problem with this patch it causes build failures now with abi
> > diff.
> >
> > It is probably a bug of an old version of abidiff.
> > I recommend updating.
>
> With the #define's the ABI has not changed. It's probably too indirect for abidiff to understand.
> If we absolutely want to please abidiff, we could keep the existing enums and #define RTE_LCORE_ROLE_RTE ROLE_RTE for now.
> But I'm in favor of what was done already.
The build failures on github, not in my local builds.
https://github.com/ovsrobot/dpdk/actions/runs/27789889172/job/82235965090
It makes looking at patchwork dashboard difficult, all patches show up with red mark
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH v1 0/5] prefix lcore role enum values
2026-06-19 15:39 ` Stephen Hemminger
@ 2026-06-19 20:11 ` Morten Brørup
2026-06-20 16:42 ` Stephen Hemminger
0 siblings, 1 reply; 15+ messages in thread
From: Morten Brørup @ 2026-06-19 20:11 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Thomas Monjalon, Huisong Li, andrew.rybchenko, dev, zhanjie9
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, 19 June 2026 17.40
>
> On Fri, 19 Jun 2026 09:54:51 +0200
> Morten Brørup <mb@smartsharesystems.com> wrote:
>
> > > > The problem with this patch it causes build failures now with abi
> > > diff.
> > >
> > > It is probably a bug of an old version of abidiff.
> > > I recommend updating.
> >
> > With the #define's the ABI has not changed. It's probably too
> indirect for abidiff to understand.
> > If we absolutely want to please abidiff, we could keep the existing
> enums and #define RTE_LCORE_ROLE_RTE ROLE_RTE for now.
> > But I'm in favor of what was done already.
>
> The build failures on github, not in my local builds.
> https://github.com/ovsrobot/dpdk/actions/runs/27789889172/job/822359650
> 90
>
> It makes looking at patchwork dashboard difficult, all patches show up
> with red mark
So maybe we can choose the path of pleasing abidiff...
Keep the existing enums, and #define the new RTE_LCORE_ prefixed variants, and use those in the code.
Later, with an ABI breaking release, we can swap.
Or maybe we just wait until an ABI breaking release to fix this.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v1 0/5] prefix lcore role enum values
2026-06-19 20:11 ` Morten Brørup
@ 2026-06-20 16:42 ` Stephen Hemminger
0 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2026-06-20 16:42 UTC (permalink / raw)
To: Morten Brørup
Cc: Thomas Monjalon, Huisong Li, andrew.rybchenko, dev, zhanjie9
On Fri, 19 Jun 2026 22:11:02 +0200
Morten Brørup <mb@smartsharesystems.com> wrote:
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Friday, 19 June 2026 17.40
> >
> > On Fri, 19 Jun 2026 09:54:51 +0200
> > Morten Brørup <mb@smartsharesystems.com> wrote:
> >
> > > > > The problem with this patch it causes build failures now with abi
> > > > diff.
> > > >
> > > > It is probably a bug of an old version of abidiff.
> > > > I recommend updating.
> > >
> > > With the #define's the ABI has not changed. It's probably too
> > indirect for abidiff to understand.
> > > If we absolutely want to please abidiff, we could keep the existing
> > enums and #define RTE_LCORE_ROLE_RTE ROLE_RTE for now.
> > > But I'm in favor of what was done already.
> >
> > The build failures on github, not in my local builds.
> > https://github.com/ovsrobot/dpdk/actions/runs/27789889172/job/822359650
> > 90
> >
> > It makes looking at patchwork dashboard difficult, all patches show up
> > with red mark
>
> So maybe we can choose the path of pleasing abidiff...
> Keep the existing enums, and #define the new RTE_LCORE_ prefixed variants, and use those in the code.
>
> Later, with an ABI breaking release, we can swap.
> Or maybe we just wait until an ABI breaking release to fix this.
>
Since change is cosmetic, not functional. I think it should be reverted for 26.07
to get github CI to pass on all platforms.
It can be added back in 26.11
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-06-20 16:42 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 10:28 [PATCH v1 0/5] prefix lcore role enum values Huisong Li
2026-06-17 10:28 ` [PATCH v1 1/5] eal: " Huisong Li
2026-06-17 10:28 ` [PATCH v1 2/5] eal: use new lcore role enum names Huisong Li
2026-06-17 10:28 ` [PATCH v1 3/5] graph: " Huisong Li
2026-06-17 10:28 ` [PATCH v1 4/5] net/softnic: " Huisong Li
2026-06-17 10:28 ` [PATCH v1 5/5] test: " Huisong Li
2026-06-17 11:48 ` [PATCH v1 0/5] prefix lcore role enum values Morten Brørup
2026-06-18 16:19 ` Thomas Monjalon
2026-06-18 18:52 ` Morten Brørup
2026-06-19 2:03 ` Stephen Hemminger
2026-06-19 7:28 ` Thomas Monjalon
2026-06-19 7:54 ` Morten Brørup
2026-06-19 15:39 ` Stephen Hemminger
2026-06-19 20:11 ` Morten Brørup
2026-06-20 16:42 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.