return lcore_config[lcore_id].cpuset;
}
+enum rte_lcore_role_t
+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 cfg->lcore_role[lcore_id];
+}
+
int rte_lcore_is_enabled(unsigned int lcore_id)
{
struct rte_config *cfg = rte_eal_get_configuration();
*/
struct rte_config *rte_eal_get_configuration(void);
-/**
- * Get a lcore's role.
- *
- * @param lcore_id
- * The identifier of the lcore.
- * @return
- * The role of the lcore.
- */
-enum rte_lcore_role_t rte_eal_lcore_role(unsigned lcore_id);
-
-
/**
* Get the process type in a multi-process setup
*
RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
+/**
+ * Get a lcore's role.
+ *
+ * @param lcore_id
+ * The identifier of the lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
+ * @return
+ * The role of the lcore.
+ */
+enum rte_lcore_role_t rte_eal_lcore_role(unsigned int lcore_id);
+
/**
* Return the Application thread ID of the execution unit.
*
return 0;
}
-/* get core role */
-enum rte_lcore_role_t
-rte_eal_lcore_role(unsigned lcore_id)
-{
- return rte_config.lcore_role[lcore_id];
-}
-
enum rte_proc_type_t
rte_eal_process_type(void)
{
return 0;
}
-/* get core role */
-enum rte_lcore_role_t
-rte_eal_lcore_role(unsigned lcore_id)
-{
- return rte_config.lcore_role[lcore_id];
-}
-
enum rte_proc_type_t
rte_eal_process_type(void)
{