MCPcopy Create free account
hub / github.com/F-Stack/f-stack / compute_ctrl_threads_cpuset

Function compute_ctrl_threads_cpuset

dpdk/lib/eal/common/eal_common_options.c:1981–2005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1979}
1980
1981static void
1982compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
1983{
1984 rte_cpuset_t *cpuset = &internal_cfg->ctrl_cpuset;
1985 rte_cpuset_t default_set;
1986 unsigned int lcore_id;
1987
1988 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
1989 if (rte_lcore_has_role(lcore_id, ROLE_OFF))
1990 continue;
1991 RTE_CPU_OR(cpuset, cpuset, &lcore_config[lcore_id].cpuset);
1992 }
1993 RTE_CPU_NOT(cpuset, cpuset);
1994
1995 if (rte_thread_get_affinity_by_id(rte_thread_self(), &default_set) != 0)
1996 CPU_ZERO(&default_set);
1997
1998 RTE_CPU_AND(cpuset, cpuset, &default_set);
1999
2000 /* if no remaining cpu, use main lcore cpu affinity */
2001 if (!CPU_COUNT(cpuset)) {
2002 memcpy(cpuset, &lcore_config[rte_get_main_lcore()].cpuset,
2003 sizeof(*cpuset));
2004 }
2005}
2006
2007int
2008eal_cleanup_config(struct internal_config *internal_cfg)

Callers 1

eal_adjust_configFunction · 0.85

Calls 5

rte_lcore_has_roleFunction · 0.85
rte_get_main_lcoreFunction · 0.85
rte_thread_selfFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected