typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
uint8_t queue_id);
+/**
+ * Get an event queue attribute at runtime.
+ *
+ * @param dev
+ * Event device pointer
+ * @param queue_id
+ * Event queue index
+ * @param attr_id
+ * Event queue attribute id
+ * @param[out] attr_value
+ * Event queue attribute value
+ *
+ * @return
+ * - 0: Success.
+ * - <0: Error code on failure.
+ */
+typedef int (*eventdev_queue_attr_get_t)(struct rte_eventdev *dev,
+ uint8_t queue_id, uint32_t attr_id,
+ uint32_t *attr_value);
+
/**
* Set an event queue attribute at runtime.
*
/**< Set up an event queue. */
eventdev_queue_release_t queue_release;
/**< Release an event queue. */
+ eventdev_queue_attr_get_t queue_attr_get;
+ /**< Get an event queue attribute. */
eventdev_queue_attr_set_t queue_attr_set;
/**< Set an event queue attribute. */
*attr_value = conf->schedule_type;
break;
+ case RTE_EVENT_QUEUE_ATTR_WEIGHT:
+ *attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST;
+ if (dev->dev_ops->queue_attr_get)
+ return (*dev->dev_ops->queue_attr_get)(
+ dev, queue_id, attr_id, attr_value);
+ break;
+ case RTE_EVENT_QUEUE_ATTR_AFFINITY:
+ *attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST;
+ if (dev->dev_ops->queue_attr_get)
+ return (*dev->dev_ops->queue_attr_get)(
+ dev, queue_id, attr_id, attr_value);
+ break;
default:
return -EINVAL;
};
/* Event device capability bitmap flags */
#define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
-/**< Event scheduling prioritization is based on the priority associated with
- * each event queue.
+/**< Event scheduling prioritization is based on the priority and weight
+ * associated with each event queue. Events from a queue with highest priority
+ * is scheduled first. If the queues are of same priority, weight of the queues
+ * are considered to select a queue in a weighted round robin fashion.
+ * Subsequent dequeue calls from an event port could see events from the same
+ * event queue, if the queue is configured with an affinity count. Affinity
+ * count is the number of subsequent dequeue calls, in which an event port
+ * should use the same event queue if the queue is non-empty
*
* @see rte_event_queue_setup(), rte_event_queue_attr_set()
*/
* @see rte_event_port_link()
*/
+/* Event queue scheduling weights */
+#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST 255
+/**< Highest weight of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+#define RTE_EVENT_QUEUE_WEIGHT_LOWEST 0
+/**< Lowest weight of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+
+/* Event queue scheduling affinity */
+#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST 255
+/**< Highest scheduling affinity of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+#define RTE_EVENT_QUEUE_AFFINITY_LOWEST 0
+/**< Lowest scheduling affinity of an event queue
+ * @see rte_event_queue_attr_get(), rte_event_queue_attr_set()
+ */
+
/**
* Get the total number of event devices that have been successfully
* initialised.
* The schedule type of the queue.
*/
#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
+/**
+ * The weight of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
+/**
+ * Affinity of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
/**
* Get an attribute from a queue.