From patchwork Fri Dec 1 15:00:00 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: 120342 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1255023qgn; Fri, 1 Dec 2017 07:06:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMa3sGcQOMhr+xz4w9DTGQyJwffZXEsHUH4aXX8/ICBTaiGLkPudIvmt0I0jYDC9yDWzA8WQ X-Received: by 10.55.33.13 with SMTP id h13mr8302848qkh.176.1512140805151; Fri, 01 Dec 2017 07:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512140805; cv=none; d=google.com; s=arc-20160816; b=Runn04Z0zr7l1OkPvmVbvdd26u5I7HE0nwLO2XdzH6ZvlT2rPACPasDJ80/pTEy7fh mzag/4JnFQOP65OQOmqDmVTBcqYTgN/k+J0hKlGNhaL6ObnxwYoOcRIkkiKOz26EEdBr yeAmWTOOSNKVpg2ge646Wo6t0EaZVL1ktUl9/Ia89n5PgZMrasNuxSl0+zbuVDa8ExvQ Rd2O8Mr5RXfRk+3iuxzO8WctCoEUxhsEJPckHmHdsQ4uNldeuDo/Nq3GY94u8pQX6Ea7 E0tlD59ZzMcV6URgqHM5XMqtKvDghWa0baqsdQlsOTsUiJei2DBKVCbUSCSJ/tiEb/ro Aggw== 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=EGPZ3lToKnU976TNYD+xTws4tHoBhfHiZ5ZQLccHgPA=; b=G5OAQX6PGhLHvJPOjb2HlBxJvWNkLWMcFc4IFs77qxz/WrWJZW7CeYZkvKlMMQ5aDG TgDJIDHRDKDLlymWbUChmgNVIn5oFJSd38CIdp0LQJYcJa/UJ2QxdZ7cwXZGmMZbUOMv sInIUJItnMC190I+ZEMMq5BDfIc0AQS6sqgHqGKq8TGAspbHMsTSPlQKpM8LKfTSeNdn OOmYNQA7lw3AThE3+/HMercuE4dq7ipT+0Xy0ycwk/Ksjum0eJSz8GTlEJYBC7dCUCx9 FQtCASJXExFbmphWfPWNzet8Vu+64+vyXOxV0I9YV4jp98mGXL9QXLWd/Grj3uM/TgPb 7Ftw== 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 l75si4713961qke.56.2017.12.01.07.06.44; Fri, 01 Dec 2017 07:06:45 -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 BEBAB60982; Fri, 1 Dec 2017 15:06:44 +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 79346609C0; Fri, 1 Dec 2017 15:01:02 +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 B195060988; Fri, 1 Dec 2017 15:00:26 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 956A360970 for ; Fri, 1 Dec 2017 15:00:18 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 806E62A25ECE for ; Fri, 1 Dec 2017 18:00:17 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 55LQcmL7gI-0HLaX2ps; Fri, 01 Dec 2017 18:00:17 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I6qrBsStkX-0He8DH1g; Fri, 01 Dec 2017 18:00:17 +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:00 +0300 Message-Id: <1512140407-13534-6-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 5/12] linux-gen: 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 Simple implement of the new multi convert and single pool free functions. 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 **/ platform/linux-generic/odp_packet.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index bdcb482fa..cdcb62d21 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -912,6 +912,11 @@ void odp_packet_free_multi(const odp_packet_t pkt[], int num) packet_free_multi(buf_hdr, num - num_freed); } +void odp_packet_free_sp(const odp_packet_t pkt[], int num) +{ + odp_packet_free_multi(pkt, num); +} + int odp_packet_reset(odp_packet_t pkt, uint32_t len) { odp_packet_hdr_t *const pkt_hdr = packet_hdr(pkt); @@ -944,6 +949,24 @@ odp_event_t odp_packet_to_event(odp_packet_t pkt) return (odp_event_t)buffer_handle(packet_hdr(pkt)); } +void odp_packet_from_event_multi(odp_packet_t pkt[], const odp_event_t ev[], + int num) +{ + int i; + + for (i = 0; i < num; i++) + pkt[i] = odp_packet_from_event(ev[i]); +} + +void odp_packet_to_event_multi(const odp_packet_t pkt[], odp_event_t ev[], + int num) +{ + int i; + + for (i = 0; i < num; i++) + ev[i] = odp_packet_to_event(pkt[i]); +} + /* * * Pointers and lengths