struct rte_hash *h;
} tbl_rwc_test_param;
-static rte_atomic64_t gread_cycles;
-static rte_atomic64_t greads;
+static uint64_t gread_cycles;
+static uint64_t greads;
static volatile uint8_t writer_done;
} while (!writer_done);
cycles = rte_rdtsc_precise() - begin;
- rte_atomic64_add(&gread_cycles, cycles);
- rte_atomic64_add(&greads, read_cnt*loop_cnt);
+ __atomic_fetch_add(&gread_cycles, cycles, __ATOMIC_RELAXED);
+ __atomic_fetch_add(&greads, read_cnt*loop_cnt, __ATOMIC_RELAXED);
return 0;
}
uint8_t write_type = WRITE_NO_KEY_SHIFT;
uint8_t read_type = READ_PASS_NO_KEY_SHIFTS;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Hash add - no key-shifts, read - hit\n");
printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0, __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles) /
- rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles, __ATOMIC_RELAXED)
+ / __atomic_load_n(&greads, __ATOMIC_RELAXED);
rwc_perf_results->w_no_ks_r_hit[m][n]
= cycles_per_lookup;
printf("Cycles per lookup: %llu\n", cycles_per_lookup);
uint8_t read_type = READ_FAIL;
int ret;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Hash add - no key-shifts, Hash lookup - miss\n");
printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0, __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles) /
- rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles, __ATOMIC_RELAXED)
+ / __atomic_load_n(&greads, __ATOMIC_RELAXED);
rwc_perf_results->w_no_ks_r_miss[m][n]
= cycles_per_lookup;
printf("Cycles per lookup: %llu\n", cycles_per_lookup);
uint8_t write_type;
uint8_t read_type = READ_PASS_NON_SHIFT_PATH;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Hash add - key shift, Hash lookup - hit"
printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0, __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles) /
- rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles, __ATOMIC_RELAXED)
+ / __atomic_load_n(&greads, __ATOMIC_RELAXED);
rwc_perf_results->w_ks_r_hit_nsp[m][n]
= cycles_per_lookup;
printf("Cycles per lookup: %llu\n", cycles_per_lookup);
uint8_t write_type;
uint8_t read_type = READ_PASS_SHIFT_PATH;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Hash add - key shift, Hash lookup - hit (shift-path)"
goto finish;
printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0, __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles) /
- rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles, __ATOMIC_RELAXED)
+ / __atomic_load_n(&greads, __ATOMIC_RELAXED);
rwc_perf_results->w_ks_r_hit_sp[m][n]
= cycles_per_lookup;
printf("Cycles per lookup: %llu\n", cycles_per_lookup);
uint8_t write_type;
uint8_t read_type = READ_FAIL;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Hash add - key shift, Hash lookup - miss\n");
printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0, __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles) /
- rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles, __ATOMIC_RELAXED)
+ / __atomic_load_n(&greads, __ATOMIC_RELAXED);
rwc_perf_results->w_ks_r_miss[m][n] = cycles_per_lookup;
printf("Cycles per lookup: %llu\n", cycles_per_lookup);
}
uint8_t write_type;
uint8_t read_type = READ_PASS_SHIFT_PATH;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Multi-add-lookup\n");
printf("\nNumber of readers: %u\n",
rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0,
+ __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles)
- / rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles,
+ __ATOMIC_RELAXED) /
+ __atomic_load_n(&greads,
+ __ATOMIC_RELAXED);
rwc_perf_results->multi_rw[m][k][n]
= cycles_per_lookup;
printf("Cycles per lookup: %llu\n",
uint8_t write_type;
uint8_t read_type = READ_PASS_KEY_SHIFTS_EXTBKT;
- rte_atomic64_init(&greads);
- rte_atomic64_init(&gread_cycles);
-
if (init_params(rwc_lf, use_jhash, htm, ext_bkt) != 0)
goto err;
printf("\nTest: Hash add - key-shifts, read - hit (ext_bkt)\n");
printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);
- rte_atomic64_clear(&greads);
- rte_atomic64_clear(&gread_cycles);
+ __atomic_store_n(&greads, 0, __ATOMIC_RELAXED);
+ __atomic_store_n(&gread_cycles, 0, __ATOMIC_RELAXED);
rte_hash_reset(tbl_rwc_test_param.h);
write_type = WRITE_NO_KEY_SHIFT;
goto err;
unsigned long long cycles_per_lookup =
- rte_atomic64_read(&gread_cycles) /
- rte_atomic64_read(&greads);
+ __atomic_load_n(&gread_cycles, __ATOMIC_RELAXED)
+ / __atomic_load_n(&greads, __ATOMIC_RELAXED);
rwc_perf_results->w_ks_r_hit_extbkt[m][n]
= cycles_per_lookup;
printf("Cycles per lookup: %llu\n", cycles_per_lookup);