diff mbox series

[API-NEXT,v1,1/2] api: pktio: extend odp_pktin_queue_param_t to support per queue configuration

Message ID 1533099606-17502-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/2] api: pktio: extend odp_pktin_queue_param_t to support per queue configuration | expand

Commit Message

Github ODP bot Aug. 1, 2018, 5 a.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Per queue configuration enables advanced usecases where input queues
of the same interface may belong to different scheduler groups or
have different multithread safe modes.

Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 660 (bogdanPricope:api_next_pktin_queue_pr)
 ** https://github.com/Linaro/odp/pull/660
 ** Patch: https://github.com/Linaro/odp/pull/660.patch
 ** Base sha: 9b2b5a9695ad66977c964c83691cd2fef4c45b85
 ** Merge commit sha: da35db9bd3845097376d2b1ba5459bd8a88f0199
 **/
 include/odp/api/spec/packet_io.h | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index a55c2678f..324b18edb 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -148,6 +148,22 @@  typedef enum odp_pktio_op_mode_t {
 
 } odp_pktio_op_mode_t;
 
+/**
+ * Packet input queue configuration mode
+ */
+typedef enum odp_pktin_queue_param_mode_t {
+	/** Single parameter set for all queues
+	  *
+	  *  Pktin queues share the same configuration.  */
+	ODP_PKTIN_QUEUE_PARAM_MODE_BASIC = 0,
+
+	/** Per queue parameter set
+	 *
+	 *  Each pktin queue is configured with an idependent set
+	 *  of parameters. */
+	ODP_PKTIN_QUEUE_PARAM_MODE_MULTI
+} odp_pktin_queue_param_mode_t;
+
 /**
  * Packet input queue parameters
  */
@@ -193,6 +209,12 @@  typedef struct odp_pktin_queue_param_t {
 	  * Queue type is defined by the input mode. The default value is 1. */
 	unsigned num_queues;
 
+	/** Queues configuration mode
+	  *
+	  * Input queues share the same configuration parameter set or
+	  * use a parameter set per queue. */
+	odp_pktin_queue_param_mode_t queue_param_mode;
+
 	/** Queue parameters
 	  *
 	  * These are used for input queue creation in ODP_PKTIN_MODE_QUEUE
@@ -201,7 +223,22 @@  typedef struct odp_pktin_queue_param_t {
 	  * odp_queue_param_t documentation.
 	  * When classifier is enabled in odp_pktin_queue_config() this
 	  * value is ignored. */
-	odp_queue_param_t queue_param;
+	union {
+		/** Single parameter set for all queues
+		 *
+		 * Coresponds to ODP_PKTIN_QUEUE_PARAM_MODE_BASIC
+		 * queue_param_mode.
+		 */
+		odp_queue_param_t queue_param;
+
+		/** Per queue parameter set
+		 *
+		 * Coresponds to ODP_PKTIN_QUEUE_PARAM_MODE_MULTI
+		 * queue_param_mode.
+		 * queue_params must point to an array with num_queues
+		 * elements. */
+		odp_queue_param_t *queue_params;
+	};
 
 } odp_pktin_queue_param_t;