aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha-Matti Tilli <juha-matti.tilli@iki.fi>2017-12-22 18:06:42 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-01-17 19:00:39 +0300
commit1bb6291e4e9050d476fefb02f11024898847e2b7 (patch)
tree2913278b0bf68f0c1d6aaea1d89a9b7f47964698
parent5e064cd9fa626b8fe7cc6d695b5bbf5065e0e54e (diff)
downloadodp-master.tar.gz
example: l2fwd_simple: test interruptible sleep in odp_pktin_recv_tmoHEADmaster
Test interruptible sleep within odp_pktin_recv_tmo by using the l2fwd_simple test application. This gives us confidence that odp_pktin_recv_tmo changes work with pktio mechanisms such as .pcap not offering the interrupt-driven implementations. Signed-off-by: Juha-Matti Tilli <juha-matti.tilli@iki.fi> Reviewed-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--example/l2fwd_simple/odp_l2fwd_simple.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/example/l2fwd_simple/odp_l2fwd_simple.c b/example/l2fwd_simple/odp_l2fwd_simple.c
index 2592c37..ad86617 100644
--- a/example/l2fwd_simple/odp_l2fwd_simple.c
+++ b/example/l2fwd_simple/odp_l2fwd_simple.c
@@ -88,6 +88,7 @@ static int run_worker(void *arg ODP_UNUSED)
odp_packet_t pkt_tbl[MAX_PKT_BURST];
int pkts, sent, tx_drops, i;
int total_pkts = 0;
+ uint64_t wait_time = odp_pktin_wait_time(ODP_TIME_SEC_IN_NS);
if (odp_pktio_start(global.if0)) {
printf("unable to start input interface\n");
@@ -103,7 +104,7 @@ static int run_worker(void *arg ODP_UNUSED)
while (!exit_thr) {
pkts = odp_pktin_recv_tmo(global.if0in, pkt_tbl, MAX_PKT_BURST,
- ODP_PKTIN_NO_WAIT);
+ wait_time);
if (odp_unlikely(pkts <= 0))
continue;