From: Juha-Matti Tilli <juha-matti.ti...@iki.fi> Test interruptible sleep within odp_pktin_recv_tmo by usign 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.ti...@iki.fi> --- /** Email created from pull request 365 (jmtilli:nullpktio) ** https://github.com/Linaro/odp/pull/365 ** Patch: https://github.com/Linaro/odp/pull/365.patch ** Base sha: 49ebafae0edebbc750742d8874ad0a7588286dea ** Merge commit sha: 2f6dfd92f54d977d5b8dc08f5ee4699cd77b7757 **/ example/l2fwd_simple/odp_l2fwd_simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/l2fwd_simple/odp_l2fwd_simple.c b/example/l2fwd_simple/odp_l2fwd_simple.c index 2592c3744..ad8661717 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;