From patchwork Mon Mar 9 16:05:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wodkowski, PawelX" X-Patchwork-Id: 3943 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 7E8A25FEB; Mon, 9 Mar 2015 17:09:06 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 622FE58CB for ; Mon, 9 Mar 2015 17:09:04 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 09 Mar 2015 09:07:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,368,1422950400"; d="scan'208";a="696017017" Received: from unknown (HELO Sent) ([10.217.248.233]) by orsmga002.jf.intel.com with SMTP; 09 Mar 2015 09:09:01 -0700 Received: by Sent (sSMTP sendmail emulation); Mon, 09 Mar 2015 17:05:52 +0100 From: Pawel Wodkowski To: dev@dpdk.org Date: Mon, 9 Mar 2015 17:05:29 +0100 Message-Id: <1425917129-5090-1-git-send-email-pawelx.wodkowski@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 1/2] example: fix minor bug in l2fwd-jobstats init sequence X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix check of returned values during application init phase. Signed-off-by: Pawel Wodkowski --- examples/l2fwd-jobstats/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index a5a1aaa..ba9d3c0 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -997,11 +997,11 @@ main(int argc, char **argv) drain_tsc, 0); rte_timer_init(&qconf->flush_timer); - rte_timer_reset(&qconf->flush_timer, drain_tsc, PERIODICAL, lcore_id, - &l2fwd_flush_job, NULL); + ret = rte_timer_reset(&qconf->flush_timer, drain_tsc, PERIODICAL, + lcore_id, &l2fwd_flush_job, NULL); if (ret < 0) { - rte_exit(1, "Failed to add flush job for lcore %u: %s", + rte_exit(1, "Failed to reset flush job timer for lcore %u: %s", lcore_id, rte_strerror(-ret)); } @@ -1019,8 +1019,13 @@ main(int argc, char **argv) rte_jobstats_set_update_period_function(job, l2fwd_job_update_cb); rte_timer_init(&qconf->rx_timers[i]); - rte_timer_reset(&qconf->rx_timers[i], 0, PERIODICAL, lcore_id, + ret = rte_timer_reset(&qconf->rx_timers[i], 0, PERIODICAL, lcore_id, &l2fwd_fwd_job, (void *)(uintptr_t)i); + + if (ret < 0) { + rte_exit(1, "Failed to reset lcore %u port %u job timer: %s", + lcore_id, qconf->rx_port_list[i], rte_strerror(-ret)); + } } }