From patchwork Wed Oct 18 14:00:18 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: 116305 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp2416223edb; Wed, 18 Oct 2017 07:10:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QamfQgyfcQ+c2QsZcdmZT0Vbaqs9H3E07LJE+L8qy3C7unTeniCAnG3e5kWRuLCgjpems3 X-Received: by 10.36.53.15 with SMTP id k15mr4207951ita.75.1508335832798; Wed, 18 Oct 2017 07:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508335832; cv=none; d=google.com; s=arc-20160816; b=aYeLyMsiCVdCwP8LGJirSL4A/gyjDLKhcXQUkn+yc7uM5BduuhYF0xPhxBcXc8aYpm GoH8MTY7l3m+B/sAjU7CpNARxGHCU/gZuKQjg/zNkM22Ih61StdL6Mfr23pYjD8K9y2n lI+GRm/8x1BoC5XvzHeQ1M8CL8qiVSuIw2ehtGeawxsHIISx7SsN4wjRlqY5UrzQFZis ZjSC+FG0in0uj/Qg/Ydsb3YJvYX1em43YdCybag1bTZRs9He372td2hqhLO2bI+fMRM1 RwFjTTuBEeNBvNwRl4VMf0BlxRtubx1i0Yc4agTNad9CrdzMZVL7itiBMv2ABzdTRO09 3oWQ== 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=XJFHJPf8Oy/mY4G4UwKRcL25wZU3Os/Rf5Ly8qv2ItE=; b=XPvi0j19J6Yzq9lRwPzFHV+IarxQzBABQF80/ZRqVxfCg9Qg3oP6kBoRoeYZclMiuK dBk1Q37BscoeylxomfMH5nxJbBDM8bLHacycL5kgINeJ+tgzV8rNMPTOvmal8tx5jnGP CSe34LyIhsfOHRU0TIADiePRm45l3TnnlSg9kkEoDJTUn87uc/GlsSRUIDtN2sbvmSQs UZZZzF0lji7Tzasbzz94hkh/9gFRbiqRFnuHIgs8LVJBcc1TwYhmWXqpyBQYck5PdVB+ r6y2xNRCLiSnpAF6aSVihBVmf5FlkjVRmwBZBysGtMwjcKMOszEWrH90njvSxSw3EwVo +KLQ== 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 d24si8483694ioc.21.2017.10.18.07.10.32; Wed, 18 Oct 2017 07:10:32 -0700 (PDT) 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 E91CC62ABC; Wed, 18 Oct 2017 14:10:31 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 5218E62967; Wed, 18 Oct 2017 14:01:27 +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 682A6628DB; Wed, 18 Oct 2017 14:00:48 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id CC06D622EA for ; Wed, 18 Oct 2017 14:00:45 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 26781431A2 for ; Wed, 18 Oct 2017 17:00:44 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5WWgPYssKq-0iiCf1xB; Wed, 18 Oct 2017 17:00:44 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ELMppi1EYu-0hjuVIDR; Wed, 18 Oct 2017 17:00:43 +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: Wed, 18 Oct 2017 17:00:18 +0300 Message-Id: <1508335223-15608-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508335223-15608-1-git-send-email-odpbot@yandex.ru> References: <1508335223-15608-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v20 5/10] Revert "linux-gen: drop unused _odp_packet_cmp_data() function" 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 This reverts commit fdc44dd4322f624c2a5d8c0be5306f7c45364520. _odp_packet_cmp_data() function is now used by IPsec implementation. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 81 (lumag:ipsec-packet-impl-2) ** https://github.com/Linaro/odp/pull/81 ** Patch: https://github.com/Linaro/odp/pull/81.patch ** Base sha: edca8cd1e55898826f79383b689c2c4bd2c28b3a ** Merge commit sha: 750318196a0c07a634c4755e4da9131a9f11f6f1 **/ .../linux-generic/include/odp_packet_internal.h | 3 +++ platform/linux-generic/odp_packet.c | 26 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 37a51feda..051b2b205 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -326,6 +326,9 @@ int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); int _odp_packet_set_data(odp_packet_t pkt, uint32_t offset, uint8_t c, uint32_t len); +int _odp_packet_cmp_data(odp_packet_t pkt, uint32_t offset, + const void *s, uint32_t len); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 0f6e1b79d..fc3882d3b 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1639,6 +1639,32 @@ int _odp_packet_set_data(odp_packet_t pkt, uint32_t offset, return 0; } +int _odp_packet_cmp_data(odp_packet_t pkt, uint32_t offset, + const void *s, uint32_t len) +{ + const uint8_t *ptr = s; + void *mapaddr; + uint32_t seglen = 0; /* GCC */ + uint32_t cmplen; + int ret; + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + + ODP_ASSERT(offset + len <= pkt_hdr->frame_len); + + while (len > 0) { + mapaddr = packet_map(pkt_hdr, offset, &seglen, NULL); + cmplen = len > seglen ? seglen : len; + ret = memcmp(mapaddr, ptr, cmplen); + if (ret != 0) + return ret; + offset += cmplen; + len -= cmplen; + ptr += cmplen; + } + + return 0; +} + /* * * Debugging