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

Function clb_scale_freq

dpdk/lib/power/rte_power_pmd_mgmt.c:356–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356static uint16_t
357clb_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
387static int
388queue_stopped(const uint16_t port_id, const uint16_t queue_id)

Callers

nothing calls this directly

Calls 4

rte_lcore_idFunction · 0.85
queue_resetFunction · 0.85
queue_can_sleepFunction · 0.85
lcore_can_sleepFunction · 0.85

Tested by

no test coverage detected