From patchwork Fri Aug 14 18:55:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 52462 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 862D722B12 for ; Fri, 14 Aug 2015 19:00:25 +0000 (UTC) Received: by wicul11 with SMTP id ul11sf8987665wic.1 for ; Fri, 14 Aug 2015 12:00:24 -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=IHVoA5vEznjWjWt9MJ+6POVkLCYcSphyJrFkw4KOjZg=; b=ZpsDT/dyCRUda8bpp7rK3TVvfgSlZMW1KWQZpSMwOr8Mz/EsJiSELFDY3nYscIY4cw cJ8WKZrTm+VR+zeeAfurqETrlmwtqAc3oJU+MZcCsj/O98uhoe4JcXeLrLZsyx2ILQK9 jGxOoZSNNQCrkFz2ifBCdPIXV5z7bAAAmnsWmtxNYUcbn0TBZchy0yx70JtZhs/zFyjs 4Me4qzkbXgJFE7+2xLE+ATU8XiH1V0isy4mj/iJGgEoh0+3Y9VmmPMtkVHLY2HFjZrMc hAXr+Ub/QisGDWl2MTe507MT9LsPpPSDnI1edsjVJvURnPqL3TdktqM/RmDaywqqcZvZ DIGQ== X-Gm-Message-State: ALoCoQlwJsciapON6FHvPhpUqiUGYhkUk8XBhS+pvLMVdi2CSxpbqe0t1ZfD1KgtIqAQY+ykx/vY X-Received: by 10.180.98.133 with SMTP id ei5mr1365300wib.2.1439578824631; Fri, 14 Aug 2015 12:00:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.135 with SMTP id m7ls408626laf.103.gmail; Fri, 14 Aug 2015 12:00:24 -0700 (PDT) X-Received: by 10.112.159.1 with SMTP id wy1mr46401927lbb.55.1439578824463; Fri, 14 Aug 2015 12:00:24 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id j6si6476914lbh.152.2015.08.14.12.00.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 12:00:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcbn3 with SMTP id bn3so50437354lbc.2 for ; Fri, 14 Aug 2015 12:00:24 -0700 (PDT) X-Received: by 10.152.29.132 with SMTP id k4mr25322046lah.88.1439578824025; Fri, 14 Aug 2015 12:00:24 -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 l6csp1818409lba; Fri, 14 Aug 2015 12:00:22 -0700 (PDT) X-Received: by 10.55.217.10 with SMTP id u10mr681544qki.55.1439578822804; Fri, 14 Aug 2015 12:00:22 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 140si10952298qhx.55.2015.08.14.12.00.19; Fri, 14 Aug 2015 12:00:22 -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 1E1FC61E73; Fri, 14 Aug 2015 19:00:19 +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 CEA4962290; Fri, 14 Aug 2015 18:59:03 +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 0F6E76228E; Fri, 14 Aug 2015 18:58:13 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by lists.linaro.org (Postfix) with ESMTPS id EEF95621E7 for ; Fri, 14 Aug 2015 18:55:56 +0000 (UTC) Received: by wicja10 with SMTP id ja10so26542345wic.1 for ; Fri, 14 Aug 2015 11:55:56 -0700 (PDT) X-Received: by 10.180.208.105 with SMTP id md9mr8854513wic.89.1439578556110; Fri, 14 Aug 2015 11:55:56 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id jr5sm9498962wjc.14.2015.08.14.11.55.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Aug 2015 11:55:55 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 14 Aug 2015 19:55:44 +0100 Message-Id: <1439578544-12730-3-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439578544-12730-1-git-send-email-zoltan.kiss@linaro.org> References: <1439578544-12730-1-git-send-email-zoltan.kiss@linaro.org> In-Reply-To: <1439486903-14811-1-git-send-email-zoltan.kiss@linaro.org> References: <1439486903-14811-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v4 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.175 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 Reviewed-and-tested-by: Bill Fischofer --- 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; }