From patchwork Fri Dec 1 15:00:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120341 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1254112qgn; Fri, 1 Dec 2017 07:06:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMbi5P8AiCSpENJzIILmlEMzY3ZQvRtF63uqGL3NWBGzYCBidxC3Ywln+t+FyIskB/cDwlN5 X-Received: by 10.200.38.74 with SMTP id v10mr9153059qtv.316.1512140767197; Fri, 01 Dec 2017 07:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512140767; cv=none; d=google.com; s=arc-20160816; b=kt7akONHVMYKDh+RD830w31hJqW2grEEoqtDu7Hur7kObvSN2XnYyXJ2laO4THQXCs 6dX4/b0ZDHynYpQgx8PgqetaXz4CwcKFUB/XGGyMUNdsP5swk02AW3+PGbZ84PaYAqGQ T+ytJFioWZKl30aVn2f8vPW41aE7p09GfzxLUkINDW7ENWRzf2TN6ZraDVRWMYuVllPV lrUsn/6jzO+szVjcFPPeV53MujevU1oGNRPN/Ot1E1hKvMvl3PQKjVdQAog5cP2V6wEt Ll/tDkyfm0rBTOaGJc6+6ep/lnewITPkWHHG2vt9x78SBWyPKsSRjBTpkpS1lQtQDGbg PiGA== 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=9YTfA3OfKzEKwdM900R+FFCfMF5SCw2J2/4R1gi9ugk=; b=R+CkYEHRwQnEbDbGCiJfN8cKEA65N4sY6x/86QHJDRxQJ/zvhjxK2pFtzARYuFLgDd ZzcAuf7M66lpe++OHTzbUWJ84x/zytMr7v7A4jNW57oEpBFVHOLkw86AMnSI+t1Gpzfn 3z0xG/+7NjbVnP+iA8EwbpAKq4GQpxrSW5oX+VuvVs55FAYFFOr6P75Hmc01uW3UUZky UnswOBhxF5HqC6AxpZCwv2NhXmEHYKLweMfGbAgw7+k8kAOcshhdJ5GX/R0xN0UhzusS kQPOeH3/eNxcCbBX8qggOsWk+MJeTz/VWXKWGVFzw2uqYuRpaz5PC/X0eT93N8k/Ia7K B86Q== 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 i23si3613372qti.155.2017.12.01.07.06.06; Fri, 01 Dec 2017 07:06:07 -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 A82446098D; Fri, 1 Dec 2017 15:06:06 +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,URIBL_BLOCKED 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 2AC72609B0; Fri, 1 Dec 2017 15:01:00 +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 E956860973; Fri, 1 Dec 2017 15:00:25 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 4D66B60750 for ; Fri, 1 Dec 2017 15:00:20 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward102p.mail.yandex.net (Yandex) with ESMTP id D1A8E4305B35 for ; Fri, 1 Dec 2017 18:00:18 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TnkoLFTfeD-0IC0XC3p; Fri, 01 Dec 2017 18:00:18 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I6qrBsStkX-0IemiEns; Fri, 01 Dec 2017 18:00:18 +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: Fri, 1 Dec 2017 18:00:02 +0300 Message-Id: <1512140407-13534-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512140407-13534-1-git-send-email-odpbot@yandex.ru> References: <1512140407-13534-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 318 Subject: [lng-odp] [PATCH API-NEXT v1 7/12] api: event: event type multi 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: Petri Savolainen This functions allows application to check event type of multiple events with single call e.g. after receiving those from odp_schedule_multi(). Performance is optimized when application can pass a burst of packets (or other events) from one API call to another. Signed-off-by: Petri Savolainen --- /** Email created from pull request 318 (psavol:next-multi-apis) ** https://github.com/Linaro/odp/pull/318 ** Patch: https://github.com/Linaro/odp/pull/318.patch ** Base sha: bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0 ** Merge commit sha: aee2bcc574d2a8efdfcecc3b8e681ce391119798 **/ include/odp/api/spec/event.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index 7e895c315..e5edaacc9 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -125,6 +125,22 @@ odp_event_subtype_t odp_event_subtype(odp_event_t event); odp_event_type_t odp_event_types(odp_event_t event, odp_event_subtype_t *subtype); +/** + * Event type of multiple events + * + * Returns the number of first events in the array which have the same event + * type. Outputs the event type of those events. + * + * @param event Array of event handles + * @param num Number of events (> 0) + * @param[out] type Event type pointer for output + * + * @return Number of first events (1 ... num) with the same event type + * (includes event[0]) + */ +int odp_event_type_multi(const odp_event_t event[], int num, + odp_event_type_t *type); + /** * Get printable value for an odp_event_t *