aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantosh Shukla <santosh.shukla@linaro.org>2014-08-04 11:07:19 +0530
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-08-06 23:48:06 +0400
commit189d60606246e99dd746c53f4dfaf1289cab20c7 (patch)
tree9138898f53ac28814ac7d2436975c487b2f78fa8
parent3a00de5701c80e0feedb3664ec572cb7ac86fb9e (diff)
test_api:timer: allow send thd to spwan first
currently rx_thread spawn first and at times leads to tmo search failure for first ping request thats because send thread not yet pushed tmo entry into ticklist. Making send_tx thread spawn first avoid rx_ping tmo failure for initial ping request. also includes one misc fix, this returning from rx ping thread even if current tmo search failed, allow other ping request to process. Signed-off-by: Santosh Shukla <santosh.shukla@linaro.org>
-rw-r--r--test/api_test/odp_timer_ping.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c
index 88650d6..c1cc255 100644
--- a/test/api_test/odp_timer_ping.c
+++ b/test/api_test/odp_timer_ping.c
@@ -94,7 +94,8 @@ static int listen_to_pingack(void)
sd = socket(PF_INET, SOCK_RAW, proto->p_proto);
if (sd < 0) {
ODP_ERR("Listener socket open failed\n");
- return -1;
+ err = -1;
+ goto err;
}
for (i = 0; i < PING_CNT; i++) {
@@ -125,8 +126,11 @@ static int listen_to_pingack(void)
if (odp_timer_cancel_tmo(test_timer_ping,
test_ping_tmo) != 0) {
ODP_ERR("cancel_tmo failed ..exiting listner thread\n");
+ /* avoid exiting from here even if tmo
+ * failed for current ping,
+ * allow subsequent ping_rx request */
err = -1;
- goto err;
+
}
/* cruel bad hack used for sender, listner ipc..
* euwww.. FIXME ..
@@ -362,9 +366,9 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
void *(*run_thread) (void *);
if (i == 0)
- run_thread = rx_ping;
- else
run_thread = send_ping;
+ else
+ run_thread = rx_ping;
/* Create and launch worker threads */
odp_linux_pthread_create(&thread_tbl[i], 1, i,