From patchwork Tue Jan 12 13:54:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 59629 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2750222lbb; Tue, 12 Jan 2016 05:54:42 -0800 (PST) X-Received: by 10.140.102.11 with SMTP id v11mr166935903qge.39.1452606881956; Tue, 12 Jan 2016 05:54:41 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h76si30216744qhc.78.2016.01.12.05.54.41; Tue, 12 Jan 2016 05:54:41 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5C079610F6; Tue, 12 Jan 2016 13:54:41 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=i3qaZc6S; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 F1DAA611F4; Tue, 12 Jan 2016 13:54:36 +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 B199C61566; Tue, 12 Jan 2016 13:54:34 +0000 (UTC) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by lists.linaro.org (Postfix) with ESMTPS id CB28F610F6 for ; Tue, 12 Jan 2016 13:54:33 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id f206so321396240wmf.0 for ; Tue, 12 Jan 2016 05:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=+kbM86XUGwIJcdYDzp3MJ3BM/rwFaXsDhtPNsYgIRTw=; b=i3qaZc6SyCj8nCkrG5USn9GhtNg9pmNdXuKBxMDOGKliTgd4FQbw9LUwKROYk+pl86 FzVhm+RYBWF0GlTafoTpnDRvxPE8XJ2iN3ZJx13UxxFwsDIVv6lmFLzU++bprKK121QS 6tWJ38Kgqk4VzALEHTVtFbYYM24vZFXdYxNvs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=+kbM86XUGwIJcdYDzp3MJ3BM/rwFaXsDhtPNsYgIRTw=; b=DEPMUVu0xYAuwv4S7+npSZ+z6snkz7EHa6GXigcgxre1/pHJFOdt54qpWhRfVKj3RB TJcygEs44HmSOraCxiiIs6ne75dgRV8zZL5U9h9f8KJr2RrelFeSUVgjyzZJ4MvJTLwj qgjlSriYHl/vEKiKh4smPmByuctoilVU/f2hTjIAj/mTzjAuuxODcV7dkDfoMCWYgyOa OkxqXclN2r2MLSlKvtCwK4jqTm8Y5oA7INpxZhpVv//NfHXGUCt1EWYHsdCwZw+Mxerw qOBbrvE7HKrIzkfGUqmyOqmT8b213awXKIQYbC0FGypEh6eUCDd3+X2M31vwvkluTrpL xV3A== X-Gm-Message-State: ALoCoQnouljB6F10lGAgvBK1lqmcGILCLerbpvr+tDvcjGBQz54FXBEZAzdpN6nij0/iXW9mjzKCYCUt6x2lcTn1bJxtPR3bng== X-Received: by 10.194.235.137 with SMTP id um9mr82507703wjc.146.1452606872881; Tue, 12 Jan 2016 05:54:32 -0800 (PST) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id 75sm17699492wmo.22.2016.01.12.05.54.32 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 05:54:32 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Tue, 12 Jan 2016 13:54:19 +0000 Message-Id: <1452606859-22778-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] Revert user area init implementation 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" This reverts commits: 2eb52b7277 "linux-generic: pool: implement user area init support" 9127b7408b "validation: packet: test if user area is properly set" Signed-off-by: Zoltan Kiss --- platform/linux-generic/odp_pool.c | 11 ----------- test/validation/packet/packet.c | 18 ++++-------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 125d8e6..84d35bf 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -147,15 +147,6 @@ int odp_pool_term_local(void) return 0; } -static void packet_uarea_init(odp_pool_param_t *params, odp_buffer_hdr_t *tmp) -{ - if (params->type == ODP_POOL_PACKET && params->pkt.uarea_init) { - odp_packet_t pkt = _odp_packet_from_buffer(odp_hdr_to_buf(tmp)); - - params->pkt.uarea_init(pkt, params->pkt.uarea_init_arg); - } -} - /** * Pool creation */ @@ -376,8 +367,6 @@ odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) } } - packet_uarea_init(params, tmp); - /* Push buffer onto pool's freelist */ ret_buf(&pool->s, tmp); buf -= buf_stride; diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index 71282dc..2467dec 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -33,14 +33,6 @@ 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 = { @@ -49,8 +41,6 @@ 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, }; @@ -80,16 +70,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) || - memcmp(udat, (void *)&test_packet_udata, udat_size)) + if (!udat || udat_size != sizeof(struct udata_struct)) 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 || udat_size != sizeof(struct udata_struct) || - memcmp(udat, (void *)&test_packet_udata, udat_size)) + if (udat == NULL || udat_size != sizeof(struct udata_struct)) return -1; + memcpy(udat, &test_packet_udata, sizeof(struct udata_struct)); return 0; }