static rte_atomic64_t greads;
static volatile uint8_t writer_done;
-static volatile uint8_t multi_writer_done[4];
uint16_t enabled_core_ids[RTE_MAX_LCORE];
for (i = offset; i < offset + tbl_rwc_test_param.single_insert; i++)
rte_hash_add_key(tbl_rwc_test_param.h,
tbl_rwc_test_param.keys_ks + i);
- multi_writer_done[pos_core] = 1;
return 0;
}
rte_eal_remote_launch(test_rwc_reader,
(void *)(uintptr_t)read_type,
enabled_core_ids[i]);
- rte_eal_mp_wait_lcore();
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}
enabled_core_ids[i]);
ret = write_keys(write_type);
writer_done = 1;
- rte_eal_mp_wait_lcore();
if (ret < 0)
goto err;
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}
write_type = WRITE_KEY_SHIFT;
ret = write_keys(write_type);
writer_done = 1;
- rte_eal_mp_wait_lcore();
if (ret < 0)
goto err;
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}
write_type = WRITE_KEY_SHIFT;
ret = write_keys(write_type);
writer_done = 1;
- rte_eal_mp_wait_lcore();
if (ret < 0)
goto err;
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}
write_type = WRITE_KEY_SHIFT;
ret = write_keys(write_type);
writer_done = 1;
- rte_eal_mp_wait_lcore();
if (ret < 0)
goto err;
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}
rte_hash_reset(tbl_rwc_test_param.h);
writer_done = 0;
- for (i = 0; i < 4; i++)
- multi_writer_done[i] = 0;
write_type = WRITE_NO_KEY_SHIFT;
if (write_keys(write_type) < 0)
goto err;
}
/* Wait for writers to complete */
- for (i = 0; i < rwc_core_cnt[m]; i++)
- while
- (multi_writer_done[i] == 0);
- writer_done = 1;
+ for (i = rwc_core_cnt[n] + 1;
+ i <= rwc_core_cnt[m] + rwc_core_cnt[n];
+ i++)
+ rte_eal_wait_lcore(i);
- rte_eal_mp_wait_lcore();
+ writer_done = 1;
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}
}
}
writer_done = 1;
- rte_eal_mp_wait_lcore();
for (i = 1; i <= rwc_core_cnt[n]; i++)
- if (lcore_config[i].ret < 0)
+ if (rte_eal_wait_lcore(i) < 0)
goto err;
unsigned long long cycles_per_lookup =
return 0;
err:
+ rte_eal_mp_wait_lcore();
rte_hash_free(tbl_rwc_test_param.h);
return -1;
}