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. */
| 159 | * a 2 GHz CPU. |
| 160 | */ |
| 161 | static uint64_t |
| 162 | timeout_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 | |
| 172 | static int |
| 173 | table_params_get(struct table_params *p, struct rte_swx_table_learner_params *params) |
no test coverage detected