diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2015-11-26 10:35:22 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-02-08 20:45:22 +0300 |
commit | d5e95d8e988239576dfd450a03e74bb48cb4b3fc (patch) | |
tree | 846b04b5f2f3f3f15df841ae6a1cbd74c45590d3 /include/odp/api/packet_io.h | |
parent | 358e4c5956f1bfcb957a1613ab091789218e7131 (diff) |
api: pktio: added direct queue receive
Added odp_pktio_recv_queue for direct packet receive from pktio
input queues.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/packet_io.h')
-rw-r--r-- | include/odp/api/packet_io.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 26c9be5b2..bf9b1f92d 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -346,16 +346,39 @@ int odp_pktio_close(odp_pktio_t pktio); odp_pktio_t odp_pktio_lookup(const char *dev); /** - * Receive packets + * Receive packets directly from an interface * - * @param pktio Packet IO handle - * @param pkt_table[] Storage for received packets (filled by function) - * @param len Length of pkt_table[], i.e. max number of pkts to receive + * Receives up to 'num' packets from the interface. The operation is + * multi-thread safe. + * + * @param pktio Packet IO handle + * @param[out] packets[] Packet handle array for output of received packets + * @param num Maximum number of packets to receive + * + * @return Number of packets received + * @retval <0 on failure + */ +int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t packets[], int num); + +/** + * Receive packets directly from an interface input queue + * + * Receives up to 'num' packets from the pktio interface input queue. When + * 'single_user' input queue parameter has been set, the operation is optimized + * for single thread per queue usage model and the same queue must not be + * accessed from multiple threads. + * + * @param queue Pktio input queue handle for receiving packets + * @param[out] packets[] Packet handle array for output of received packets + * @param num Maximum number of packets to receive * * @return Number of packets received * @retval <0 on failure + * + * @see odp_pktio_pktin_queues() */ -int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len); +int odp_pktio_recv_queue(odp_pktin_queue_t queue, odp_packet_t packets[], + int num); /** * Send packets |