From patchwork Thu Aug 13 17:28:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 52406 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 05DB12031F for ; Thu, 13 Aug 2015 17:30:03 +0000 (UTC) Received: by labth1 with SMTP id th1sf19583825lab.2 for ; Thu, 13 Aug 2015 10:30:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:in-reply-to:references:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=J99aRFZPhB3+C2dwRsI9vATpNuCNkzVsHBRjzXmIQ0M=; b=N+4Nhw5mlvA57EJ8pP/GlZc0MiHXjz0mg26+ZvP1LdZ7hY/jTu+WrytJ37bbUatWf2 LsTlWkTtQoP4bFKC1g600tOpbtH9SkYtKmhgJQFqXsRBXhtoz47pfcHNWrDph/9Y8J8m XXf3iM6Ob5ydchJIFeeY17TzX24qdBO2I5GoH5xtKd/+g1iPGI8hewiN6fJbQ+znP0V1 g+Kopy2kLjVNXJdrXGjVENUQs0Jn9KF86p8EDotO2SJFaVgwu4pFan6lAUIOE08gBJtr rYCPRvhqoY5A7p7JOa4c0nh11mzWqJ6UimHlI+ChDn/B/rm17mpOTYuLJgvsZDaPwFlA HOGA== X-Gm-Message-State: ALoCoQl0+uNii6/T4Xh1je4Q7HJUaGQ9OGGfqGKSEKdEKnwb/Pi3YDk3ZwxrhPdXAoSk/E4/v0ii X-Received: by 10.112.99.37 with SMTP id en5mr11517995lbb.7.1439487002010; Thu, 13 Aug 2015 10:30:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.101 with SMTP id 5ls232300lal.59.gmail; Thu, 13 Aug 2015 10:30:01 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr37131884lbb.36.1439487001863; Thu, 13 Aug 2015 10:30:01 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id ai2si3256247lbc.68.2015.08.13.10.30.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2015 10:30:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbcbn3 with SMTP id bn3so30975963lbc.2 for ; Thu, 13 Aug 2015 10:30:01 -0700 (PDT) X-Received: by 10.112.160.42 with SMTP id xh10mr37510892lbb.88.1439487001749; Thu, 13 Aug 2015 10:30:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1081623lba; Thu, 13 Aug 2015 10:30:00 -0700 (PDT) X-Received: by 10.50.62.33 with SMTP id v1mr4300766igr.69.1439487000613; Thu, 13 Aug 2015 10:30:00 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l8si1977250ioe.45.2015.08.13.10.29.59; Thu, 13 Aug 2015 10:30: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; Received: by lists.linaro.org (Postfix, from userid 109) id 98758621F4; Thu, 13 Aug 2015 17:29:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6B8B9621EA; Thu, 13 Aug 2015 17:29:17 +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 243FB621E7; Thu, 13 Aug 2015 17:29:14 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by lists.linaro.org (Postfix) with ESMTPS id B10B2621E2 for ; Thu, 13 Aug 2015 17:28:40 +0000 (UTC) Received: by wicne3 with SMTP id ne3so148217111wic.0 for ; Thu, 13 Aug 2015 10:28:39 -0700 (PDT) X-Received: by 10.180.10.8 with SMTP id e8mr57389979wib.22.1439486919916; Thu, 13 Aug 2015 10:28:39 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id yu4sm4315997wjc.43.2015.08.13.10.28.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Aug 2015 10:28:39 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Thu, 13 Aug 2015 18:28:23 +0100 Message-Id: <1439486903-14811-3-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439486903-14811-1-git-send-email-zoltan.kiss@linaro.org> References: <1439486903-14811-1-git-send-email-zoltan.kiss@linaro.org> In-Reply-To: <1439403136-26964-1-git-send-email-zoltan.kiss@linaro.org> References: <1439403136-26964-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 3/3] validation: packet: test if user area is properly set X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoltan.kiss@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Zoltan Kiss --- test/validation/packet/packet.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index 99a6745..36edc12 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -36,6 +36,14 @@ static struct udata_struct { "abcdefg", }; +static void packet_uarea_init(odp_packet_t pkt, void *uarea_init_arg) +{ + void *uarea = odp_packet_user_area(pkt); + uint32_t uarea_size = odp_packet_user_area_size(pkt); + + memcpy(uarea, uarea_init_arg, uarea_size); +} + int packet_suite_init(void) { odp_pool_param_t params = { @@ -44,6 +52,8 @@ int packet_suite_init(void) .len = PACKET_BUF_LEN, .num = 100, .uarea_size = sizeof(struct udata_struct), + .uarea_init = packet_uarea_init, + .uarea_init_arg = (void *)&test_packet_udata }, .type = ODP_POOL_PACKET, }; @@ -64,16 +74,16 @@ int packet_suite_init(void) udat = odp_packet_user_area(test_packet); udat_size = odp_packet_user_area_size(test_packet); - if (!udat || udat_size != sizeof(struct udata_struct)) + if (!udat || udat_size != sizeof(struct udata_struct) || + memcmp(udat, (void *)&test_packet_udata, udat_size)) return -1; odp_pool_print(packet_pool); - memcpy(udat, &test_packet_udata, sizeof(struct udata_struct)); udat = odp_packet_user_area(segmented_test_packet); udat_size = odp_packet_user_area_size(segmented_test_packet); - if (udat == NULL || udat_size != sizeof(struct udata_struct)) + if (!udat || udat_size != sizeof(struct udata_struct) || + memcmp(udat, (void *)&test_packet_udata, udat_size)) return -1; - memcpy(udat, &test_packet_udata, sizeof(struct udata_struct)); return 0; }