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

Function get_two_sockets

dpdk/app/test/test_stack_perf.c:85–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static int
86get_two_sockets(struct lcore_pair *lcp)
87{
88 unsigned int socket[2];
89 unsigned int id[2];
90
91 RTE_LCORE_FOREACH(id[0]) {
92 RTE_LCORE_FOREACH(id[1]) {
93 if (id[0] == id[1])
94 continue;
95 socket[0] = rte_lcore_to_socket_id(id[0]);
96 socket[1] = rte_lcore_to_socket_id(id[1]);
97 if (socket[0] != socket[1]) {
98 lcp->c1 = id[0];
99 lcp->c2 = id[1];
100 return 0;
101 }
102 }
103 }
104
105 return 1;
106}
107
108/* Measure the cycle cost of popping an empty stack. */
109static void

Callers 1

__test_stack_perfFunction · 0.70

Calls 1

rte_lcore_to_socket_idFunction · 0.85

Tested by

no test coverage detected