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

Function clb_pause

dpdk/lib/power/rte_power_pmd_mgmt.c:315–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315static uint16_t
316clb_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
356static uint16_t
357clb_scale_freq(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused,

Callers

nothing calls this directly

Calls 8

rte_lcore_idFunction · 0.85
queue_resetFunction · 0.85
queue_can_sleepFunction · 0.85
lcore_can_sleepFunction · 0.85
rte_rdtscFunction · 0.50
rte_power_pauseFunction · 0.50
rte_pauseFunction · 0.50

Tested by

no test coverage detected