>From PR discission https://github.com/Linaro/odp/pull/341:

There is some reason to clean up odp_pktin_wait_time() api.

1.
There is suggestion to add queue to odp_pktin_wait_time() function.
I.e.:
uint64_t odp_pktin_wait_time(uint64_t nsec, odp_pktin_queue_t  queue);

Idea is that queue handler can be used to get access to pktio and his pktio
driver.
Driver can do transformation from nanosecond to some values which is more
suitable and return
this driver or adjust the queue. So return value can be different for
different drivers and we can
speed up code here.

2.
Second idea is to completely remove wait parameter from
odp_pktin_recv_tmo() and queue handler to odp_pktin_wait_time() as
describer before. If we assume that one thread calls odp_pktin_recv_tmo()
and more likely with the same predefined timeout. Then there is no sense in
always passing it to odp_pktin_recv_tmo().

/**
 * Packet input wait time
 *
 * Converts nanoseconds to wait time values for packet input functions.
 *
 * @param nsec   Minimum number of nanoseconds to wait
 *
 * @return Wait parameter value for packet input functions
 */
uint64_t odp_pktin_wait_time(uint64_t nsec);


 * @param      wait       Wait time specified as as follows:
 *                        * ODP_PKTIN_NO_WAIT: Do not wait
 *                        * ODP_PKTIN_WAIT:    Wait infinitely
 *                        * Other values specify the minimum time to wait.
 *                          Use odp_pktin_wait_time() to convert nanoseconds
 *                          to a valid parameter value. Wait time may be
 *                          rounded up a small, platform specific amount.

int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
                       int num, uint64_t wait);


best regards,
Maxim.

Reply via email to