aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/packet_io.h
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2015-11-26 10:35:23 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-02-08 20:45:22 +0300
commit152f03578b66f4d4eed3f8b037cb84b15678d911 (patch)
treec91aae2f6cd68796de2cac3c4cb4fc828417236f /include/odp/api/packet_io.h
parentd5e95d8e988239576dfd450a03e74bb48cb4b3fc (diff)
api: pktio: added multiple pktio output queues
Added output queue configuration parameters and functions for setting up multiple output queues. Added also a function to query the number of output 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.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index bf9b1f92d..916026168 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -48,6 +48,11 @@ extern "C" {
*/
/**
+ * @typedef odp_pktout_queue_t
+ * Direct packet output queue handle
+ */
+
+/**
* @def ODP_PKTIO_INVALID
* Invalid packet IO handle
*/
@@ -151,6 +156,24 @@ 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 {
+ /** Single thread per queue. Enable performance optimization when each
+ * queue has only single user.
+ * 0: Queue is multi-thread safe
+ * 1: Queue is used by single thread only */
+ odp_bool_t single_user;
+
+ /** 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.
@@ -244,6 +267,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_pktout_queues()
+ */
+int odp_pktio_output_queues_config(odp_pktio_t pktio,
+ const odp_pktio_output_queue_param_t *param);
+
+/**
* Queues for packet input
*
* Returns the number of input queues configured for the interface in
@@ -285,6 +327,26 @@ int odp_pktio_pktin_queues(odp_pktio_t pktio, odp_pktin_queue_t queues[],
int num);
/**
+ * Direct packet output queues
+ *
+ * Returns the number of output queues configured for the interface in
+ * ODP_PKTOUT_MODE_SEND mode. Outputs up to 'num' queue handles when the
+ * 'queues' array pointer is not NULL. If return value is larger than 'num',
+ * there are more queues than the function was allowed to output.
+ *
+ * Packets are sent to these queues with odp_pktio_send_queue().
+ *
+ * @param pktio Packet IO handle
+ * @param[out] queues Points to an array of queue handles for output
+ * @param num Maximum number of queue handles to output
+ *
+ * @return Number of packet output queues
+ * @retval <0 on failure
+ */
+int odp_pktio_pktout_queues(odp_pktio_t pktio, odp_pktout_queue_t queues[],
+ int num);
+
+/**
* Start packet receive and transmit
*
* Activate packet receive and transmit on a previously opened or stopped
@@ -570,6 +632,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.