From patchwork Thu Sep 14 09:00:02 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: 112515 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp517212qgf; Thu, 14 Sep 2017 02:09:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDCuoreMujV2sagfJHaTpjd1yixx/OT5+C14UTt889nMTLlpdptLc6dpDrwtPIgegwpf6Ka X-Received: by 10.200.43.123 with SMTP id 56mr28781043qtv.15.1505380163401; Thu, 14 Sep 2017 02:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505380163; cv=none; d=google.com; s=arc-20160816; b=xUNkyUwSwGlV6guJwQBM2gmvaOP1f+5ra/9nmMNFrdyDXVlrV1lsbgGDudK8QtCIEv RoWP4EBYL/8spr13jMmsDKRyiIfZ+5cgQ3y7IflXFA0RWdGej0Ww2cb6acjOA1MOdDlf RN5qUghgAg1PeQ3G4qIibYd+tqdTXgOP2tgkP3N0gWjTRyVxNkDzt3dMvjHEdiuvg3jw llOV3L4fpBf+akHJdorxiADxyk7PqW1Q3zIkYrSYjYLmbmgVhHnoEsTQcKKY5DVTijes S01YnjvkP1050nL29aV/utx9MMBFxl6umsOm537PMrh77oS4GVSuSdZdk7ioblbvph65 gqeA== 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=9L1I74F0ByBjvrp3USeDvF0Vy3CfjEUv05WYNA4H6n4=; b=yWAzfJfX7Nrqmfa2DF2X1AsAK6+4iD6L7c1UymaxhwJLtKDogxt0lOyG9wNvbqrEBm Z7lpG9gRGFr3dTJW9SDNRH9G1G35Rsf6p0gDwv4KaYQ5zKVn4TKDtlO6ArVaonI+bPoV ycOJCIBOVcncSDV2Unw5plZxegjKAeUZh55/8SmuEV1DfdURhF1mpmXBXkx4GB8h3ERG Y+49jkTd2DQ5s9zDxdWu8kMEJY97D97rL+RWPMgho1hlz0L6MPYdQ+0B901FI2TY/yRi YSC4m1xbZ2fto3OJZxOhn/ijjEpi5VyJHbcyab8aUu2tPV8k15U04htY/VEupRCmSsX8 zx9Q== 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 k126si16160758qkf.182.2017.09.14.02.09.23; Thu, 14 Sep 2017 02:09:23 -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 0C5356446B; Thu, 14 Sep 2017 09:09:23 +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 4BF2C6091C; Thu, 14 Sep 2017 09:01:55 +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 B94EE60965; Thu, 14 Sep 2017 09:01:47 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 403E960965 for ; Thu, 14 Sep 2017 09:00:52 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward105o.mail.yandex.net (Yandex) with ESMTP id B08C54440CE0 for ; Thu, 14 Sep 2017 12:00:47 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Qu3rhAZFm4-0laiFfAQ; Thu, 14 Sep 2017 12:00:47 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Aoyyu0Wxlx-0lXqLpXa; Thu, 14 Sep 2017 12:00:47 +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: Thu, 14 Sep 2017 12:00:02 +0300 Message-Id: <1505379610-1146-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505379610-1146-1-git-send-email-odpbot@yandex.ru> References: <1505379610-1146-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 170 Subject: [lng-odp] [PATCH v3 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: fb3f36cec108ce9c55241d9f0e66d4832a552b8a ** Merge commit sha: 3baec92b29f68295264bb3a780277f7f1b6cbb83 **/ 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 898dac87..f291b6ee 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));