diff mbox

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

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

Commit Message

Zoltan Kiss June 5, 2015, 11:53 a.m. UTC
Currently our examples are not handling this situation as well.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 include/odp/api/packet_io.h | 4 +++-
 include/odp/api/queue.h     | 7 +++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

Comments

Mike Holmes June 5, 2015, 4:27 p.m. UTC | #1
This touches the api "b/include/odp/api/packet_io.h" so  the subject should
add api: like this

"api: packet_io: clarify what happens when not all packets are sent"

Generally for ODP the approximate path to the code is in the subject
"include/odp/api/packet_io.h" becomes

include/odp/api   --> api:
then the module area or file name as appropriate - packet_io: in this case
as you have it.



On 5 June 2015 at 07:53, Zoltan Kiss <zoltan.kiss@linaro.org> wrote:

> Currently our examples are not handling this situation as well.
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
> ---
>  include/odp/api/packet_io.h | 4 +++-
>  include/odp/api/queue.h     | 7 +++++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
> index 89356a6..5a71e52 100644
> --- a/include/odp/api/packet_io.h
> +++ b/include/odp/api/packet_io.h
> @@ -111,7 +111,9 @@ int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t
> pkt_table[], int len);
>   * @param pkt_table[]  Array of packets to send
>   * @param len          length of pkt_table[]
>   *
> - * @return Number of packets sent
> + * @return Number of packets sent. If it is less than 'len', the remaining
> + * packets at the end of pkt_table[] are not consumed, and caller has to
> take
> + * care of them.
>   * @retval <0 on failure
>   */
>  int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
> diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
> index 6a8b15f..ac4147d 100644
> --- a/include/odp/api/queue.h
> +++ b/include/odp/api/queue.h
> @@ -242,7 +242,8 @@ void *odp_queue_get_context(odp_queue_t queue);
>   * @param ev      Event handle
>   *
>   * @retval 0 on success
> - * @retval <0 on failure (e.g. queue full)
> + * @retval <0 on failure (e.g. queue full), the event is not consumed,
> caller
> + * has to take care of it.
>   */
>  int odp_queue_enq(odp_queue_t queue, odp_event_t ev);
>
> @@ -253,7 +254,9 @@ int odp_queue_enq(odp_queue_t queue, odp_event_t ev);
>   * @param[in] events Array of event handles
>   * @param num     Number of event handles to enqueue
>   *
> - * @return Number of events actually enqueued (0 ... num)
> + * @return Number of events actually enqueued (0 ... num). If it is less
> than
> + * 'num', the remaining events at the end of events[] are not consumed,
> and
> + * caller has to take care of them.
>   * @retval <0 on failure
>   */
>  int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t events[],
> int num);
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Zoltan Kiss June 5, 2015, 5:52 p.m. UTC | #2
I've fixed that in a new series

On 05/06/15 17:27, Mike Holmes wrote:
> This touches the api "b/include/odp/api/packet_io.h" so  the subject
> should add api: like this
>
> "api: packet_io: clarify what happens when not all packets are sent"
>
> Generally for ODP the approximate path to the code is in the subject
> "include/odp/api/packet_io.h" becomes
>
> include/odp/api   --> api:
> then the module area or file name as appropriate - packet_io: in this
> case as you have it.
>
>
>
> On 5 June 2015 at 07:53, Zoltan Kiss <zoltan.kiss@linaro.org
> <mailto:zoltan.kiss@linaro.org>> wrote:
>
>     Currently our examples are not handling this situation as well.
>
>     Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org
>     <mailto:zoltan.kiss@linaro.org>>
>     ---
>       include/odp/api/packet_io.h | 4 +++-
>       include/odp/api/queue.h     | 7 +++++--
>       2 files changed, 8 insertions(+), 3 deletions(-)
>
>     diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
>     index 89356a6..5a71e52 100644
>     --- a/include/odp/api/packet_io.h
>     +++ b/include/odp/api/packet_io.h
>     @@ -111,7 +111,9 @@ int odp_pktio_recv(odp_pktio_t pktio,
>     odp_packet_t pkt_table[], int len);
>        * @param pkt_table[]  Array of packets to send
>        * @param len          length of pkt_table[]
>        *
>     - * @return Number of packets sent
>     + * @return Number of packets sent. If it is less than 'len', the
>     remaining
>     + * packets at the end of pkt_table[] are not consumed, and caller
>     has to take
>     + * care of them.
>        * @retval <0 on failure
>        */
>       int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[],
>     int len);
>     diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
>     index 6a8b15f..ac4147d 100644
>     --- a/include/odp/api/queue.h
>     +++ b/include/odp/api/queue.h
>     @@ -242,7 +242,8 @@ void *odp_queue_get_context(odp_queue_t queue);
>        * @param ev      Event handle
>        *
>        * @retval 0 on success
>     - * @retval <0 on failure (e.g. queue full)
>     + * @retval <0 on failure (e.g. queue full), the event is not
>     consumed, caller
>     + * has to take care of it.
>        */
>       int odp_queue_enq(odp_queue_t queue, odp_event_t ev);
>
>     @@ -253,7 +254,9 @@ int odp_queue_enq(odp_queue_t queue, odp_event_t
>     ev);
>        * @param[in] events Array of event handles
>        * @param num     Number of event handles to enqueue
>        *
>     - * @return Number of events actually enqueued (0 ... num)
>     + * @return Number of events actually enqueued (0 ... num). If it is
>     less than
>     + * 'num', the remaining events at the end of events[] are not
>     consumed, and
>     + * caller has to take care of them.
>        * @retval <0 on failure
>        */
>       int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t
>     events[], int num);
>     --
>     1.9.1
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs
>
> __
>
>
diff mbox

Patch

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 89356a6..5a71e52 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -111,7 +111,9 @@  int odp_pktio_recv(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
  * @param pkt_table[]  Array of packets to send
  * @param len          length of pkt_table[]
  *
- * @return Number of packets sent
+ * @return Number of packets sent. If it is less than 'len', the remaining
+ * packets at the end of pkt_table[] are not consumed, and caller has to take
+ * care of them.
  * @retval <0 on failure
  */
 int odp_pktio_send(odp_pktio_t pktio, odp_packet_t pkt_table[], int len);
diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index 6a8b15f..ac4147d 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -242,7 +242,8 @@  void *odp_queue_get_context(odp_queue_t queue);
  * @param ev      Event handle
  *
  * @retval 0 on success
- * @retval <0 on failure (e.g. queue full)
+ * @retval <0 on failure (e.g. queue full), the event is not consumed, caller
+ * has to take care of it.
  */
 int odp_queue_enq(odp_queue_t queue, odp_event_t ev);
 
@@ -253,7 +254,9 @@  int odp_queue_enq(odp_queue_t queue, odp_event_t ev);
  * @param[in] events Array of event handles
  * @param num     Number of event handles to enqueue
  *
- * @return Number of events actually enqueued (0 ... num)
+ * @return Number of events actually enqueued (0 ... num). If it is less than
+ * 'num', the remaining events at the end of events[] are not consumed, and
+ * caller has to take care of them.
  * @retval <0 on failure
  */
 int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t events[], int num);