Add API to perform self test on the underlying event device driver.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
return -ENOTSUP;
}
+int rte_event_dev_selftest(uint8_t dev_id)
+{
+ RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+ struct rte_eventdev *dev = &rte_eventdevs[dev_id];
+
+ if (dev->dev_ops->dev_selftest != NULL)
+ return (*dev->dev_ops->dev_selftest)();
+ return -ENOTSUP;
+}
+
int
rte_event_dev_start(uint8_t dev_id)
{
const uint32_t ids[],
uint32_t nb_ids);
+/**
+ * Trigger the eventdev self test.
+ *
+ * @param dev_id
+ * The identifier of the device
+ * @return
+ * - 0: Selftest successful
+ * - -ENOTSUP if the device doesn't support selftest
+ * - other values < 0 on failure.
+ */
+int rte_event_dev_selftest(uint8_t dev_id);
+
#ifdef __cplusplus
}
#endif
typedef int (*eventdev_eth_rx_adapter_stats_reset)
(const struct rte_eventdev *dev,
const struct rte_eth_dev *eth_dev);
+/**
+ * Start eventdev selftest.
+ *
+ * @return
+ * Return 0 on success.
+ */
+typedef int (*eventdev_selftest)(void);
/** Event device operations function pointer table */
struct rte_eventdev_ops {
/**< Get ethernet Rx stats */
eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset;
/**< Reset ethernet Rx stats */
+
+ eventdev_selftest dev_selftest;
+ /**< Start eventdev Selftest */
};
/**
rte_event_eth_rx_adapter_stop;
} DPDK_17.08;
+
+DPDK_18.02 {
+ global:
+
+ rte_event_dev_selftest;
+} DPDK_17.11;