Added output queue configuration parameters and functions for setting up multiple output queues. Added also odp_pktio_output_queues to query the number of queues.
Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com> --- include/odp/api/packet_io.h | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 1723d61..aa218f2 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -123,6 +123,22 @@ typedef struct odp_pktio_input_queue_param_t { } odp_pktio_input_queue_param_t; /** + * Packet output queue parameters + * + * These parameters are used only in ODP_PKTOUT_MODE_SEND mode. + */ +typedef struct odp_pktio_output_queue_param_t { + /** Enable lock-free send operation per queue + * 0: Send is multi-thread safe, 1: Send is lock-free */ + odp_bool_t lock_free; + + /** Number of output queues to be created. The value must be between + * 1 and interface capability */ + unsigned num_queues; + +} odp_pktio_output_queue_param_t; + +/** * Packet IO parameters * * In minimum, user must select input and output modes. Use 0 for defaults. @@ -216,6 +232,25 @@ int odp_pktio_input_queues_config(odp_pktio_t pktio, const odp_pktio_input_queue_param_t *param); /** + * Configure packet output queues + * + * Setup a number of packet output queues and configure those. The maximum + * number of queues is platform dependent and can be queried with + * odp_pktio_capability(). All requested queues are setup on success, no + * queues are setup on failure. + * + * @param pktio Packet IO handle + * @param param Packet output queue configuration parameters + * + * @retval 0 on success + * @retval <0 on failure + * + * @see odp_pktio_capability(), odp_pktio_output_queues() + */ +int odp_pktio_output_queues_config(odp_pktio_t pktio, + const odp_pktio_output_queue_param_t *param); + +/** * Packet input queues * * Returns the number of input queues configured for the interface. Outputs also @@ -237,6 +272,19 @@ int odp_pktio_input_queues_config(odp_pktio_t pktio, int odp_pktio_input_queues(odp_pktio_t pktio, odp_queue_t queues[], int num); /** + * Packet output queues + * + * Returns the number of output queues configured for the interface. These + * output queues are used only in ODP_PKTOUT_MODE_SEND mode. + * + * @param pktio Packet IO handle + * + * @return Number of packet output queues + * @retval <0 on failure + */ +int odp_pktio_output_queues(odp_pktio_t pktio); + +/** * Start packet receive and transmit * * Activate packet receive and transmit on a previously opened or stopped @@ -525,6 +573,15 @@ void odp_pktio_param_init(odp_pktio_param_t *param); void odp_pktio_input_queue_param_init(odp_pktio_input_queue_param_t *param); /** + * Initialize packet output queue parameters + * + * Initialize an odp_pktio_output_queue_param_t to its default values. + * + * @param param Output queue parameter structure to be initialized + */ +void odp_pktio_output_queue_param_init(odp_pktio_output_queue_param_t *param); + +/** * Print pktio info to the console * * Print implementation-defined pktio debug information to the console. -- 2.6.2 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp