return cfg->lcore_role[lcore_id];
}
+int
+rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role)
+{
+ struct rte_config *cfg = rte_eal_get_configuration();
+
+ if (lcore_id >= RTE_MAX_LCORE)
+ return -EINVAL;
+
+ return cfg->lcore_role[lcore_id] == role;
+}
+
int rte_lcore_is_enabled(unsigned int lcore_id)
{
struct rte_config *cfg = rte_eal_get_configuration();
return RTE_PER_LCORE(_socket_id);
}
-int
-rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role)
-{
- struct rte_config *cfg = rte_eal_get_configuration();
-
- if (lcore_id >= RTE_MAX_LCORE)
- return -EINVAL;
-
- return cfg->lcore_role[lcore_id] == role;
-}
-
static int
eal_cpuset_socket_id(rte_cpuset_t *cpusetp)
{
/* Maximum thread_name length. */
#define RTE_MAX_THREAD_NAME_LEN 16
-/**
- * The lcore role (used in RTE or not).
- */
-enum rte_lcore_role_t {
- ROLE_RTE,
- ROLE_OFF,
- ROLE_SERVICE,
-};
-
/**
* The type of process in a linux, multi-process setup
*/
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,
+};
+
/**
* Get a lcore's role.
*
*/
enum rte_lcore_role_t rte_eal_lcore_role(unsigned int lcore_id);
+/**
+ * Test if the core supplied has a specific role
+ *
+ * @param lcore_id
+ * The identifier of the lcore, which MUST be between 0 and
+ * RTE_MAX_LCORE-1.
+ * @param role
+ * The role to be checked against.
+ * @return
+ * Boolean value: positive if test is true; otherwise returns 0.
+ */
+int
+rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role);
+
/**
* Return the Application thread ID of the execution unit.
*
const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg);
-/**
- * Test if the core supplied has a specific role
- *
- * @param lcore_id
- * The identifier of the lcore, which MUST be between 0 and
- * RTE_MAX_LCORE-1.
- * @param role
- * The role to be checked against.
- * @return
- * Boolean value: positive if test is true; otherwise returns 0.
- */
-int
-rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role);
-
#ifdef __cplusplus
}
#endif