This function returns true if one or more (adapter) ticks have occurred since * the last time it was called. */
| 786 | * the last time it was called. |
| 787 | */ |
| 788 | static inline bool |
| 789 | swtim_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 |
no outgoing calls
no test coverage detected