From patchwork Tue Aug 1 02:00:04 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: 109078 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp912337qge; Mon, 31 Jul 2017 19:00:57 -0700 (PDT) X-Received: by 10.55.26.14 with SMTP id a14mr24877244qka.4.1501552857261; Mon, 31 Jul 2017 19:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501552857; cv=none; d=google.com; s=arc-20160816; b=GMULTSxHM1kDahBQZrBl/PgnyYSPtRQbj68RjkfnReYQ3kYCpBcXO1B4XpS7cvgYHD peAvcjZCYAgwQREu77EYrjZXXfkSN9fkbeGFY8exp/mIVVg4nZslM8P7kL2g0jbfYtx1 rIbHxOd+K+t71mdx56ob5QkE8dHf+yYqtAzIKvS1ts1h65R3SGj6Q8r+yxqn2c64itp2 RBJfY+4pT77lyzLC42KyWGheqm83RSGcFvpu0UOAXBcQ4OEbI+gzY3egosQJgtHl9Lmx jHR5z0TJ2WhrgYj6JKTkb8pkGATiq9HVDPxWNragTT9hg4r9E2wskODTNR0J0v1ZMIeO LAtw== 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=5AwjAiDuRe5Wd5XIOt3eOiFi6HYMGVeOzWkxKTjDWas=; b=lG1SUjqI0Ib+Hay8Gee8koKMhrVZ5P6Vf9JR9Dl5B5c3FRu4klcxdghXc5yVpbDsY6 vHLLV0isY3WxOUwgpAZccIPIbYJ0bZQb5PIxdcTUMWCuLNvdCdJjZbGkipcEC4iKN6sb NqrCNpnLa8CyyJrYpEQjj0/JvDXWiWM1kGN9YsQLOyBly2Qgqgxv/tCnY0RaKm2mG712 Rne2YQKtg5CWBSe/FHfkjQQCvcqiMuARVbxeDUIpOGhv8ALshffvolfnm6ST7kv2QKtl hSb81jvPTaEKJae3Xu402nIt7P96/q74QLLjM8xzB2PC5PjbuVLpnpNVd7hxoMnUETqd zIuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k188si24727407qkc.178.2017.07.31.19.00.56; Mon, 31 Jul 2017 19:00:57 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 DAD1965CFC; Tue, 1 Aug 2017 02:00:56 +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,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 DC4BE65C78; Tue, 1 Aug 2017 02:00:25 +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 B312B65C3D; Tue, 1 Aug 2017 02:00:22 +0000 (UTC) Received: from forward4h.cmail.yandex.net (forward4h.cmail.yandex.net [87.250.230.101]) by lists.linaro.org (Postfix) with ESMTPS id A453B644D9 for ; Tue, 1 Aug 2017 02:00:21 +0000 (UTC) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::25]) by forward4h.cmail.yandex.net (Yandex) with ESMTP id 29A9B208FF for ; Tue, 1 Aug 2017 05:00:20 +0300 (MSK) Received: from smtp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1o.mail.yandex.net (Yandex) with ESMTP id 034101300AB6 for ; Tue, 1 Aug 2017 05:00:19 +0300 (MSK) Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cw80aqSarU-0ItigJbr; Tue, 01 Aug 2017 05:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 1 Aug 2017 05:00:04 +0300 Message-Id: <1501552809-14585-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501552809-14585-1-git-send-email-odpbot@yandex.ru> References: <1501552809-14585-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 94 Subject: [lng-odp] [PATCH API-NEXT v3 1/6] api: packet: add packet memset and memcmp-like functions 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: Dmitry Eremin-Solenikov Currently we have such functions in internal namespace for in-ODP use only. Exporting them as a part of public API would allow using them from tests and user applications. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 94 (lumag:crypto-long-keys) ** https://github.com/Linaro/odp/pull/94 ** Patch: https://github.com/Linaro/odp/pull/94.patch ** Base sha: c16f1363303cd5fc11324acbc4dfebe0a9680a41 ** Merge commit sha: 97de0c6543391f0a758ac472f48e0b407ad1d800 **/ 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 95f5349b..d37468ff 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1135,6 +1135,39 @@ int odp_packet_copy_data(odp_packet_t pkt, uint32_t dst_offset, int odp_packet_move_data(odp_packet_t pkt, uint32_t dst_offset, uint32_t src_offset, uint32_t len); +/** + * Set packet data to specific value + * + * Set 'len' bytes of packet data to value 'c' starting from 'offset'. Maximum + * number of bytes to copy is packet data length minus the offset. Packet is + * not modified on an error. + * + * @param pkt Packet handle + * @param offset Byte offset into the packet + * @param c Value to set + * @param len Number of bytes to set + */ +int odp_packet_set_data(odp_packet_t pkt, uint32_t offset, + uint8_t c, uint32_t len); + +/** + * Compare data with packet + * + * Compare 'len' bytes of data from the source address with the packet + * contentes starting from offset. Maximum number of bytes to compare is packet + * data length minus the offset. Packet is not modified on an error. + * + * @param pkt Packet handle + * @param offset Byte offset into the packet + * @param data Data address + * @param len Number of bytes to compare + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_packet_cmp_mem(odp_packet_t pkt, uint32_t offset, + const void *data, uint32_t len); + /* * * Meta-data