From patchwork Fri Dec 1 14:59:59 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: 120338 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1249987qgn; Fri, 1 Dec 2017 07:03:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMaq276uMgULnTWSZ26e8tQZq+Pe3Jw2Ht938ws+BqXJM+09vE6UzUQ+xnl7T/av8O4JEous X-Received: by 10.200.18.9 with SMTP id x9mr9060630qti.211.1512140605960; Fri, 01 Dec 2017 07:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512140605; cv=none; d=google.com; s=arc-20160816; b=RvrphhCKpqD68q9sXK/TlzosVg0PKb7yHYJgEdVTnsfQICt2KR2ggBI74crWqhcC6q s91hQLfv1tC6dcsl5KzbrQczUMznj+2hkCtuWpckoHgoB/XkO9sX+qJLIlynEtIsk/CJ Eg6vG9znSa1a9Qi7acIlkfE42oKH3rDtZiQpTw0p7zRozg6pwMKxf/ZXHzUDoj8mnaE1 ZtoXqMZ0pDnhnLTBXmy6MT32JCtg2B10sJFQiQHT1ckj/kXODrMYi6JLjt+MToDMVc8U 6M9zN3S04rOA48uT1JWZITiKKAv/bZj0Y1qAAAkZiZiIO4Q0sNp2imM+aEsP4jh8984t xlcQ== 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=Qi1wSvmD9HtH3tRn5RF/tSpLRgDLX2ZvRssHcr3VKXg=; b=PCjYdDRzncAscjQQB9l5j3w22zGJ590UNY1pJ9U3nuqbN0BzLU7B7yYrZbUhpCxKlb KLERudIaNxJ7Tn0mNCKOXOsNoKCzEECqRXIZnS5q4EeNy1lduYY9mPYcCKYqSny0yo8L Bm1ySQTNo+kbYXtvlU3ep5I3rJZm2C3kWN0br/Z14lxYW+4jidshBotiCASULw0i5air PfraLO5fbuqHt9pQcVcC4Nc17EyXibTcf5aiGIhXOkbgX7KVDgzJ+IcVmA8reJ7w3HCj 2qrlRXoxvpLJiAqkIHpWC7dzsl9kMSnaxdn5RfmaizXZFZpynRVLe7txvdKuW8EsZYai AvFg== 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 b10si6815388qtg.386.2017.12.01.07.03.24; Fri, 01 Dec 2017 07:03:25 -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 AB45960991; Fri, 1 Dec 2017 15:03:24 +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 D40BF60977; Fri, 1 Dec 2017 15:00:43 +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 BBD916096D; Fri, 1 Dec 2017 15:00:21 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 60E606096D for ; Fri, 1 Dec 2017 15:00:18 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward104j.mail.yandex.net (Yandex) with ESMTP id F38F245908 for ; Fri, 1 Dec 2017 18:00:16 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id oyY14pG4vO-0Gkepmt2; Fri, 01 Dec 2017 18:00:16 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I6qrBsStkX-0Ge8nItR; Fri, 01 Dec 2017 18:00:16 +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 17:59:59 +0300 Message-Id: <1512140407-13534-5-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 4/12] api: packet: multi converts and single pool free 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 Added multi versions for better throughput. Convert multiple packets/events with a single call. Free multiple packets into the same originating pool. 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/packet.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index b897c9d3c..619098868 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -204,6 +204,17 @@ void odp_packet_free(odp_packet_t pkt); */ void odp_packet_free_multi(const odp_packet_t pkt[], int num); +/** + * Free multiple packets to the same pool + * + * Otherwise like odp_packet_free_multi(), but all packets must be from the + * same originating pool. + * + * @param pkt Array of packet handles + * @param num Number of packets to free + */ +void odp_packet_free_sp(const odp_packet_t pkt[], int num); + /** * Reset packet * @@ -235,6 +246,18 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); */ odp_packet_t odp_packet_from_event(odp_event_t ev); +/** + * Convert multiple packet events to packet handles + * + * All events must be of type ODP_EVENT_PACKET. + * + * @param[out] pkt Packet handle array for output + * @param ev Array of event handles to convert + * @param num Number of packets and events + */ +void odp_packet_from_event_multi(odp_packet_t pkt[], const odp_event_t ev[], + int num); + /** * Convert packet handle to event * @@ -244,6 +267,16 @@ odp_packet_t odp_packet_from_event(odp_event_t ev); */ odp_event_t odp_packet_to_event(odp_packet_t pkt); +/** + * Convert multiple packet handles to events + * + * @param pkt Array of packet handles to convert + * @param[out] ev Event handle array for output + * @param num Number of packets and events + */ +void odp_packet_to_event_multi(const odp_packet_t pkt[], odp_event_t ev[], + int num); + /* * * Pointers and lengths