From patchwork Thu Sep 14 21: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: 112652 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp1043056edb; Thu, 14 Sep 2017 14:08:16 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB56BsENdEhMY9d3BeZKkGDwmljwwvlVUgfHCX8gV+zUQ8qCROQJ4IfPc6JlmyeOWUB29FG X-Received: by 10.36.160.75 with SMTP id o72mr2093218ite.5.1505423296627; Thu, 14 Sep 2017 14:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505423296; cv=none; d=google.com; s=arc-20160816; b=meH9diSmHf2QnNpBB6aumuIlmFzJaKH6Y2yLMg4sxp+OKAaKqjW8dO7z3zqNL9hzI5 +3eTgSfzfN2OIm7qHC+moMGSjV/JRQrkHdGOdWRW+ccTOuZf6MrKm0vHUYoVcmTss0U1 +9V3W7joxDh+ZoiV5dhYzQ8FC9bUUI+ryqViYkLKAWLK6It0AeZ9SlcC2C7GM570/e99 cb4aUDdo9EqZs/2Z3Ebii9OKaLSXPxIysA7BmtMedFPUyRgkZ1eQBu5ZfapSmMXqs6zm fI9oUUKxJ+PHgWC0vyra/PAy2ZmJKwdbcMdhjjuUQeVqg/mlgpVoEJBGi+1JnnmSKwir uR7g== 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=Va+ZvpXC3Lp8PWsnLLkNjZzoniam6QOBeW3FW+ayxvM=; b=SpzCkHjNeEwSIo1RJpgWbvgPsL/hBOiqzjwCwHk/kK8PQD7UqtfxFrFbpmapg1tyLT MMjH2YcNEHhjPbhdayLl0MkZVmYkFSQ84+cp3rB3ip9alH/4+B6/lk0CdVGv49mbQs7L w1648ky3e2u/rrt5zsiNqcOeQEoYjVWBUC/DcK1QNQCU2RSGw+Dv4bI20MvZDq8shZdD 2lgyBDuomrv441IIJ4C4E1CQSoE23oWb7V5aMoswNQBQniV6DQfVFPH+gIhV7wXJcQlk 6NdqohKeCRdW3/KcHHTASqeLFfsgdy/lJWNprG62koV9Ip8hOLJHz9RGITVHnCA0OmHb COWg== 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 g11si952145itf.188.2017.09.14.14.08.13; Thu, 14 Sep 2017 14:08:16 -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 60122609DA; Thu, 14 Sep 2017 21:08:13 +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,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 C393560B45; Thu, 14 Sep 2017 21:02:06 +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 9B2C360B49; Thu, 14 Sep 2017 21:02:03 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 695016094B for ; Thu, 14 Sep 2017 21:00:28 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 576E41805B3D for ; Fri, 15 Sep 2017 00:00:27 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id KXWtG1tSFg-0RPaH2iO; Fri, 15 Sep 2017 00:00:27 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wNwc7KZcGv-0RmmBdMV; Fri, 15 Sep 2017 00:00:27 +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, 15 Sep 2017 00:00:00 +0300 Message-Id: <1505422809-5632-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505422809-5632-1-git-send-email-odpbot@yandex.ru> References: <1505422809-5632-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 179 Subject: [lng-odp] [PATCH API-NEXT v1 10/19] validation: packet: unshared len with static reference 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 When static references are used all data is shared, and thus unshared length is zero. When there's no references, all data is unique to the packet (unshared len == len). Signed-off-by: Petri Savolainen Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- /** Email created from pull request 179 (muvarov:api-next) ** https://github.com/Linaro/odp/pull/179 ** Patch: https://github.com/Linaro/odp/pull/179.patch ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: ada61f5ba5f940d03a95893940c21028d4c75d19 **/ test/common_plat/validation/api/packet/packet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/common_plat/validation/api/packet/packet.c b/test/common_plat/validation/api/packet/packet.c index 898dac878..f291b6ee2 100644 --- a/test/common_plat/validation/api/packet/packet.c +++ b/test/common_plat/validation/api/packet/packet.c @@ -2224,8 +2224,14 @@ void packet_test_ref(void) CU_ASSERT(ref_pkt[0] != ODP_PACKET_INVALID); if (odp_packet_has_ref(base_pkt) == 1) { - /* CU_ASSERT needs braces */ CU_ASSERT(odp_packet_has_ref(ref_pkt[0]) == 1); + CU_ASSERT(odp_packet_unshared_len(base_pkt) == 0); + CU_ASSERT(odp_packet_unshared_len(ref_pkt[0]) == 0); + } else { + CU_ASSERT(odp_packet_unshared_len(base_pkt) == + odp_packet_len(base_pkt)); + CU_ASSERT(odp_packet_unshared_len(ref_pkt[0]) == + odp_packet_len(ref_pkt[0])); } CU_ASSERT(odp_packet_len(ref_pkt[0]) == odp_packet_len(base_pkt));