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 341 (jmtilli:genuinesleep)
 ** https://github.com/Linaro/odp/pull/341
 ** Patch: https://github.com/Linaro/odp/pull/341.patch
 ** Base sha: 4f2ebb270c30a46c97355da84587a2220281798c
 ** Merge commit sha: fd0704cb6f80fd4a1741d66fb5d1a2e85b79d7dc
 **/
 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;

Reply via email to