From patchwork Fri Jun 5 17:51:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 49583 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CBFF12154F for ; Fri, 5 Jun 2015 17:52:48 +0000 (UTC) Received: by wgv5 with SMTP id 5sf19089394wgv.0 for ; Fri, 05 Jun 2015 10:52:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=Vv9ZQQo0tEyW1ineHknNaoy4vFJtckw4PlIGN+xcKs4=; b=Sm7LkYgZb5j1AxV4i81uklrRYTseJX2WmUd/7F+ZIewubgEqM4V5zKpkCqXJoiKSOg QIeCZZ9bTI2wZDmMCJZIPHmg7swl4sR8r3Cr+DRJaCBQozxKYyD/iit5UUcBNB+pobI+ wPlfHAa49jePexUehHB7ri8NXHzdfKzmsFtFZbUPHCKI5CjYiLGhRBP7tbOIrsy6jMU4 HA8EEWVKyxfnihB8IVUm5rWmjSFxImfpoXYVyHiSh0vl/6qMtsDWrdV7rWvJHPdq2ju7 1/37c7Ggr6QCHq9vNfjBnlRI7xgXa5uCJ3cJTu9TqovhLGVwkdPperpTnlpMcEkClIb+ egQQ== X-Gm-Message-State: ALoCoQlheR75H545371pbCtNxhzmnYm7+j+yP1mCLO/m0LymvyA5bKpMaTKuzijRq+l74nz6a8QW X-Received: by 10.112.97.210 with SMTP id ec18mr4182262lbb.15.1433526768040; Fri, 05 Jun 2015 10:52:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.137 with SMTP id o9ls365902lal.16.gmail; Fri, 05 Jun 2015 10:52:47 -0700 (PDT) X-Received: by 10.152.87.33 with SMTP id u1mr4534125laz.35.1433526767765; Fri, 05 Jun 2015 10:52:47 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id u9si5390499lau.48.2015.06.05.10.52.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 10:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbqq2 with SMTP id qq2so50429196lbb.3 for ; Fri, 05 Jun 2015 10:52:47 -0700 (PDT) X-Received: by 10.112.97.194 with SMTP id ec2mr4464080lbb.88.1433526767575; Fri, 05 Jun 2015 10:52:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp44090lbb; Fri, 5 Jun 2015 10:52:46 -0700 (PDT) X-Received: by 10.140.231.80 with SMTP id b77mr5770869qhc.82.1433526765902; Fri, 05 Jun 2015 10:52:45 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u6si8112846qcz.49.2015.06.05.10.52.16; Fri, 05 Jun 2015 10:52:45 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id DDEF06212A; Fri, 5 Jun 2015 17:52:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id AD9186212D; Fri, 5 Jun 2015 17:51:54 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 28FFF6212B; Fri, 5 Jun 2015 17:51:51 +0000 (UTC) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by lists.linaro.org (Postfix) with ESMTPS id AEBC06211C for ; Fri, 5 Jun 2015 17:51:49 +0000 (UTC) Received: by wgez8 with SMTP id z8so62286289wge.0 for ; Fri, 05 Jun 2015 10:51:49 -0700 (PDT) X-Received: by 10.180.218.137 with SMTP id pg9mr19865501wic.79.1433526708965; Fri, 05 Jun 2015 10:51:48 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id bg4sm11582752wjc.10.2015.06.05.10.51.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 10:51:48 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 5 Jun 2015 18:51:23 +0100 Message-Id: <1433526691-20058-2-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433526691-20058-1-git-send-email-zoltan.kiss@linaro.org> References: <1433526691-20058-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 1/9] api: packet_io: clarify what happens when not all packets are sent X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoltan.kiss@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Currently our examples are not handling this situation as well. Signed-off-by: Zoltan Kiss --- 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);