X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eventdev%2Frte_eventdev.h;h=20e7293e08579b85a30c6b293693f3a5ce153ea7;hb=7236d2bfe0acc48330e3c2a3dfac4ada9a792cd8;hp=5ce2f33fecd237903f48df7c87bead02ccc8529c;hpb=3ed7fc039ae86a6c3f6d15654719a293316a9db5;p=dpdk.git diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 5ce2f33fec..20e7293e08 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -245,6 +245,7 @@ extern "C" { #include #include +#include struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */ @@ -756,7 +757,8 @@ rte_event_port_count(uint8_t dev_id); * Event device identifier * @return * - 0: Success, device started. - * - <0: Error code of the driver device start function. + * - -ESTALE : Not all ports of the device are configured + * - -ENOLINK: Not all queues are linked, which could lead to deadlock. */ int rte_event_dev_start(uint8_t dev_id); @@ -903,9 +905,9 @@ rte_event_dev_close(uint8_t dev_id); * The generic *rte_event* structure to hold the event attributes * for dequeue and enqueue operation */ +RTE_STD_C11 struct rte_event { /** WORD0 */ - RTE_STD_C11 union { uint64_t event; /** Event attributes for dequeue or enqueue operation */ @@ -965,7 +967,6 @@ struct rte_event { }; }; /** WORD1 */ - RTE_STD_C11 union { uint64_t u64; /**< Opaque 64-bit value */ @@ -1119,9 +1120,15 @@ rte_event_schedule(uint8_t dev_id) * The number of event objects actually enqueued on the event device. The * return value can be less than the value of the *nb_events* parameter when * the event devices queue is full or if invalid parameters are specified in a - * *rte_event*. If return value is less than *nb_events*, the remaining events - * at the end of ev[] are not consumed,and the caller has to take care of them - * + * *rte_event*. If the return value is less than *nb_events*, the remaining + * events at the end of ev[] are not consumed and the caller has to take care + * of them, and rte_errno is set accordingly. Possible errno values include: + * - -EINVAL The port ID is invalid, device ID is invalid, an event's queue + * ID is invalid, or an event's sched type doesn't match the + * capabilities of the destination queue. + * - -ENOSPC The event port was backpressured and unable to enqueue + * one or more events. This error code is only applicable to + * closed systems. * @see rte_event_port_enqueue_depth() */ static inline uint16_t @@ -1130,6 +1137,18 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, { struct rte_eventdev *dev = &rte_eventdevs[dev_id]; +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG + if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) { + rte_errno = -EINVAL; + return 0; + } + + if (port_id >= dev->data->nb_ports) { + rte_errno = -EINVAL; + return 0; + } +#endif + /* * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one @@ -1240,6 +1259,18 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], { struct rte_eventdev *dev = &rte_eventdevs[dev_id]; +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG + if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) { + rte_errno = -EINVAL; + return 0; + } + + if (port_id >= dev->data->nb_ports) { + rte_errno = -EINVAL; + return 0; + } +#endif + /* * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one