From patchwork Mon Jul 31 13: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: 109024 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp190952qge; Mon, 31 Jul 2017 06:00:38 -0700 (PDT) X-Received: by 10.200.47.152 with SMTP id l24mr22621457qta.222.1501506038516; Mon, 31 Jul 2017 06:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501506038; cv=none; d=google.com; s=arc-20160816; b=yUJ2j6bjiE69dc+jrVoZV494TWe3tibTrcVcdNu3a3NKyn11w7xTtpEl3QVkPhTDf5 MOPKAxpgVC2v66bqqQDW351GYXa1jL0YIPnf6fG0ZwTet4IZOfks1PCQal2U7qNvu4Ax fv990ZDP5Om8nEEFzE/tp3vsF01N+c+0FZMJMHdLPnyv5qGXt0T4Vu9FlOpErRqhtW59 M64kRH6r+RU4xZ/sVi2EGZy6G908lr81zCPz7YqG0qvpcELxbacmbO2LAVk08uNUQu/w EPNZQUt546j4i+Uk98jOD/mg8PIZPKiCtg+dSMpzN1qp4jKwKbRvaIZUcnhSeRS45IDh YbHw== 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=oIMru84ykftcF+z5AvgPwdc4tXtCsKH5PVNRT140d6Y=; b=0Lk4TQg1h3Decb7rWKXCbUKrnCWlrg3HYGu26Uu+c5vL6Ti30oqjUGO3cn6h7OSzFW +MwN1F8/WmypDGfbbyYBBEecUUDac7LEvaHYuIY4gP1yrjVRy6E64MLMaAgODmRPNLPN dFEoU1au8TsCoXtotU8c4OgIY8hG+kAGAyuAEtZJt8rZnLDYPFkLVjiIZ2POzsFW7F93 s9oAOTZyIFiodgrj70coQtBlWLOsYqQF8o67UefYDarDEBaKPZc3hDeafEgh0oBM6OY2 WJKmyATfroetar/1/tR/6VPBbIBZXTrOGYJESio/XMDpOABNFraXSsf+lBF1xb+ZhNp0 zxuw== 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 o14si21795112qke.86.2017.07.31.06.00.37; Mon, 31 Jul 2017 06:00:38 -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 75F8F64495; Mon, 31 Jul 2017 13:00:37 +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 B93FB62D0A; Mon, 31 Jul 2017 13:00:31 +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 4BAA462D0A; Mon, 31 Jul 2017 13:00:21 +0000 (UTC) Received: from forward1m.cmail.yandex.net (forward1m.cmail.yandex.net [5.255.216.2]) by lists.linaro.org (Postfix) with ESMTPS id 0B00F62CD6 for ; Mon, 31 Jul 2017 13:00:20 +0000 (UTC) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::28]) by forward1m.cmail.yandex.net (Yandex) with ESMTP id 9623820D50 for ; Mon, 31 Jul 2017 16:00:18 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id 67EBF6C0112A for ; Mon, 31 Jul 2017 16:00:17 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lh14K6cxxM-0Gri1hXO; Mon, 31 Jul 2017 16:00:17 +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: Mon, 31 Jul 2017 16:00:04 +0300 Message-Id: <1501506009-28910-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501506009-28910-1-git-send-email-odpbot@yandex.ru> References: <1501506009-28910-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 94 Subject: [lng-odp] [PATCH API-NEXT v1 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: bab24526ba91a4499aff896c5e82d4ac3f03fea9 **/ 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..c3b2a76e 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 compare is packet data length minus the offset. Packet is + * not modified. + * + * @param pkt Packet handle + * @param offset Byte offset into the packet + * @param c Value to set + * @param len Number of bytes to compare + */ +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. + * + * @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_data(odp_packet_t pkt, uint32_t offset, + const void *data, uint32_t len); + /* * * Meta-data