From patchwork Wed Feb 24 22:59:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary.robertson@linaro.org X-Patchwork-Id: 62844 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2682575lbl; Wed, 24 Feb 2016 15:02:40 -0800 (PST) X-Received: by 10.55.75.203 with SMTP id y194mr52939911qka.2.1456354960568; Wed, 24 Feb 2016 15:02:40 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z203si5038048qka.44.2016.02.24.15.02.40; Wed, 24 Feb 2016 15:02:40 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 3009965074; Wed, 24 Feb 2016 23:02:40 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 7128D64D87; Wed, 24 Feb 2016 22:59: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 CDD1363646; Wed, 24 Feb 2016 22:59:39 +0000 (UTC) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by lists.linaro.org (Postfix) with ESMTPS id 2F47A63014 for ; Wed, 24 Feb 2016 22:59:36 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id jq7so32616439obb.0 for ; Wed, 24 Feb 2016 14:59:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tpFVc4SPJ8jjBZ3Kl0u7N99zuYsUuu6WgZXyI0czhxY=; b=O1KFhrU857zpj04QCBFMPXsXtUE+K/kL3yeVAvSk0kA9fef39LmB2yX4IrI4/P2LPW 74fgaOb86gwVRUPA4WmlOfROTLiiIfwlU4h3NfIsowMdgnZsxBmjY07XhZWu8F9Nzril IgxEq+I9hrfF+APVuUyzhfsh82DBlc8+10EK3eggRVOtbyzSRomIyT2Q3JpRHz/J7AM8 baCvulxfva0E8fHretWKy1QEg3u/7LitPZaQFdz5mzRCSgF4EzXILpoaAem+QyP1+9ZN 9V1O2SCZAUE1Pn278bhc/gG5lpICv0uV4gZDhrdt+6yRAdcOE5xTiffLqcuqxMXSVOYX v85A== X-Gm-Message-State: AG10YOTIhrdZutjhXFnQSlfRuYFfXPdJ849XS+fFVowCeCHtGePKI6iZ+OOqAD3vbBJBzzffCvU= X-Received: by 10.182.158.42 with SMTP id wr10mr34123649obb.37.1456354775795; Wed, 24 Feb 2016 14:59:35 -0800 (PST) Received: from honkintosh.cybertech.lan (65-120-133-114.dia.static.qwest.net. [65.120.133.114]) by smtp.googlemail.com with ESMTPSA id qs6sm3295271oeb.3.2016.02.24.14.59.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Feb 2016 14:59:35 -0800 (PST) From: "Gary S. Robertson" To: mike.holmes@linaro.org, bill.fischofer@linaro.org, maxim.uvarov@linaro.org, anders.roxell@linaro.org, petri.savolainen@linaro.org Date: Wed, 24 Feb 2016 16:59:22 -0600 Message-Id: <1456354762-1326-3-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456354762-1326-1-git-send-email-gary.robertson@linaro.org> References: <1456354762-1326-1-git-send-email-gary.robertson@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API-NEXT RFC PATCH 2/2] add isolation support to pktio performance test 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 is an example of how to apply the command line option parsing code in patch 1 of this series to an existing application. This same technique would be applied in order to add isolation support via the isolation helper code currently being developed for ODP. This patch is included only for informational purposes and is not yet suggested as a modification to current git repositories. Note the inclusion of the isolation parsing function call inserted ahead of any other command line option handlers, and also prior to ODP global initialization. Note also the 'odph*' wrapper function substituted for the call to odp_init_global() -and- the paired complementary wrapper function for ODP instance global termination processing. Signed-off-by: Gary S. Robertson --- test/performance/odp_pktio_perf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 5ffc542..a3710ba 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -1003,8 +1003,10 @@ int main(int argc, char **argv) odp_shm_t shm; int max_thrs; - if (odp_init_global(NULL, NULL) != 0) - LOG_ABORT("Failed global init.\n"); + ret = parse_isolation_options(&argc, argv); + + if (odph_init_global() != 0) + LOG_ABORT("Failed global isolation init.\n"); if (odp_init_local(ODP_THREAD_CONTROL) != 0) LOG_ABORT("Failed local init.\n"); @@ -1052,5 +1054,7 @@ int main(int argc, char **argv) test_term(); } + odph_term_global(); + return ret; }