| 354 | } |
| 355 | |
| 356 | static uint16_t |
| 357 | clb_scale_freq(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused, |
| 358 | struct rte_mbuf **pkts __rte_unused, uint16_t nb_rx, |
| 359 | uint16_t max_pkts __rte_unused, void *arg) |
| 360 | { |
| 361 | const unsigned int lcore = rte_lcore_id(); |
| 362 | const bool empty = nb_rx == 0; |
| 363 | struct pmd_core_cfg *lcore_conf = &lcore_cfgs[lcore]; |
| 364 | struct queue_list_entry *queue_conf = arg; |
| 365 | |
| 366 | if (likely(!empty)) { |
| 367 | /* early exit */ |
| 368 | queue_reset(lcore_conf, queue_conf); |
| 369 | |
| 370 | /* scale up freq immediately */ |
| 371 | rte_power_freq_max(rte_lcore_id()); |
| 372 | } else { |
| 373 | /* can this queue sleep? */ |
| 374 | if (!queue_can_sleep(lcore_conf, queue_conf)) |
| 375 | return nb_rx; |
| 376 | |
| 377 | /* can this lcore sleep? */ |
| 378 | if (!lcore_can_sleep(lcore_conf)) |
| 379 | return nb_rx; |
| 380 | |
| 381 | rte_power_freq_min(rte_lcore_id()); |
| 382 | } |
| 383 | |
| 384 | return nb_rx; |
| 385 | } |
| 386 | |
| 387 | static int |
| 388 | queue_stopped(const uint16_t port_id, const uint16_t queue_id) |
nothing calls this directly
no test coverage detected