From patchwork Wed Jul 1 17:06:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 50530 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5CBBB214B3 for ; Wed, 1 Jul 2015 17:07:08 +0000 (UTC) Received: by lbbpo10 with SMTP id po10sf7077888lbb.1 for ; Wed, 01 Jul 2015 10:07:07 -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:cc: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=2xuJ2eGnnPUpWG8XH4tu1uSXaFy1kev2tXYxCyjbFp0=; b=LjJTJfCVLuQ+FhZwhYvaJBffYKLHJdI19lNPCY9XLbiAOSMofawv/F38ZXJchByrMG diF2uEEfoS2PyjfOckMp5lgIzCdDt41kw66OYsRwchJKGRgvxQHDKasIEkGpHG0sQ/Lb 5ReFY9hP6YkeWygOknWEQrIxWq9KWo27BBptOsDt7Xla2Bvq1DSSW2rqcexZpfNhDJXH shavWiYvlEwWTRNkXYH5teJKWePV6Q8wq4955OC/X0VwdfJoUE49JXI4Vjm67+o6ON/h FffOvY+DFLJ9r8SFqMX7kt8iYqMvSC8646C6axnBlKnk+kbKg4z/qH3ZMMrhlOFG6b7C KMbg== X-Gm-Message-State: ALoCoQnY/T8L/KapqDYOzq4I22/6Mb5rgjpg3IYmlOqc1z161KIcjRBCJna8HmqnPoaB5isymy0R X-Received: by 10.152.6.103 with SMTP id z7mr17658947laz.8.1435770427341; Wed, 01 Jul 2015 10:07:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.199 with SMTP id m7ls228255lam.83.gmail; Wed, 01 Jul 2015 10:07:07 -0700 (PDT) X-Received: by 10.152.7.206 with SMTP id l14mr26215446laa.3.1435770427183; Wed, 01 Jul 2015 10:07:07 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id kl13si2230478lbb.9.2015.07.01.10.07.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jul 2015 10:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laar3 with SMTP id r3so45102195laa.0 for ; Wed, 01 Jul 2015 10:07:07 -0700 (PDT) X-Received: by 10.152.36.102 with SMTP id p6mr26334404laj.19.1435770427080; Wed, 01 Jul 2015 10:07:07 -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 hn6csp741868lbb; Wed, 1 Jul 2015 10:07:06 -0700 (PDT) X-Received: by 10.55.18.27 with SMTP id c27mr57730706qkh.84.1435770425581; Wed, 01 Jul 2015 10:07:05 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n78si2996928qgn.13.2015.07.01.10.07.04; Wed, 01 Jul 2015 10:07:05 -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 9988B61F41; Wed, 1 Jul 2015 17:07:04 +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 632B161F4A; Wed, 1 Jul 2015 17:06:40 +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 D803561F3C; Wed, 1 Jul 2015 17:06:36 +0000 (UTC) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id ADEE661F3C for ; Wed, 1 Jul 2015 17:06:35 +0000 (UTC) Received: by wguu7 with SMTP id u7so42308272wgu.3 for ; Wed, 01 Jul 2015 10:06:35 -0700 (PDT) X-Received: by 10.194.192.33 with SMTP id hd1mr52096344wjc.96.1435770394889; Wed, 01 Jul 2015 10:06:34 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id fi6sm4335895wib.6.2015.07.01.10.06.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jul 2015 10:06:34 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 1 Jul 2015 18:06:11 +0100 Message-Id: <1435770379-30000-2-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435770379-30000-1-git-send-email-zoltan.kiss@linaro.org> References: <1435770379-30000-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Cc: Petri Savolainen Subject: [lng-odp] [API-NEXT PATCH v4 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.215.46 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 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 --- 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 --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