From patchwork Mon Jul 31 22: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: 109057 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp707689qge; Mon, 31 Jul 2017 15:00:58 -0700 (PDT) X-Received: by 10.55.46.135 with SMTP id u129mr19743941qkh.39.1501538458647; Mon, 31 Jul 2017 15:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501538458; cv=none; d=google.com; s=arc-20160816; b=Xk5rBdWBjOr+D1n9+mJKXP2KPdPTvoJ7fFRezaCa3od79orjiG9frNQoAIhukHei2q K2dQY43YKJIqWCJ3sy4M+iz/+l3m0yOSgZAk4rJzqNtE5D56nlseL1sLH50na4eLI8Yt RrnQ8EdhTn9KS7pNa+4zc4VuKGeFs4DY9d15FJzgc1Hmm6cUpsTQGan17b1vjQPZW589 /mUpCR4/wRLKWREiNDDRl1oz7k9OXzcyDyKe4t/zFeEf9Hj2ShIpLh+lM1+Z4qXn+gnL TvFIPDEbi03kxYa+YBWDPiW9MS9pcVgsA0uxR1GjiaRymUCCa7dkB4hVcfLgYBWjLpH6 0DFA== 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=w54fFtL2zAT8jZzVLY6FWWKOweuVuJ27XduprP31XCc=; b=N+3zOreypYuEcTmDBzQYv0EylXIMowca534NgY+SdO2/OQHr/QlYzRHajqzXqsxn4T 9zZnZZDWpeWMOZ1+yO4sfWeoJQvd4w3Fc+1XpY7mHnz+KyWIT/7nzdhtSzzPZaR7Ol8R vGdltUf3k+atzINFkvBiqO7k1x/YI6AXsISLbONov2V5sovr8fo4vWYzqmIX2FuHSh/X G9hdHQlkRLFAuYxsqvKePQb4wLpziHFTHcWeomxATMLfM92lPLtJQyKAkjJzmjjqlM1d 5ESP/9Qwn+MpD/vG93qCpNOWzZ6XEZdlAmuA2J1jW5GpAom+eh/aJWhwa12a8SBg5Glc Wzgw== 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 f68si20687051qkj.390.2017.07.31.15.00.58; Mon, 31 Jul 2017 15:00:58 -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 359C860A4E; Mon, 31 Jul 2017 22:00:58 +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 1EE4960D35; Mon, 31 Jul 2017 22:00:23 +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 957FC607D4; Mon, 31 Jul 2017 22:00:20 +0000 (UTC) Received: from forward2m.cmail.yandex.net (forward2m.cmail.yandex.net [5.255.216.20]) by lists.linaro.org (Postfix) with ESMTPS id 0C17C607C6 for ; Mon, 31 Jul 2017 22:00:19 +0000 (UTC) Received: from smtp2m.mail.yandex.net (smtp2m.mail.yandex.net [IPv6:2a02:6b8:0:2519::122]) by forward2m.cmail.yandex.net (Yandex) with ESMTP id B325D20D38 for ; Tue, 1 Aug 2017 01:00:17 +0300 (MSK) Received: from smtp2m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2m.mail.yandex.net (Yandex) with ESMTP id 91DB2230091B for ; Tue, 1 Aug 2017 01:00:17 +0300 (MSK) Received: by smtp2m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id prEP5cProO-0GkupxlW; Tue, 01 Aug 2017 01:00:16 +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 01:00:04 +0300 Message-Id: <1501538409-20031-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501538409-20031-1-git-send-email-odpbot@yandex.ru> References: <1501538409-20031-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 94 Subject: [lng-odp] [PATCH API-NEXT v2 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: 590ab5bff952cbbc145c433c3f40a9189b29cc5b **/ 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