| 313 | } |
| 314 | |
| 315 | static uint16_t |
| 316 | clb_pause(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused, |
| 317 | struct rte_mbuf **pkts __rte_unused, uint16_t nb_rx, |
| 318 | uint16_t max_pkts __rte_unused, void *arg) |
| 319 | { |
| 320 | const unsigned int lcore = rte_lcore_id(); |
| 321 | struct queue_list_entry *queue_conf = arg; |
| 322 | struct pmd_core_cfg *lcore_conf; |
| 323 | const bool empty = nb_rx == 0; |
| 324 | uint32_t pause_duration = rte_power_pmd_mgmt_get_pause_duration(); |
| 325 | |
| 326 | lcore_conf = &lcore_cfgs[lcore]; |
| 327 | |
| 328 | if (likely(!empty)) |
| 329 | /* early exit */ |
| 330 | queue_reset(lcore_conf, queue_conf); |
| 331 | else { |
| 332 | /* can this queue sleep? */ |
| 333 | if (!queue_can_sleep(lcore_conf, queue_conf)) |
| 334 | return nb_rx; |
| 335 | |
| 336 | /* can this lcore sleep? */ |
| 337 | if (!lcore_can_sleep(lcore_conf)) |
| 338 | return nb_rx; |
| 339 | |
| 340 | /* sleep for 1 microsecond, use tpause if we have it */ |
| 341 | if (global_data.intrinsics_support.power_pause) { |
| 342 | const uint64_t cur = rte_rdtsc(); |
| 343 | const uint64_t wait_tsc = |
| 344 | cur + global_data.tsc_per_us * pause_duration; |
| 345 | rte_power_pause(wait_tsc); |
| 346 | } else { |
| 347 | uint64_t i; |
| 348 | for (i = 0; i < global_data.pause_per_us * pause_duration; i++) |
| 349 | rte_pause(); |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | return nb_rx; |
| 354 | } |
| 355 | |
| 356 | static uint16_t |
| 357 | clb_scale_freq(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused, |
nothing calls this directly
no test coverage detected