From: Juha-Matti Tilli <[email protected]> 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 <[email protected]> --- /** 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: f1449d2555fbfa3d72aeb79d3ad6d2f199e83731 ** Merge commit sha: dfd19c141174b2de7b89e7b95ab23b19139afb13 **/ 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 e63814555..fd0cec3cf 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;
