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

Function swtim_did_tick

dpdk/lib/eventdev/rte_event_timer_adapter.c:788–814  ·  view source on GitHub ↗

This function returns true if one or more (adapter) ticks have occurred since * the last time it was called. */

Source from the content-addressed store, hash-verified

786 * the last time it was called.
787 */
788static inline bool
789swtim_did_tick(struct swtim *sw)
790{
791 uint64_t cycles_per_adapter_tick, start_cycles;
792 uint64_t *next_tick_cyclesp;
793
794 next_tick_cyclesp = &sw->next_tick_cycles;
795 cycles_per_adapter_tick = sw->timer_tick_ns *
796 (rte_get_timer_hz() / NSECPERSEC);
797 start_cycles = rte_get_timer_cycles();
798
799 /* Note: initially, *next_tick_cyclesp == 0, so the clause below will
800 * execute, and set things going.
801 */
802
803 if (start_cycles >= *next_tick_cyclesp) {
804 /* Snap the current cycle count to the preceding adapter tick
805 * boundary.
806 */
807 start_cycles -= start_cycles % cycles_per_adapter_tick;
808 *next_tick_cyclesp = start_cycles + cycles_per_adapter_tick;
809
810 return true;
811 }
812
813 return false;
814}
815
816/* Check that event timer event queue sched type matches destination event queue
817 * sched type

Callers 1

swtim_service_funcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected