From patchwork Wed Jan 10 22:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124138 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5795314qgn; Wed, 10 Jan 2018 14:00:35 -0800 (PST) X-Google-Smtp-Source: ACJfBotmSxHgZpUMGcHllPYaUr8lHo7PPyvCXxvTCv3glVqDOXahQ5JySW3Ejxohzlfj4FzH0KL1 X-Received: by 10.55.24.138 with SMTP id 10mr28559701qky.358.1515621635501; Wed, 10 Jan 2018 14:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515621635; cv=none; d=google.com; s=arc-20160816; b=Xa3wQq7/aeMNKn7yfnBbZ4QqAF7xbw+Y+wbYWf3YMOQj2FKuREfWqcKw1bMvxrFP61 izpnUMRi/LBZ9YA1otc1brTL28BP/cQxInRTviikN/P2YeLUImQr1qFLIDp9U9S+dbQr +m71oWy+DaOB3o6vgvw6VzsgE1bKOWbdp8ibZhPBzHtKtyBeFtNe9k+z/AwPNWp4yczK 1Wl7NnXPPmtR4+VqjQKvZbeHaKaOlHZGBQlPLPZ3gWx83b4fveqP+4HKy0DNHPdI9Dn5 aGQJi16NXz6j0QyiC+SY0VTCkfqO0uJOWbXrIqZroRLkxHZ6xaQDm57uv7DaV/fnLujT GIVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=9ApIdIixysZWPrClSAQF8ZbGpBe82QcjJN9VAAu9NDA=; b=0Z5VniJY/s4RjcWtR3CYshJKXzW+v+clsmJ4AZuN9x2URSub8JMkso78VLO9ZAfi7S zLPvZcyuZ2QOa5XAQ1UuOIAer2xbzRSM/KzRfUH5iX1saaLKYpNVecGVH6gT8fBNADBQ /kqn+vg6sirdQ8lC7TGVG433gkmysYfvs+Yqt8UI8Fo3W034AdvNnRWBmqL161LR3fZm g6/8I8K8CjdKpanLZQTkWtIgxr7GwocwHWbgQV/NpZc9jtaMRcR9tS+tfHjAmAvQFRBk 8hFgklYCqQQwgFE5mAOSZ2aSNkU3A5HrvVjah/MmguxsUD5Di8HVSrwopaNqHLnWDisi Fg5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id y9si4402921qtf.353.2018.01.10.14.00.34; Wed, 10 Jan 2018 14:00:35 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id BEF9E61732; Wed, 10 Jan 2018 22:00:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 00D2A609AA; Wed, 10 Jan 2018 22:00:27 +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 E47596173D; Wed, 10 Jan 2018 22:00:21 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id DF1926171B for ; Wed, 10 Jan 2018 22:00:12 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 74E67784445 for ; Thu, 11 Jan 2018 01:00:11 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id fFqKvuN8aa-0Bme1oSL; Thu, 11 Jan 2018 01:00:11 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Cc5P1IMcaP-0A7CqUTE; Thu, 11 Jan 2018 01:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 11 Jan 2018 01:00:09 +0300 Message-Id: <1515621609-30260-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515621609-30260-1-git-send-email-odpbot@yandex.ru> References: <1515621609-30260-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 387 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api: pktio: clarify timeout and stop interaction X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer Clarify how odp_pktin_recv_tmo() and odp_pktin_recv_mq_tmo() interact with odp_pktio_stop(). In particular, specify that a stop operation will terminate indefinite receive waits. Signed-off-by: Bill Fischofer --- /** Email created from pull request 387 (Bill-Fischofer-Linaro:pktio-docs) ** https://github.com/Linaro/odp/pull/387 ** Patch: https://github.com/Linaro/odp/pull/387.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: d8dd4af8532a27b78d83c145c288045b47b2dab1 **/ include/odp/api/spec/packet_io.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index bf30877f5..8fa5bf5bf 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -813,14 +813,17 @@ int odp_pktio_start(odp_pktio_t pktio); * received from the network may be still available from interface and * application can receive those normally. New packets may not be accepted for * transmit. Packets already stored for transmit are not freed. A following - * odp_packet_start() call restarts packet receive and transmit. + * odp_packet_start() call restarts packet receive and transmit. Any active + * odp_pktin_recv_tmo() or odp_pktin_recv_mq_tmo() calls for this interface + * are terminated by this call. * * @param pktio Packet IO handle * * @retval 0 on success * @retval <0 on failure * - * @see odp_pktio_start(), odp_pktio_close() + * @see odp_pktio_start(), odp_pktio_close(), odp_pktin_recv_tmo(), + * odp_pktin_recv_mq_tmo() */ int odp_pktio_stop(odp_pktio_t pktio); @@ -884,14 +887,19 @@ int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int num); * @param num Maximum number of packets to receive * @param wait Wait time specified as as follows: * * ODP_PKTIN_NO_WAIT: Do not wait - * * ODP_PKTIN_WAIT: Wait infinitely + * * ODP_PKTIN_WAIT: Wait indefinitely. Returns + * 0 if interface is stopped during the wait. * * Other values specify the minimum time to wait. * Use odp_pktin_wait_time() to convert nanoseconds * to a valid parameter value. Wait time may be * rounded up a small, platform specific amount. + * Timeout value may be expired early if the + * interface is stopped during the timed wait. * * @return Number of packets received * @retval <0 on failure + * + * @see odp_pktio_stop() */ int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], int num, uint64_t wait); @@ -923,14 +931,19 @@ int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], * @param num Maximum number of packets to receive * @param wait Wait time specified as as follows: * * ODP_PKTIN_NO_WAIT: Do not wait - * * ODP_PKTIN_WAIT: Wait infinitely + * * ODP_PKTIN_WAIT: Wait indefinitely. Returns + * 0 if interface is stopped during the wait. * * Other values specify the minimum time to wait. * Use odp_pktin_wait_time() to convert nanoseconds * to a valid parameter value. Wait time may be * rounded up a small, platform specific amount. + * Timeout value may be expired early if the + * interface is stopped during the timed wait. * * @return Number of packets received * @retval <0 on failure + * + * @see odp_pktio_stop() */ int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t queues[], unsigned num_q, unsigned *from, odp_packet_t packets[], int num,