From patchwork Tue Sep 12 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: 112304 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5155009qgf; Tue, 12 Sep 2017 06:01:00 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAUtl+vC4BY23tg+tUNlq/RhLwcNDNmeCq39Ky6bZHDLN5YbXMwNEBfS5/nUJSHW5DgBP/b X-Received: by 10.55.148.3 with SMTP id w3mr20712213qkd.26.1505221260353; Tue, 12 Sep 2017 06:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505221260; cv=none; d=google.com; s=arc-20160816; b=1EXI6UpQjUiLc/0gBM1LSo4BYj2lXEC/1lar8k3akrXLw0N/YaBvdaCGsow4IMPtw4 aDMGZXEfDrZtCKs7Ns0QEJcDyHHbksOgnb8+kV+lMSyo9eUS7qldSPoRET2XA58VQ9Bj 7cEFupdridbf2usSIDBAHR429Gj8rFanRtpiNZ1YVJoPOr97ChqfDdtV66E4RZtP9rgU q0ZFzf2lIRL2qBXbXIYPo5RS7CNdUkejJqmjuHcjSgtisdaBYpcOWkpzXmLULbM+hNa1 QkyH0YDCZR9X6Jhb1SMZ96xaXnjU/yFhbxjKZqD6nfVL1yCTLXBx+2WM0LHs/FkNJvGQ Kqhw== 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=R+IsYM7/Nu2PyOK/9BsNIOHr7nO9Q//0lWHXqhU2HhU=; b=qooiQqWUVm9gpleMrSYNIp6lUuQreC07HJShes+z9riBW1KnTe2IRfIFeuGupi3e6Z Jy6/JwYZBoB1lbUK75X/an89XeuFMTnLQB0dCAzNLzSKz1CiaGXw4e9UM/bHXJSe6gY5 1NtdgTKiiFzqZ1GBQQN5mRBoO0ukvzXrArCZxB+AVF7cwKyuRY1jPif6QFmvKBnchT7t qOS9vFmudOVEfqYzQJ2zTr4hngO296Z2HxzSdR0vk6PvFRAP/e+CfrFh8R47fFXhz/kW /XkDf+EnPBTmwWZq2pZF5Uo3X2RunvaOW8ISgIqj6n4I3vwKCBP/IY6hyaxKSVUFEh4E uHAw== 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 y7si11467138qkl.497.2017.09.12.06.00.59; Tue, 12 Sep 2017 06:01:00 -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 EB30361DD5; Tue, 12 Sep 2017 13:00:58 +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 13E3761235; Tue, 12 Sep 2017 13:00:49 +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 C2B3861BBA; Tue, 12 Sep 2017 13:00:39 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id A673E61BBA for ; Tue, 12 Sep 2017 13:00:35 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward104j.mail.yandex.net (Yandex) with ESMTP id AC838430AF for ; Tue, 12 Sep 2017 16:00:34 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id lF8wsAe3Lx-0YcGf1AC; Tue, 12 Sep 2017 16:00:34 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eAiz36RVVp-0YHG4L8F; Tue, 12 Sep 2017 16:00:34 +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: Tue, 12 Sep 2017 16:00:04 +0300 Message-Id: <1505221212-27163-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505221212-27163-1-git-send-email-odpbot@yandex.ru> References: <1505221212-27163-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 170 Subject: [lng-odp] [PATCH v2 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: bab9e010b5432ba0f2ff0651313a85a6a1b563c2 **/ 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 898dac87..c40dab98 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));