diff mbox

[API-NEXT,v4,1/9] api: packet_io: clarify what happens when not all packets are sent

Message ID 1435770379-30000-2-git-send-email-zoltan.kiss@linaro.org
State New
Headers show

Commit Message

Zoltan Kiss July 1, 2015, 5:06 p.m. UTC
Clarify that the user owns all events not sent/enqueued successfully.
Currently our examples are not handling this situation as well.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
v4:
- improve commit message
- move changes into the body of the description

 include/odp/api/packet_io.h |  5 +++++
 include/odp/api/queue.h     | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 89356a6..afa66e0 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -107,6 +107,11 @@  int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
 /**
  * Send packets
  *
+ * Sends out a number of packets. A successful call returns the actual number of
+ * packets sent. If return value is less than 'len', the remaining packets at
+ * the end of pkt_table[] are not consumed, and the caller has to take care of
+ * them.
+ *
  * @param pktio        ODP packet IO handle
  * @param pkt_table[]  Array of packets to send
  * @param len          length of pkt_table[]
diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index 6a8b15f..c98adba 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -238,17 +238,25 @@  void *odp_queue_get_context(odp_queue_t queue);
 /**
  * Queue enqueue
  *
+ * Enqueue the 'ev' on 'queue'. On failure the event is not consumed, the caller
+ * has to take care of it.
+ *
  * @param queue   Queue handle
  * @param ev      Event handle
  *
  * @retval 0 on success
- * @retval <0 on failure (e.g. queue full)
+ * @retval <0 on failure
  */
 int odp_queue_enq(odp_queue_t queue, odp_event_t ev);
 
 /**
  * Enqueue multiple events to a queue
  *
+ * Enqueue the events from 'events[]' on 'queue'. A successful call returns the
+ * actual number of events enqueued. If return value is less than 'num', the
+ * remaining eventss at the end of events[] are not consumed, and the caller
+ * has to take care of them.
+ *
  * @param queue   Queue handle
  * @param[in] events Array of event handles
  * @param num     Number of event handles to enqueue