From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D757A0540; Mon, 22 Aug 2022 21:26:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D646E40DFD; Mon, 22 Aug 2022 21:26:58 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 27C4140694 for ; Mon, 22 Aug 2022 21:26:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661196417; x=1692732417; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3PcU4pvGIT+SjQsR8Q6QvqC/yfmnInge33DB6OYxy64=; b=K2SVZ/BbOG1kIP5SJZ2Aya67UYItfmP15YTn9QuyV+xaEKZ5uyXRBt8v r92piM3+LjbRisGPEs3Mkmf2SFEX86AN3RaHIol/oOZXtKCynOQuyjW8d j9PYataPlr+uez9AEo5t5cTq9tifRG/EiJorf4enwzl3twgmZMu7VEpW/ SYGhzbIUMBESpvFOS11d5MoUSwvRoxdM5V22KecyeL7QuqHSjryHFf3yc ebxlUZ/Od1qM07yaj7Jp7kf+NG9kZA8tCbSXmZKFg6P3MCmdIA33qXm9E rrKdRmmLOr1dVmHrQhcj6rbPTljqghCciQnHMbqU8iFZAWaUvIi1+BIyo A==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="379794030" X-IronPort-AV: E=Sophos;i="5.93,255,1654585200"; d="scan'208";a="379794030" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 12:26:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,255,1654585200"; d="scan'208";a="669687632" Received: from txanpdk03.an.intel.com ([10.123.117.78]) by fmsmga008.fm.intel.com with ESMTP; 22 Aug 2022 12:26:53 -0700 From: Timothy McDaniel To: jerinj@marvell.com Cc: mdr@ashroe.eu, thomas@monjalon.net, dev@dpdk.org Subject: [PATCH v2] examples/eventdev_producer_consumer: fix 32-bit checkpatch issues Date: Mon, 22 Aug 2022 14:26:51 -0500 Message-Id: <20220822192651.3197685-1-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220818170204.1885568-1-timothy.mcdaniel@intel.com> References: <20220818170204.1885568-1-timothy.mcdaniel@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Fixed style and format issues, primarily those involving data types whose size varies depending on whether we are building for 32 or 64 bit platforms. Signed-off-by: Timothy McDaniel --- examples/eventdev_producer_consumer/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/eventdev_producer_consumer/main.c b/examples/eventdev_producer_consumer/main.c index 54a550b459..164bdf6f74 100644 --- a/examples/eventdev_producer_consumer/main.c +++ b/examples/eventdev_producer_consumer/main.c @@ -21,7 +21,7 @@ static unsigned int num_workers = 4; static bool g_is_mbuf; -static unsigned long num_packets = (1L << 25); /* do ~32M packets */ +static uint64_t num_packets = (1L << 25); /* do ~32M packets */ static int sched_type = RTE_SCHED_TYPE_ATOMIC; struct prod_data { @@ -51,13 +51,13 @@ static struct rte_mempool *mp; static int worker(void *arg) { - struct rte_event rcv_events[BATCH_SIZE] = {0}; + struct rte_event rcv_events[BATCH_SIZE]; struct worker_data *data = (struct worker_data *)arg; uint8_t event_dev_id = data->event_dev_id; uint8_t event_port_id = data->event_port_id; int32_t qid = data->qid; - size_t sent = 0, received = 0; + uint64_t sent = 0, received = 0; uint16_t n; if (!quiet) @@ -83,7 +83,7 @@ worker(void *arg) rte_pause(); continue; } else if (!quiet) - printf("Worker received %d events (%zu total)\n", + printf("Worker received %d events(%"PRIu64" total)\n", n, received); delay_start = rte_rdtsc(); @@ -113,7 +113,7 @@ worker(void *arg) } /* while (!done) */ if (!quiet) - printf("%s %d thread done. RX=%zu TX=%zu\n", + printf("%s %d thread done. RX= %"PRIu64" TX= %"PRIu64"\n", __func__, rte_lcore_id(), received, sent); return 0; @@ -122,7 +122,7 @@ worker(void *arg) static int consumer(void *arg) { - struct rte_event events[BATCH_SIZE] = {0}; + struct rte_event events[BATCH_SIZE]; struct cons_data *data = (struct cons_data *)arg; uint8_t event_dev_id = data->event_dev_id; uint8_t event_port_id = data->event_port_id; @@ -165,7 +165,7 @@ consumer(void *arg) printf("deq_end = %"PRIu64", deq_start = %"PRIu64"\n", deq_end, deq_start); - printf("Consumer done! RX=%zu, time %"PRIu64"ms\n", + printf("Consumer done! RX=%"PRIu64", time %"PRIu64"ms\n", num_packets, (rte_get_timer_cycles() - start_time) / freq_khz); done = 1; @@ -188,7 +188,7 @@ producer(void *arg) uint64_t enq_start, enq_end; int k = 0; struct rte_mbuf *m; - struct rte_event producer_events[BATCH_SIZE] = {0}; + struct rte_event producer_events[BATCH_SIZE]; struct rte_event *ev = &producer_events[0]; int l = 0; struct rte_mbuf *mbufs[BATCH_SIZE]; @@ -263,7 +263,7 @@ producer(void *arg) printf("Producer done. %"PRIu64" packets sent in %"PRIu64" cycles" "(%f cycles/evt) (%f pkts/sec)\n", - num_packets, enq_end-enq_start, + num_packets, enq_end - enq_start, (float)(enq_end - enq_start)/(float)num_packets, (float) (num_packets * rte_get_timer_hz()) / (float) (enq_end - enq_start)); -- 2.25.1