Matias Elo(matiaselo) replied on github web page:

platform/linux-generic/odp_packet_io.c
line 104
@@ -1626,6 +1683,68 @@ int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t 
queues[], unsigned num_q,
        odp_time_t t1, t2;
        struct timespec ts;
        int started = 0;
+       pktio_entry_t *entry[num_q];
+       int index[num_q];
+       fd_set readfds;
+       int maxfd = -1;
+       uint64_t usecs = (wait * SLEEP_NSEC + 999) / 1000;
+       int (*impl)(int num_q, pktio_entry_t *entry[], int index[],
+                   odp_packet_t packets[], int num, unsigned *from,
+                   uint64_t wait_usecs) = NULL;
+       int impl_set = 0;
+
+       if (wait == ODP_PKTIN_WAIT)
+               usecs = ODP_PKTIN_WAIT;
+
+       for (i = 0; i < num_q; i++) {
+               entry[i] = get_pktio_entry(queues[i].pktio);
+               index[i] = queues[i].index;
+               if (entry[i] == NULL) {
+                       ODP_DBG("pktio entry %d does not exist\n",
+                               queues[i].pktio);
+                       return -1;
+               }
+               if (!impl_set) {
+                       impl = entry[i]->s.ops->recv_mq_tmo;
+                       impl_set = 1;
+               } else {
+                       if (impl != entry[i]->s.ops->recv_mq_tmo) {


Comment:
As I noted in the previous comment, I think this check isn't enough. The input 
queues would have to be from the same pktio device for this to work.

> Matias Elo(matiaselo) wrote:
> Internal functions should not use odp_ prefix.


>> Matias Elo(matiaselo) wrote:
>> 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_r157217090
updated_at 2017-12-15 14:47:45

Reply via email to