On Fri, Nov 6, 2015 at 6:33 AM, Petri Savolainen <[email protected]
> wrote:

> Added odp_pktio_recv_queue for direct packet receive from pktio input
> hash queues.
>
> Signed-off-by: Petri Savolainen <[email protected]>
> ---
>  include/odp/api/packet_io.h | 36 +++++++++++++++++++++++++++++++-----
>  1 file changed, 31 insertions(+), 5 deletions(-)
>
> diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
> index bb0e67c..1723d61 100644
> --- a/include/odp/api/packet_io.h
> +++ b/include/odp/api/packet_io.h
> @@ -298,16 +298,42 @@ 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 interface input queue defined by
> the
> + * queue index. The operation is lock-free if 'lock_free' input queue
> parameter
> + * has been set. Application must not share a lock-free input queue
> between
> + * multiple threads.
> + *
> + * @param      pktio      Packet IO handle
> + * @param      queue_id   The input queue index from which to receive
> packets.
> + *                        The index must be between 0 and number of input
> queues
> + *                        minus one.
>

Calling this parameter queue_index or queue_ndx would be clearer than
queue_id given that a "queue id" could be misinterpreted as a queue 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
> + *
> + * @see odp_pktio_input_queues()
>   */
> -int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
> +int odp_pktio_recv_queue(odp_pktio_t pktio, unsigned queue_id,
> +                        odp_packet_t packets[], int num);
>
>  /**
>   * Send packets
> --
> 2.6.2
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to