From patchwork Wed May 11 16:42:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 67576 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp302016qge; Wed, 11 May 2016 09:03:22 -0700 (PDT) X-Received: by 10.55.18.9 with SMTP id c9mr4621443qkh.158.1462982602940; Wed, 11 May 2016 09:03:22 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 14si5607868qkt.280.2016.05.11.09.03.22; Wed, 11 May 2016 09:03: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; 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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8C2DB6166D; Wed, 11 May 2016 16:03:22 +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_H3, RCVD_IN_MSPIKE_WL, 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 E1A11616E7; Wed, 11 May 2016 15:46:57 +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 51927616D9; Wed, 11 May 2016 15:46:51 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by lists.linaro.org (Postfix) with ESMTPS id F052161645 for ; Wed, 11 May 2016 15:44:26 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id m64so53862391lfd.1 for ; Wed, 11 May 2016 08:44:26 -0700 (PDT) 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=sX0Oq9we+o5DaKdkVehtO7yqU1z2YLdTtKGxg1xqLCg=; b=ixVSm+9flS2WK6y/Vq3KdrcsKot/vA3sdV1Kfx8j55Kf8NH7LpWScjsY17XCMVfFzN sK0MkcvcmOOt+j2TKiMNbK3UZdG+IT2ixLcM9JjqyYZs4mw+vMxJYbmqilNOiH2SzlSd LUdmtDKhL7m9tCg0dAfDVcynnL+QZRdI8HQZfQw+zxQ2aP/ohLV5NpmreY7YEdNGJjHo zPdHl/RlC0R+CI66HzakNnYmmaZ229WSC7MTYDVVKvyrpVqmUjRovLcXPjBWbMXIAh73 5D2MJDjD/dMPqYv27lQqPQ9hCT9DS/pGut3pQfo6ptBHYnjimwxneBEdPsuY4FVmwi57 5xmQ== X-Gm-Message-State: AOPr4FWo7iT5aSZTiiNOftZ8nly67F6KLnH6XuPFeHQg5TPw19r1MWxxSQ9pwxt3nBYMEuUbuac= X-Received: by 10.25.146.6 with SMTP id u6mr1700696lfd.60.1462981465883; Wed, 11 May 2016 08:44:25 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id n37sm1421164lfg.46.2016.05.11.08.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 08:44:25 -0700 (PDT) From: Christophe Milard To: brian.brooks@linaro.org, mike.holmes@linaro.org, lng-odp@lists.linaro.org Date: Wed, 11 May 2016 18:42:03 +0200 Message-Id: <1462984942-53326-20-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1462984942-53326-1-git-send-email-christophe.milard@linaro.org> References: <1462984942-53326-1-git-send-email-christophe.milard@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCHv6 19/38] performance: crypto: adding helper cmd line parsing 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" odp_crypto now calls the helper command line parsing so that helper can collect its options. Hence enabling process mode run. Signed-off-by: Christophe Milard --- test/performance/odp_crypto.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c index 893a5a3..404984d 100644 --- a/test/performance/odp_crypto.c +++ b/test/performance/odp_crypto.c @@ -828,7 +828,7 @@ static void parse_args(int argc, char *argv[], crypto_args_t *cargs) { int opt; int long_index; - static struct option longopts[] = { + static const struct option longopts[] = { {"algorithm", optional_argument, NULL, 'a'}, {"debug", no_argument, NULL, 'd'}, {"flight", optional_argument, NULL, 'f'}, @@ -843,6 +843,11 @@ static void parse_args(int argc, char *argv[], crypto_args_t *cargs) {NULL, 0, NULL, 0} }; + static const char *shortopts = "+a:c:df:hi:m:nl:spr"; + + /* let helper collect its own arguments (e.g. --odph_proc) */ + odph_parse_options(argc, argv, shortopts, longopts); + cargs->in_place = 0; cargs->in_flight = 1; cargs->debug_packets = 0; @@ -852,9 +857,10 @@ static void parse_args(int argc, char *argv[], crypto_args_t *cargs) cargs->reuse_packet = 0; cargs->schedule = 0; + opterr = 0; /* do not issue errors on helper options */ + while (1) { - opt = getopt_long(argc, argv, "+a:c:df:hi:m:nl:spr", - longopts, &long_index); + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); if (opt == -1) break; /* No more options */