rte_delay_ms(3500);
if (cb_count.cnt != 2 || rm_count != 1) {
printf("Error: invalid flags count or alarm removal failure"
- " - flags value = %d, expected = %d\n", cb_count.cnt, 2);
+ " - flags value = %d, expected = %d\n",
+ (int)cb_count.cnt, 2);
/* remove any callbacks that might remain */
rte_eal_alarm_cancel(test_multi_cb, (void *)-1);
return -1;
rte_atomic32_clear(&synchro);
if (rte_atomic32_read(&count) != NUM_ATOMIC_TYPES) {
- printf("Atomic inc and test failed %d\n", count.cnt);
+ printf("Atomic inc and test failed %d\n", (int)count.cnt);
return -1;
}
* Cycles test
* ===========
*
- * - Loop N times and check that the timer alway increments and
+ * - Loop N times and check that the timer always increments and
* never decrements during this loop.
*
* - Wait one second using rte_usleep() and check that the increment
prev_cycles = rte_get_hpet_cycles();
rte_delay_us(1000000);
cycles = rte_get_hpet_cycles();
+
if ((uint64_t)(cycles - prev_cycles) > (hz + max_inc)) {
- printf("delay_us is not accurate\n");
+ printf("delay_us is not accurate: too long\n");
return -1;
}
- cycles = rte_get_hpet_cycles();
- if ((uint64_t)(cycles - prev_cycles) < (hz)) {
- printf("delay_us is not accurate\n");
+ if ((uint64_t)(cycles - prev_cycles) < (hz - max_inc)) {
+ printf("delay_us is not accurate: too short\n");
return -1;
}