The autotests are too long to be run often.
This patch reduces the needed time of some tests in fast_test.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
"Test Failed",
"Hello from core ([0-9]*) !",
"Hello from within recursive locks from ([0-9]*) !",
- pexpect.TIMEOUT], timeout = 20)
+ pexpect.TIMEOUT], timeout = 5)
# ok
if index == 0:
break
i = 0
child.sendline(test_name)
- index = child.expect(["Start timer stress tests \(20 seconds\)",
+ index = child.expect(["Start timer stress tests",
"Test Failed",
- pexpect.TIMEOUT], timeout = 10)
+ pexpect.TIMEOUT], timeout = 5)
if index == 1:
return -1, "Fail"
index = child.expect(["Start timer stress tests 2",
"Test Failed",
- pexpect.TIMEOUT], timeout = 40)
+ pexpect.TIMEOUT], timeout = 5)
if index == 1:
return -1, "Fail"
elif index == 2:
return -1, "Fail [Timeout]"
- index = child.expect(["Start timer basic tests \(20 seconds\)",
+ index = child.expect(["Start timer basic tests",
"Test Failed",
- pexpect.TIMEOUT], timeout = 20)
+ pexpect.TIMEOUT], timeout = 5)
if index == 1:
return -1, "Fail"
def ring_autotest(child, test_name):
child.sendline(test_name)
index = child.expect(["Test OK", "Test Failed",
- pexpect.TIMEOUT], timeout = 15)
+ pexpect.TIMEOUT], timeout = 2)
if index == 1:
return -1, "Fail"
elif index == 2:
#define US_PER_MS 1000
-#define RTE_TEST_ALARM_TIMEOUT 3000 /* ms */
-#define RTE_TEST_CHECK_PERIOD 1000 /* ms */
+#define RTE_TEST_ALARM_TIMEOUT 10 /* ms */
+#define RTE_TEST_CHECK_PERIOD 3 /* ms */
static volatile int flag;
printf("Expect 6 callbacks in order...\n");
/* add two alarms in order */
- rte_eal_alarm_set(1000 * US_PER_MS, test_multi_cb, (void *)1);
- rte_eal_alarm_set(2000 * US_PER_MS, test_multi_cb, (void *)2);
+ rte_eal_alarm_set(10 * US_PER_MS, test_multi_cb, (void *)1);
+ rte_eal_alarm_set(20 * US_PER_MS, test_multi_cb, (void *)2);
/* now add in reverse order */
- rte_eal_alarm_set(6000 * US_PER_MS, test_multi_cb, (void *)6);
- rte_eal_alarm_set(5000 * US_PER_MS, test_multi_cb, (void *)5);
- rte_eal_alarm_set(4000 * US_PER_MS, test_multi_cb, (void *)4);
- rte_eal_alarm_set(3000 * US_PER_MS, test_multi_cb, (void *)3);
+ rte_eal_alarm_set(60 * US_PER_MS, test_multi_cb, (void *)6);
+ rte_eal_alarm_set(50 * US_PER_MS, test_multi_cb, (void *)5);
+ rte_eal_alarm_set(40 * US_PER_MS, test_multi_cb, (void *)4);
+ rte_eal_alarm_set(30 * US_PER_MS, test_multi_cb, (void *)3);
/* wait for expiry */
- rte_delay_ms(6500);
+ rte_delay_ms(65);
if (cb_count.cnt != 6) {
printf("Missing callbacks\n");
/* remove any callbacks that might remain */
cb_count.cnt = 0;
printf("Expect only callbacks with args 1 and 3...\n");
/* Add 3 flags, then delete one */
- rte_eal_alarm_set(3000 * US_PER_MS, test_multi_cb, (void *)3);
- rte_eal_alarm_set(2000 * US_PER_MS, test_multi_cb, (void *)2);
- rte_eal_alarm_set(1000 * US_PER_MS, test_multi_cb, (void *)1);
+ rte_eal_alarm_set(30 * US_PER_MS, test_multi_cb, (void *)3);
+ rte_eal_alarm_set(20 * US_PER_MS, test_multi_cb, (void *)2);
+ rte_eal_alarm_set(10 * US_PER_MS, test_multi_cb, (void *)1);
rm_count = rte_eal_alarm_cancel(test_multi_cb, (void *)2);
- rte_delay_ms(3500);
+ rte_delay_ms(35);
if (cb_count.cnt != 2 || rm_count != 1) {
printf("Error: invalid flags count or alarm removal failure"
" - flags value = %d, expected = %d\n",
printf("Testing adding and then removing multiple alarms\n");
/* finally test that no callbacks are called if we delete them all*/
- rte_eal_alarm_set(1000 * US_PER_MS, test_multi_cb, (void *)1);
- rte_eal_alarm_set(1000 * US_PER_MS, test_multi_cb, (void *)2);
- rte_eal_alarm_set(1000 * US_PER_MS, test_multi_cb, (void *)3);
+ rte_eal_alarm_set(10 * US_PER_MS, test_multi_cb, (void *)1);
+ rte_eal_alarm_set(10 * US_PER_MS, test_multi_cb, (void *)2);
+ rte_eal_alarm_set(10 * US_PER_MS, test_multi_cb, (void *)3);
rm_count = rte_eal_alarm_cancel(test_alarm_callback, (void *)-1);
if (rm_count != 0) {
printf("Error removing non-existant alarm succeeded\n");
* Also test that we can cancel head-of-line callbacks ok.*/
flag = 0;
recursive_error = 0;
- rte_eal_alarm_set(1000 * US_PER_MS, test_remove_in_callback, (void *)1);
- rte_eal_alarm_set(2000 * US_PER_MS, test_remove_in_callback, (void *)2);
+ rte_eal_alarm_set(10 * US_PER_MS, test_remove_in_callback, (void *)1);
+ rte_eal_alarm_set(20 * US_PER_MS, test_remove_in_callback, (void *)2);
rm_count = rte_eal_alarm_cancel(test_remove_in_callback, (void *)1);
if (rm_count != 1) {
printf("Error cancelling head-of-list callback\n");
return -1;
}
- rte_delay_ms(1500);
+ rte_delay_ms(15);
if (flag != 0) {
printf("Error, cancelling head-of-list leads to premature callback\n");
return -1;
}
- rte_delay_ms(1000);
+ rte_delay_ms(10);
if (flag != 2) {
printf("Error - expected callback not called\n");
rte_eal_alarm_cancel(test_remove_in_callback, (void *)-1);
/* Check if it can cancel all for the same callback */
printf("Testing canceling all for the same callback\n");
flag_2 = 0;
- rte_eal_alarm_set(1000 * US_PER_MS, test_remove_in_callback, (void *)1);
- rte_eal_alarm_set(2000 * US_PER_MS, test_remove_in_callback_2, (void *)2);
- rte_eal_alarm_set(3000 * US_PER_MS, test_remove_in_callback_2, (void *)3);
- rte_eal_alarm_set(4000 * US_PER_MS, test_remove_in_callback, (void *)4);
+ rte_eal_alarm_set(10 * US_PER_MS, test_remove_in_callback, (void *)1);
+ rte_eal_alarm_set(20 * US_PER_MS, test_remove_in_callback_2, (void *)2);
+ rte_eal_alarm_set(30 * US_PER_MS, test_remove_in_callback_2, (void *)3);
+ rte_eal_alarm_set(40 * US_PER_MS, test_remove_in_callback, (void *)4);
rm_count = rte_eal_alarm_cancel(test_remove_in_callback_2, (void *)-1);
if (rm_count != 2) {
printf("Error, cannot cancel all for the same callback\n");
.socket_id = 0,
};
-#define CRC32_ITERATIONS (1U << 20)
+#define CRC32_ITERATIONS (1U << 10)
#define CRC32_DWORDS (1U << 6)
/*
* Test if all CRC32 implementations yield the same hash value
return 0;
}
-#define ITERATIONS 50
+#define ITERATIONS 3
/*
* Test to see the average table utilization (entries added/max entries)
* before hitting a random entry that cannot be added
"\n before adding elements begins to fail\n");
printf("Measuring performance, please wait");
fflush(stdout);
- ut_params.entries = 1 << 20;
+ ut_params.entries = 1 << 16;
ut_params.name = "test_average_utilization";
ut_params.hash_func = rte_jhash;
handle = rte_hash_create(&ut_params);
return 0;
}
-#define NUM_ENTRIES 1024
+#define NUM_ENTRIES 256
static int test_hash_iteration(void)
{
struct rte_hash *handle;
#include "test.h"
-#define TEST_INTERRUPT_CHECK_INTERVAL 1000 /* ms */
+#define TEST_INTERRUPT_CHECK_INTERVAL 100 /* ms */
/* predefined interrupt handle types */
enum test_interrupt_handle_type {
if (test_interrupt_trigger_interrupt() < 0)
return -1;
- /* check flag in 3 seconds */
+ /* check flag */
for (count = 0; flag == 0 && count < 3; count++)
rte_delay_ms(TEST_INTERRUPT_CHECK_INTERVAL);
}
/*
- * Create lpm table then delete lpm table 100 times
+ * Create lpm table then delete lpm table 20 times
* Use a slightly different rules size each time
*/
int32_t
config.flags = 0;
/* rte_lpm6_free: Free NULL */
- for (i = 0; i < 100; i++) {
+ for (i = 0; i < 20; i++) {
config.max_rules = MAX_RULES - i;
lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);
TEST_LPM_ASSERT(lpm != NULL);
}
/*
- * Add 2^16 routes with different first 16 bits and depth 25.
+ * Add 2^12 routes with different first 12 bits and depth 25.
* Add one more route with the same depth and check that results in a failure.
* After that delete the last rule and create the one that was attempted to be
* created. This checks tbl8 exhaustion.
uint8_t ip[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
uint8_t depth = 25, next_hop_add = 100;
int32_t status = 0;
- int i, j;
+ int i;
config.max_rules = MAX_RULES;
- config.number_tbl8s = NUMBER_TBL8S;
+ config.number_tbl8s = 256;
config.flags = 0;
lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);
for (i = 0; i < 256; i++) {
ip[0] = (uint8_t)i;
- for (j = 0; j < 256; j++) {
- ip[1] = (uint8_t)j;
- status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
- TEST_LPM_ASSERT(status == 0);
- }
+ status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
+ TEST_LPM_ASSERT(status == 0);
}
ip[0] = 255;
- ip[1] = 255;
- ip[2] = 1;
+ ip[1] = 1;
status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
TEST_LPM_ASSERT(status == -ENOSPC);
ip[0] = 255;
- ip[1] = 255;
- ip[2] = 0;
+ ip[1] = 0;
status = rte_lpm6_delete(lpm, ip, depth);
TEST_LPM_ASSERT(status == 0);
ip[0] = 255;
- ip[1] = 255;
- ip[2] = 1;
+ ip[1] = 1;
status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
TEST_LPM_ASSERT(status == 0);
TEST_LPM_ASSERT(lpm != NULL);
/* Loop with rte_lpm6_add. */
- for (depth = 1; depth <= 128; depth++) {
+ for (depth = 1; depth <= 16; depth++) {
/* Let the next_hop_add value = depth. Just for change. */
next_hop_add = depth;
}
/* Loop with rte_lpm6_delete. */
- for (depth = 128; depth >= 1; depth--) {
+ for (depth = 16; depth >= 1; depth--) {
next_hop_add = (uint8_t) (depth - 1);
status = rte_lpm6_delete(lpm, ip2, depth);
/*
* Add an extended rule (i.e. depth greater than 24, lookup (hit), delete,
- * lookup (miss) in a for loop of 1000 times. This will check tbl8 extension
+ * lookup (miss) in a for loop of 30 times. This will check tbl8 extension
* and contraction.
*/
int32_t
depth = 128;
next_hop_add = 100;
- for (i = 0; i < 1000; i++) {
+ for (i = 0; i < 30; i++) {
status = rte_lpm6_add(lpm, ip, depth, next_hop_add);
TEST_LPM_ASSERT(status == 0);
int status = -1, global_status = 0;
for (i = 0; i < NUM_LPM6_TESTS; i++) {
+ printf("# test %02d\n", i);
status = tests6[i]();
if (status < 0) {
__func__, lcore, iter, tref);
return;
}
- rte_delay_ms(1000);
+ rte_delay_ms(100);
}
rte_panic("(lcore=%u, iter=%u): after %us only "
#define N 65536
#define TIME_S 5
#define MEMPOOL_ELT_SIZE 2048
-#define MAX_KEEP 128
+#define MAX_KEEP 16
#define MEMPOOL_SIZE ((rte_lcore_count()*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1)
#define RET_ERR() do { \
unsigned int i;
void *obj = NULL;
uint64_t start_cycles, end_cycles;
- uint64_t duration = rte_get_timer_hz() * 8;
+ uint64_t duration = rte_get_timer_hz() / 4;
start_cycles = rte_get_timer_cycles();
while (1) {
unsigned int i;
void * obj;
uint64_t start_cycles, end_cycles;
- uint64_t duration = rte_get_timer_hz() * 5;
+ uint64_t duration = rte_get_timer_hz() / 8;
start_cycles = rte_get_timer_cycles();
while (1) {
static int
test_per_lcore_delay(__attribute__((unused)) void *arg)
{
- rte_delay_ms(5000);
- printf("wait 5000ms on lcore %u\n", rte_lcore_id());
+ rte_delay_ms(100);
+ printf("wait 100ms on lcore %u\n", rte_lcore_id());
return 0;
}
/* init the object table */
memset(obj_table, 0, sizeof(obj_table));
- end_time = rte_get_timer_cycles() + (hz * 2);
+ end_time = rte_get_timer_cycles() + (hz / 4);
/* check that bulk and watermark are 4 and 32 (respectively) */
while (diff >= 0) {
* watermark and quota */
rte_eal_remote_launch(check_live_watermark_change, NULL, lcore_id2);
- rte_delay_ms(1000);
+ rte_delay_ms(100);
rte_ring_set_water_mark(r, 32);
- rte_delay_ms(1000);
+ rte_delay_ms(100);
if (rte_eal_wait_lcore(lcore_id2) < 0)
return -1;
static rte_spinlock_t lk = RTE_SPINLOCK_INITIALIZER;
static uint64_t lock_count[RTE_MAX_LCORE] = {0};
-#define TIME_S 5
+#define TIME_MS 100
static int
load_loop_fn(void *func_param)
while (rte_atomic32_read(&synchro) == 0);
begin = rte_get_timer_cycles();
- while (time_diff / hz < TIME_S) {
+ while (time_diff < hz * TIME_MS / 1000) {
if (use_lock)
rte_spinlock_lock(&lk);
lcount++;
RTE_LCORE_FOREACH_SLAVE(i) {
rte_spinlock_unlock(&sl_tab[i]);
- rte_delay_ms(100);
+ rte_delay_ms(10);
}
rte_eal_mp_wait_lcore();
#include <rte_random.h>
#include <rte_malloc.h>
-#define TEST_DURATION_S 20 /* in seconds */
+#define TEST_DURATION_S 1 /* in seconds */
#define NB_TIMER 4
#define RTE_LOGTYPE_TESTTIMER RTE_LOGTYPE_USER3
{
static struct rte_timer *timers;
int i, ret;
- uint64_t delay = rte_get_timer_hz() / 4;
+ uint64_t delay = rte_get_timer_hz() / 20;
unsigned lcore_id = rte_lcore_id();
unsigned master = rte_get_master_lcore();
int32_t my_collisions = 0;
rte_atomic32_add(&collisions, my_collisions);
/* wait long enough for timers to expire */
- rte_delay_ms(500);
+ rte_delay_ms(100);
/* all cores rendezvous */
if (lcore_id == master) {
}
/* wait long enough for timers to expire */
- rte_delay_ms(500);
+ rte_delay_ms(100);
/* now check that we get the right number of callbacks */
if (lcore_id == master) {
/* launch all timers on core 0 */
if (lcore_id == rte_get_master_lcore()) {
- mytimer_reset(&mytiminfo[0], hz, SINGLE, lcore_id,
+ mytimer_reset(&mytiminfo[0], hz/4, SINGLE, lcore_id,
timer_basic_cb);
- mytimer_reset(&mytiminfo[1], hz*2, SINGLE, lcore_id,
+ mytimer_reset(&mytiminfo[1], hz/2, SINGLE, lcore_id,
timer_basic_cb);
- mytimer_reset(&mytiminfo[2], hz, PERIODICAL, lcore_id,
+ mytimer_reset(&mytiminfo[2], hz/4, PERIODICAL, lcore_id,
timer_basic_cb);
- mytimer_reset(&mytiminfo[3], hz, PERIODICAL,
+ mytimer_reset(&mytiminfo[3], hz/4, PERIODICAL,
rte_get_next_lcore(lcore_id, 0, 1),
timer_basic_cb);
}
end_time = cur_time + (hz * TEST_DURATION_S);
/* start other cores */
- printf("Start timer stress tests (%d seconds)\n", TEST_DURATION_S);
+ printf("Start timer stress tests\n");
rte_eal_mp_remote_launch(timer_stress_main_loop, NULL, CALL_MASTER);
rte_eal_mp_wait_lcore();
end_time = cur_time + (hz * TEST_DURATION_S);
/* start other cores */
- printf("\nStart timer basic tests (%d seconds)\n", TEST_DURATION_S);
+ printf("\nStart timer basic tests\n");
rte_eal_mp_remote_launch(timer_basic_main_loop, NULL, CALL_MASTER);
rte_eal_mp_wait_lcore();