From patchwork Fri Sep 8 14: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: 112085 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1667386ybm; Fri, 8 Sep 2017 07:06:30 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4xDbiTWXhKDdOpIna2Rldjgzs814igwVjfT0BScA7wSgZltSsE5dq5PdC0D8YJ5MH4/RNJ X-Received: by 10.55.66.22 with SMTP id p22mr4061457qka.30.1504879469216; Fri, 08 Sep 2017 07:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504879469; cv=none; d=google.com; s=arc-20160816; b=kOLvg1sQ5peW54s5CQjwnAwFdjctujwvwOOTPWZTP+mctZ/qZPyrQT7eL3c8lE8K4T mKuCNAUl/a9UbeO57kcEiPkEviynOvEV9lGXOjXWmof8ujxHS0JFgIjpfnY+OR1jkI8U jEZGTKa6EQPyyOCuLz1HsoJSV4S5u3qp2z6KThWGi4u/ZJ3BsxUAiG1bOA9AVebboGiM fijLbWk463U6eCkxB9l687isA/YklKMJ74GhJVVvZfJOV+4qEAQr0xiHdRviPC6EmFBC DN395dcxHqUuRxagBQMuZRsutbHzE/O0Wg/kWVX9eZDykW6uzm0B0VMCSqpzt3qo7sMK YsPg== 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=StAAwBbxmrvTmruWVMA5QAPZQNlk/59p6UgJ22X63nc=; b=OlcSEISmRDgmCb59yQku9HjR2zGv11cRy+UzbOfBSAwi52ewVLA6lC+G/+OxGCn1K/ 2TW7YCRzKRn44FBE1XU+SNFWYmK0RuKdOtGqM6ECBOu8LMwrCk/6R5iQ3qTPmSmfSqRz mAHncJRtHLOht9OcDA5zkHVC5SIvZQjRePfJRgeTDE+w8M/IoAOsnoSL3Af0yfwNvK2w wa1IoAz2u1PpqQaNsLQYTy4J3ElkL+oF/Zdn7Lkl2c7mXvemjPz4J8FIZvWHkt0Rldcc 8AGl6JEkzvdjfFhHNJo++LSaHSAeYuhpHFKxOHn/J5lGC9gXSHrRMeTsaimyTgHr3i1e kA2g== 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 e9si2177518qka.106.2017.09.08.07.04.24; Fri, 08 Sep 2017 07:04:29 -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 D8E2D65C0F; Fri, 8 Sep 2017 14:04:24 +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 09EC9644C9; Fri, 8 Sep 2017 14:00:51 +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 C423462CE2; Fri, 8 Sep 2017 14:00:28 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 91E7D608E3 for ; Fri, 8 Sep 2017 14:00:20 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 55D742D8487A for ; Fri, 8 Sep 2017 17:00:19 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id x9s7SpWMyy-0JnOvSXW; Fri, 08 Sep 2017 17:00:19 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IwYlQdvFwh-0JKeWshZ; Fri, 08 Sep 2017 17:00:19 +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, 8 Sep 2017 17:00:04 +0300 Message-Id: <1504879212-3689-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504879212-3689-1-git-send-email-odpbot@yandex.ru> References: <1504879212-3689-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 170 Subject: [lng-odp] [PATCH v1 3/11] 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 --- /** Email created from pull request 170 (psavol:master-packet-ref-rework) ** https://github.com/Linaro/odp/pull/170 ** Patch: https://github.com/Linaro/odp/pull/170.patch ** Base sha: 360c1d34b52a2356619b9290811862b9de41de00 ** Merge commit sha: e19cce86ab00ccd959d2c3c82c0786ec6da19ba7 **/ test/common_plat/validation/api/packet/packet.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/common_plat/validation/api/packet/packet.c b/test/common_plat/validation/api/packet/packet.c index 898dac878..c40dab985 100644 --- a/test/common_plat/validation/api/packet/packet.c +++ b/test/common_plat/validation/api/packet/packet.c @@ -2226,6 +2226,14 @@ void packet_test_ref(void) 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));