Matias Elo(matiaselo) replied on github web page:

platform/linux-generic/odp_packet_io.c
line 22
@@ -1577,10 +1577,27 @@ int odp_pktin_recv_tmo(odp_pktin_queue_t queue, 
odp_packet_t packets[], int num,
        odp_time_t t1, t2;
        struct timespec ts;
        int started = 0;
+       pktio_entry_t *entry;
 
        ts.tv_sec  = 0;
        ts.tv_nsec = SLEEP_NSEC;
 
+       entry = get_pktio_entry(queue.pktio);
+       if (entry == NULL) {
+               ODP_DBG("pktio entry %d does not exist\n", queue.pktio);
+               return -1;
+       }
+
+       if (entry->s.ops->recv_tmo) {
+               uint64_t usecs = (wait * SLEEP_NSEC + 999) / 1000;
+
+               if (wait == ODP_PKTIN_WAIT)
+                       usecs = ODP_PKTIN_WAIT;
+
+               return entry->s.ops->recv_tmo(entry, queue.index, packets, num,
+                                             usecs);


Comment:
You should pass the `wait` parameter to `entry->s.ops->recv_tmo()` and not do 
any conversions here.

> Matias Elo(matiaselo) wrote:
> ODP_TIME_SEC_IN_NS would work here.


https://github.com/Linaro/odp/pull/341#discussion_r157214445
updated_at 2017-12-15 14:36:08

Reply via email to