*
* - Invoke ``test_atomic_exchange`` on each lcore. Before doing
* anything else, the cores wait for a synchronization event.
- * Each core then does the follwoing for N iterations:
+ * Each core then does the following for N iterations:
*
* Generate a new token with a data integrity check
* Exchange the new token for previously generated token
static rte_atomic32_t synchro;
static int
-test_atomic_usual(__attribute__((unused)) void *arg)
+test_atomic_usual(__rte_unused void *arg)
{
unsigned i;
}
static int
-test_atomic_tas(__attribute__((unused)) void *arg)
+test_atomic_tas(__rte_unused void *arg)
{
while (rte_atomic32_read(&synchro) == 0)
;
}
static int
-test_atomic_addsub_and_return(__attribute__((unused)) void *arg)
+test_atomic_addsub_and_return(__rte_unused void *arg)
{
uint32_t tmp16;
uint32_t tmp32;
*
*/
static int
-test_atomic_inc_and_test(__attribute__((unused)) void *arg)
+test_atomic_inc_and_test(__rte_unused void *arg)
{
while (rte_atomic32_read(&synchro) == 0)
;
* be checked as the result later.
*/
static int
-test_atomic_dec_and_test(__attribute__((unused)) void *arg)
+test_atomic_dec_and_test(__rte_unused void *arg)
{
while (rte_atomic32_read(&synchro) == 0)
;
* iteration it runs compare and swap operation with different memory models.
*/
static int
-test_atomic128_cmp_exchange(__attribute__((unused)) void *arg)
+test_atomic128_cmp_exchange(__rte_unused void *arg)
{
rte_int128_t expected;
int success;
* +------------+------------+
*/
static int
-test_atomic_exchange(__attribute__((unused)) void *arg)
+test_atomic_exchange(__rte_unused void *arg)
{
int i;
test16_t nt16, ot16; /* new token, old token */
printf("usual inc/dec/add/sub functions\n");
- rte_eal_mp_remote_launch(test_atomic_usual, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_usual, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
rte_atomic32_set(&a32, 0);
rte_atomic16_set(&a16, 0);
rte_atomic64_set(&count, 0);
- rte_eal_mp_remote_launch(test_atomic_tas, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_tas, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
rte_atomic16_set(&a16, 0);
rte_atomic64_set(&count, 0);
rte_eal_mp_remote_launch(test_atomic_addsub_and_return, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
}
/*
- * Set a64, a32 and a16 with the same value of minus "number of slave
- * lcores", launch all slave lcores to atomically increase by one and
+ * Set a64, a32 and a16 with the same value of minus "number of worker
+ * lcores", launch all worker lcores to atomically increase by one and
* test them respectively.
* Each lcore should have only one chance to increase a64 by one and
* then check if it is equal to 0, but there should be only one lcore
* Then a variable of "count", initialized to zero, is increased by
* one if a64, a32 or a16 is 0 after being increased and tested
* atomically.
- * We can check if "count" is finally equal to 3 to see if all slave
+ * We can check if "count" is finally equal to 3 to see if all worker
* lcores performed "atomic inc and test" right.
*/
printf("inc and test\n");
rte_atomic64_set(&a64, (int64_t)(1 - (int64_t)rte_lcore_count()));
rte_atomic32_set(&a32, (int32_t)(1 - (int32_t)rte_lcore_count()));
rte_atomic16_set(&a16, (int16_t)(1 - (int16_t)rte_lcore_count()));
- rte_eal_mp_remote_launch(test_atomic_inc_and_test, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_inc_and_test, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
}
/*
- * Same as above, but this time we set the values to "number of slave
+ * Same as above, but this time we set the values to "number of worker
* lcores", and decrement instead of increment.
*/
printf("dec and test\n");
rte_atomic64_set(&a64, (int64_t)(rte_lcore_count() - 1));
rte_atomic32_set(&a32, (int32_t)(rte_lcore_count() - 1));
rte_atomic16_set(&a16, (int16_t)(rte_lcore_count() - 1));
- rte_eal_mp_remote_launch(test_atomic_dec_and_test, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_dec_and_test, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
/*
* This case tests the functionality of rte_atomic128_cmp_exchange
* API. It calls rte_atomic128_cmp_exchange with four kinds of memory
- * models successively on each slave core. Once each 128-bit atomic
+ * models successively on each worker core. Once each 128-bit atomic
* compare and swap operation is successful, it updates the global
* 128-bit counter by 2 for the first 64-bit and 1 for the second
- * 64-bit. Each slave core iterates this test N times.
+ * 64-bit. Each worker core iterates this test N times.
* At the end of test, verify whether the first 64-bits of the 128-bit
* counter and the second 64bits is differ by the total iterations. If
* it is, the test passes.
count128.val[1] = 0;
rte_eal_mp_remote_launch(test_atomic128_cmp_exchange, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
iterations = count128.val[0] - count128.val[1];
- if (iterations != 4*N*(rte_lcore_count()-1)) {
+ if (iterations != (uint64_t)4*N*(rte_lcore_count()-1)) {
printf("128-bit compare and swap failed\n");
return -1;
}
token64 = ((uint64_t)get_crc8(&t.u8[0], sizeof(token64) - 1) << 56)
| (t.u64 & 0x00ffffffffffffff);
- rte_eal_mp_remote_launch(test_atomic_exchange, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_exchange, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);