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

Function timeout_convert

dpdk/lib/table/rte_swx_table_learner.c:161–170  ·  view source on GitHub ↗

The timeout (in cycles) is stored in the table as a 32-bit value by truncating its least * significant 32 bits. Therefore, to make sure the time is always advancing when adding the timeout * value on top of the current time, the minimum timeout value is 1^32 cycles, which is 2 seconds on * a 2 GHz CPU. */

Source from the content-addressed store, hash-verified

159 * a 2 GHz CPU.
160 */
161static uint64_t
162timeout_convert(uint32_t timeout_in_seconds)
163{
164 uint64_t timeout_in_cycles = timeout_in_seconds * rte_get_tsc_hz();
165
166 if (!(timeout_in_cycles >> 32))
167 timeout_in_cycles = 1LLU << 32;
168
169 return timeout_in_cycles;
170}
171
172static int
173table_params_get(struct table_params *p, struct rte_swx_table_learner_params *params)

Callers 2

table_params_getFunction · 0.85

Calls 1

rte_get_tsc_hzFunction · 0.85

Tested by

no test coverage detected