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

Function get_two_hyperthreads

dpdk/app/test/test_stack_perf.c:33–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31};
32
33static int
34get_two_hyperthreads(struct lcore_pair *lcp)
35{
36 unsigned int socket[2];
37 unsigned int core[2];
38 unsigned int id[2];
39
40 RTE_LCORE_FOREACH(id[0]) {
41 RTE_LCORE_FOREACH(id[1]) {
42 if (id[0] == id[1])
43 continue;
44 core[0] = rte_lcore_to_cpu_id(id[0]);
45 core[1] = rte_lcore_to_cpu_id(id[1]);
46 socket[0] = rte_lcore_to_socket_id(id[0]);
47 socket[1] = rte_lcore_to_socket_id(id[1]);
48 if ((core[0] == core[1]) && (socket[0] == socket[1])) {
49 lcp->c1 = id[0];
50 lcp->c2 = id[1];
51 return 0;
52 }
53 }
54 }
55
56 return 1;
57}
58
59static int
60get_two_cores(struct lcore_pair *lcp)

Callers 1

__test_stack_perfFunction · 0.70

Calls 2

rte_lcore_to_cpu_idFunction · 0.85
rte_lcore_to_socket_idFunction · 0.85

Tested by

no test coverage detected