From patchwork Fri Aug 4 15:41:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 27463 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 2C5B7374F; Fri, 4 Aug 2017 17:41:50 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 078D5330D for ; Fri, 4 Aug 2017 17:41:48 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Aug 2017 08:41:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,321,1498546800"; d="scan'208";a="886482360" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by FMSMGA003.fm.intel.com with ESMTP; 04 Aug 2017 08:41:42 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: bruce.richardson@intel.com, Harry van Haaren Date: Fri, 4 Aug 2017 16:41:56 +0100 Message-Id: <1501861316-57305-1-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] examples/eventdev: fix run forever with -n param X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" During the refactoring of the sample app to be more generic, the option to set -n0 and process a huge number of packets was lost. This commit re-adds -n0, and will process INT64_MAX number of packets. Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app") Signed-off-by: Harry van Haaren --- examples/eventdev_pipeline_sw_pmd/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index 91dddb1..ae537a5 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -91,7 +91,7 @@ static struct fastpath_data *fdata; struct config_data { unsigned int active_cores; unsigned int num_workers; - long num_packets; + int64_t num_packets; unsigned int num_fids; int queue_type; int worker_cycles; @@ -121,7 +121,6 @@ core_in_use(unsigned int lcore_id) { fdata->tx_core[lcore_id] || fdata->worker_core[lcore_id]); } - static void eth_tx_buffer_retry(struct rte_mbuf **pkts, uint16_t unsent, void *userdata) @@ -471,7 +470,9 @@ parse_app_args(int argc, char **argv) int popcnt = 0; switch (c) { case 'n': - cdata.num_packets = (unsigned long)atol(optarg); + cdata.num_packets = (int64_t)atol(optarg); + if(cdata.num_packets == 0) + cdata.num_packets = INT64_MAX; break; case 'f': cdata.num_fids = (unsigned int)atoi(optarg); @@ -908,7 +909,7 @@ main(int argc, char **argv) printf(" Config:\n"); printf("\tports: %u\n", num_ports); printf("\tworkers: %u\n", cdata.num_workers); - printf("\tpackets: %lu\n", cdata.num_packets); + printf("\tpackets: %"PRIi64"\n", cdata.num_packets); printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities); if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY) printf("\tqid0 type: ordered\n");