diff mbox

[RFC,2/2] api: queue: add queue group creation

Message ID 1461587516-22980-2-git-send-email-bala.manoharan@linaro.org
State New
Headers show

Commit Message

Balasubramanian Manoharan April 25, 2016, 12:31 p.m. UTC
Adds queue group creation parameter

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
---
 include/odp/api/spec/queue.h | 81 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
diff mbox

Patch

diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 51d94a2..7dde060 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -158,6 +158,87 @@  typedef struct odp_queue_param_t {
 odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param);
 
 /**
+ * Queue group hash protocols
+ * The list of protocol header fields, which are included in queue
+ * distribution within a queue group.
+ */
+typedef union odp_queue_group_hash_proto_t {
+	/** Protocol header fields for queue group hashing */
+	struct {
+		/** TCP or UDP source port number*/
+		uint32_t tcp_udp_src_port : 1;
+		/** TCP or UDP destination port numbers */
+		uint32_t tcp_udp_dst_port : 1;
+		/** IPv4 or IPv6 source addresses */
+		uint32_t ip_src_addr : 1;
+		/** IPv4 or IPv6 destination address */
+		uint32_t ip_dst_addr : 1;
+	} bit;
+
+	/** All bits of the bit field structure */
+	uint32_t all_bits;
+} odp_queue_group_hash_proto_t;
+
+/**
+ * Queue group capability
+ * This capability structure defines system Queue Group capability
+ */
+typedef struct odp_queue_group_capability_t {
+	/** Maximum number of queues supported per queue group */
+	unsigned max_queues;
+	/** A bit mask of one bit for each supported queue group
+	hash proto fields */
+	odp_queue_group_hash_proto_t supported;
+}
+
+/**
+ * ODP Queue Group parameters
+ * Queue group supports only schedule queues <TBD??>
+ */
+typedef struct odp_queue_group_param_t {
+	/** Number of queue to be created for this queue group
+	 * implementation may round up the value to nearest power of 2
+	 * and value should be less than the maximum number of queues
+	 * supported per queue group
+	 */
+	unsigned num_queue;
+
+	/** Protocol field selection for queue group distribution
+	 * Multiple fields can be selected in combination
+	 */
+	odp_queue_group_hash_proto_t hash;
+
+} odp_queue_group_param_t;
+
+/**
+ * Initialize queue group params
+ *
+ * Initialize an odp_queue_group_param_t to its default values for all fields.
+ *
+ * @param param   Address of the odp_queue_group_param_t to be initialized
+ */
+void odp_queue_group_param_init(odp_queue_group_param_t *param);
+
+/**
+ * Queue Group create
+ *
+ * Create a queue group according to the queue group parameters.
+ * The individual queues belonging to a queue group are created by the
+ * implementation and the distribution of packets into those queues are
+ * decided based on the odp_queue_group_hash_proto_t parameters.
+ * The individual queues within a queue group are both created and deleted
+ * by the implementation.
+ *
+ * @param name    Queue Group name
+ * @param param   Queue Group parameters.
+ *
+ * @return Queue group handle
+ * @retval ODP_QUEUE_GROUP_INVALID on failure
+ */
+odp_queue_group_t odp_queue_group_create(const char *name,
+					 const odp_queue_group_param_t *param);
+
+/**
  * Destroy ODP queue
  *
  * Destroys ODP queue. The queue must be empty and detached from other