return 0;
}
+static void
+dummy_event_maintain(__rte_unused void *port, __rte_unused int op)
+{
+ RTE_EDEV_LOG_ERR(
+ "maintenance requested for unconfigured event device");
+}
+
static uint16_t
dummy_event_tx_adapter_enqueue(__rte_unused void *port,
__rte_unused struct rte_event ev[],
.enqueue_forward_burst = dummy_event_enqueue_burst,
.dequeue = dummy_event_dequeue,
.dequeue_burst = dummy_event_dequeue_burst,
+ .maintain = dummy_event_maintain,
.txa_enqueue = dummy_event_tx_adapter_enqueue,
.txa_enqueue_same_dest =
dummy_event_tx_adapter_enqueue_same_dest,
fp_op->enqueue_forward_burst = dev->enqueue_forward_burst;
fp_op->dequeue = dev->dequeue;
fp_op->dequeue_burst = dev->dequeue_burst;
+ fp_op->maintain = dev->maintain;
fp_op->txa_enqueue = dev->txa_enqueue;
fp_op->txa_enqueue_same_dest = dev->txa_enqueue_same_dest;
fp_op->ca_enqueue = dev->ca_enqueue;
* the content of this field is implementation dependent.
*/
+#define RTE_EVENT_DEV_CAP_REQUIRES_MAINT (1ULL << 10)
+/**< Event device requires calls to rte_event_maintain() during
+ * periods when neither rte_event_dequeue_burst() nor
+ * rte_event_enqueue_burst() are called on a port. This will allow the
+ * event device to perform internal processing, such as flushing
+ * buffered events, return credits to a global pool, or process
+ * signaling related to load balancing.
+ */
+
/* Event device priority levels */
#define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
/**< Highest priority expressed across eventdev subsystem
timeout_ticks);
}
+#define RTE_EVENT_DEV_MAINT_OP_FLUSH (1 << 0)
+/**< Force an immediately flush of any buffered events in the port,
+ * potentially at the cost of additional overhead.
+ *
+ * @see rte_event_maintain()
+ */
+
+/**
+ * Maintain an event device.
+ *
+ * This function is only relevant for event devices which have the
+ * @ref RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag set. Such devices
+ * require an application thread using a particular port to
+ * periodically call rte_event_maintain() on that port during periods
+ * which it is neither attempting to enqueue events to nor dequeue
+ * events from the port. rte_event_maintain() is a low-overhead
+ * function and should be called at a high rate (e.g., in the
+ * application's poll loop).
+ *
+ * No port may be left unmaintained.
+ *
+ * At the application thread's convenience, rte_event_maintain() may
+ * (but is not required to) be called even during periods when enqueue
+ * or dequeue functions are being called, at the cost of a slight
+ * increase in overhead.
+ *
+ * rte_event_maintain() may be called on event devices which haven't
+ * set @ref RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag, in which case it is
+ * a no-operation.
+ *
+ * @param dev_id
+ * The identifier of the device.
+ * @param port_id
+ * The identifier of the event port.
+ * @param op
+ * 0, or @ref RTE_EVENT_DEV_MAINT_OP_FLUSH.
+ * @return
+ * - 0 on success.
+ * - -EINVAL if *dev_id*, *port_id*, or *op* is invalid.
+ *
+ * @see RTE_EVENT_DEV_CAP_REQUIRES_MAINT
+ */
+__rte_experimental
+static inline int
+rte_event_maintain(uint8_t dev_id, uint8_t port_id, int op)
+{
+ const struct rte_event_fp_ops *fp_ops;
+ void *port;
+
+ fp_ops = &rte_event_fp_ops[dev_id];
+ port = fp_ops->data[port_id];
+#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
+ if (dev_id >= RTE_EVENT_MAX_DEVS ||
+ port_id >= RTE_EVENT_MAX_PORTS_PER_DEV)
+ return -EINVAL;
+
+ if (port == NULL)
+ return -EINVAL;
+
+ if (op & (~RTE_EVENT_DEV_MAINT_OP_FLUSH))
+ return -EINVAL;
+#endif
+ rte_eventdev_trace_maintain(dev_id, port_id, op);
+
+ if (fp_ops->maintain != NULL)
+ fp_ops->maintain(port, op);
+
+ return 0;
+}
+
#ifdef __cplusplus
}
#endif
uint64_t timeout_ticks);
/**< @internal Dequeue burst of events from port of a device */
+typedef void (*event_maintain_t)(void *port, int op);
+/**< @internal Maintains a port */
+
typedef uint16_t (*event_tx_adapter_enqueue_t)(void *port,
struct rte_event ev[],
uint16_t nb_events);
/**< PMD dequeue function. */
event_dequeue_burst_t dequeue_burst;
/**< PMD dequeue burst function. */
+ event_maintain_t maintain;
+ /**< PMD port maintenance function. */
event_tx_adapter_enqueue_t txa_enqueue;
/**< PMD Tx adapter enqueue function. */
event_tx_adapter_enqueue_t txa_enqueue_same_dest;
rte_trace_point_emit_ptr(enq_mode_cb);
)
+RTE_TRACE_POINT_FP(
+ rte_eventdev_trace_maintain,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, int op),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u8(port_id);
+ rte_trace_point_emit_int(op);
+)
+
RTE_TRACE_POINT_FP(
rte_eventdev_trace_eth_tx_adapter_enqueue,
RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table,