From patchwork Thu Nov 16 15:00:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 119049 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5695330qgn; Thu, 16 Nov 2017 07:04:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMZqhI1AaeshUkEI0mB/Cih8LhDbjwwWEMhlwP8czYfaLVKPFTmaZU56VLIyn9xkEvSj3ZkW X-Received: by 10.233.237.71 with SMTP id c68mr3055910qkg.69.1510844692436; Thu, 16 Nov 2017 07:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510844692; cv=none; d=google.com; s=arc-20160816; b=oAKqqvxxhaVisD2w0SvGMSqCNs+VqDFR7+wBU3++K6D3FpKKSLOACSFgS3JDMPAbQD Ua2c89iduXlA+VTfQ9AXg1loY1p76t4qMTreTdSiTM5hVkvHF8iIUn2Br8kWq+Xb267b BZI5gtCz0pRtzVgV8AKqnyATkJ5HcI7BiNm+8CY0plgVqVzSFtQ0YGj8ceuifVsmBw2j KQ/6S4ADDXfQUW5sz1Sz1hOijFHV6Kx38oQLdxnAsRbTsZRm1yvhYthmephiCteN7EsN bbnacsDeftjdPvNHNqksKGnmaREzs/W3ZcFRBsa4Sh9Xv4UtbdvRmBN1Y5P1gC54rDgB IcpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=6mIb2yeDW+6bR0PJtIf44c2As9ZOt41PuhWMpa0FiK4=; b=Ir31+emPAsCwSBXC6K71VzRt7ZCz7Hhwv/aI37UAGSXRgyN8vGQQS5oRewOdh9FlYY VP4/Jd8prRjDCp3I3VBWWKkMeP3qfxHXlc6EmrprxlGNZFRdLt941S9yZIGAZ27eFH62 RNbe5UcfSf3XWy0iPsgf1l56ODxa3vyTTV8yvRRK81EyVJx12oYOK8TRVj+UxJZGQea0 MLiNkuIVAVwV/5/oGEG+k6doOyl3Llb/4LS6wAcFvkJV/xjxKK3NWAOw0XU3tE5b557Q pDXxrO+ADMhXMQHehwC12FtNssRHlh4K9RUQ+VmHrFZwXYdlVgNc0Z82aAR+Mh1XjRzm l0gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id j126si1272336qkd.53.2017.11.16.07.04.51; Thu, 16 Nov 2017 07:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B39C7607DC; Thu, 16 Nov 2017 15:04:51 +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,FREEMAIL_FROM, 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 F2606607E1; Thu, 16 Nov 2017 15:00:45 +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 443176077C; Thu, 16 Nov 2017 15:00:25 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 658CA6074A for ; Thu, 16 Nov 2017 15:00:19 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 82D1E2185BB5 for ; Thu, 16 Nov 2017 18:00:15 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qDff4gXsph-0FmWmcEf; Thu, 16 Nov 2017 18:00:15 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id H8kylhnNlg-0F3WgJLq; Thu, 16 Nov 2017 18:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 16 Nov 2017 18:00:10 +0300 Message-Id: <1510844412-21931-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510844412-21931-1-git-send-email-odpbot@yandex.ru> References: <1510844412-21931-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 298 Subject: [lng-odp] [PATCH API-NEXT v1 4/6] test: l2fwd: add verbose option 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Added verbose command line option. When enabled, pktio interface details are printed after open. This can be used for debugging interface configuration. Signed-off-by: Petri Savolainen --- /** Email created from pull request 298 (psavol:next-frame-len) ** https://github.com/Linaro/odp/pull/298 ** Patch: https://github.com/Linaro/odp/pull/298.patch ** Base sha: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: f65f2a6ea63917fca4366f41eeac436d31acec9f **/ test/performance/odp_l2fwd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 42d8f49a2..2daf0e2db 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -108,6 +108,7 @@ typedef struct { int error_check; /**< Check packet errors */ int sched_mode; /**< Scheduler mode */ int num_groups; /**< Number of scheduling groups */ + int verbose; /**< Verbose output */ } appl_args_t; static int exit_threads; /**< Break workers loop if set to 1 */ @@ -697,6 +698,9 @@ static int create_pktio(const char *dev, int idx, int num_rx, int num_tx, printf("created pktio %" PRIu64 ", dev: %s, drv: %s\n", odp_pktio_to_u64(pktio), dev, info.drv_name); + if (gbl_args->appl.verbose) + odp_pktio_print(pktio); + if (odp_pktio_capability(pktio, &capa)) { LOG_ERR("Error: capability query failed %s\n", dev); return -1; @@ -1163,11 +1167,12 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {"src_change", required_argument, NULL, 's'}, {"error_check", required_argument, NULL, 'e'}, {"groups", required_argument, NULL, 'g'}, + {"verbose", no_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "+c:+t:+a:i:m:o:r:d:s:e:g:h"; + static const char *shortopts = "+c:+t:+a:i:m:o:r:d:s:e:g:vh"; /* let helper collect its own arguments (e.g. --odph_proc) */ odph_parse_options(argc, argv, shortopts, longopts); @@ -1178,6 +1183,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) appl_args->src_change = 1; /* change eth src address by default */ appl_args->num_groups = 0; /* use default group */ appl_args->error_check = 0; /* don't check packet errors by default */ + appl_args->verbose = 0; opterr = 0; /* do not issue errors on helper options */ @@ -1305,6 +1311,9 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'g': appl_args->num_groups = atoi(optarg); break; + case 'v': + appl_args->verbose = 1; + break; case 'h': usage(argv[0]); exit(EXIT_SUCCESS);