| 206 | } |
| 207 | |
| 208 | static inline bool |
| 209 | queue_can_sleep(struct pmd_core_cfg *cfg, struct queue_list_entry *qcfg) |
| 210 | { |
| 211 | /* this function is called - that means we have an empty poll */ |
| 212 | qcfg->n_empty_polls++; |
| 213 | |
| 214 | /* if we haven't reached threshold for empty polls, we can't sleep */ |
| 215 | if (qcfg->n_empty_polls <= emptypoll_max) |
| 216 | return false; |
| 217 | |
| 218 | /* |
| 219 | * we've reached a point where we are able to sleep, but we still need |
| 220 | * to check if this queue has already been marked for sleeping. |
| 221 | */ |
| 222 | if (qcfg->n_sleeps == cfg->sleep_target) |
| 223 | return true; |
| 224 | |
| 225 | /* mark this queue as ready for sleep */ |
| 226 | qcfg->n_sleeps = cfg->sleep_target; |
| 227 | cfg->n_queues_ready_to_sleep++; |
| 228 | |
| 229 | return true; |
| 230 | } |
| 231 | |
| 232 | static inline bool |
| 233 | lcore_can_sleep(struct pmd_core_cfg *cfg) |
no outgoing calls
no test coverage detected