eventdev: add API to perform self test
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>
This commit is contained in:
parent
5afc521eac
commit
a1501cd138
@ -1086,6 +1086,16 @@ int rte_event_dev_xstats_reset(uint8_t dev_id,
|
||||
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)
|
||||
{
|
||||
|
@ -1810,6 +1810,18 @@ rte_event_dev_xstats_reset(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
|
||||
|
@ -577,6 +577,13 @@ typedef int (*eventdev_eth_rx_adapter_stats_get)
|
||||
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 {
|
||||
@ -632,6 +639,9 @@ 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 */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -68,3 +68,9 @@ DPDK_17.11 {
|
||||
rte_event_eth_rx_adapter_stop;
|
||||
|
||||
} DPDK_17.08;
|
||||
|
||||
DPDK_18.02 {
|
||||
global:
|
||||
|
||||
rte_event_dev_selftest;
|
||||
} DPDK_17.11;
|
||||
|
Loading…
Reference in New Issue
Block a user