From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E9B7A046B for ; Thu, 27 Jun 2019 21:51:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7EBE5F64; Thu, 27 Jun 2019 21:51:52 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8BEE9DED; Thu, 27 Jun 2019 21:51:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 12:51:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,424,1557212400"; d="scan'208";a="153152126" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.223.78]) by orsmga007.jf.intel.com with ESMTP; 27 Jun 2019 12:51:46 -0700 From: Ferruh Yigit To: Thomas Monjalon , Kevin Laatz Cc: dev@dpdk.org, stable@dpdk.org, Reshma Pattan , Flavia Musatescu Date: Thu, 27 Jun 2019 20:51:44 +0100 Message-Id: <20190627195144.89720-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] telemetry: fix build 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" Build error: ../lib/librte_telemetry/rte_telemetry.c:558:28: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] Build error not observed in default make build because telemetry library disabled by default but easier to reproduce via meson. Fixing by converting unsigned variables to signed. Fixes: 0fe3a37924d4 ("telemetry: format json response when sending stats") Fixes: 4080e46c8078 ("telemetry: support global metrics") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: Reshma Pattan Cc: Flavia Musatescu --- lib/librte_telemetry/rte_telemetry.c | 12 ++++++------ lib/librte_telemetry/rte_telemetry_internal.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/librte_telemetry/rte_telemetry.c b/lib/librte_telemetry/rte_telemetry.c index a4b82c97f..949c63612 100644 --- a/lib/librte_telemetry/rte_telemetry.c +++ b/lib/librte_telemetry/rte_telemetry.c @@ -318,13 +318,13 @@ rte_telemetry_json_format_stat(struct telemetry_impl *telemetry, json_t *stats, static int32_t rte_telemetry_json_format_port(struct telemetry_impl *telemetry, uint32_t port_id, json_t *ports, uint32_t *metric_ids, - uint32_t num_metric_ids) + int num_metric_ids) { struct rte_metric_value *metrics = 0; struct rte_metric_name *names = 0; int num_metrics, ret, err_ret; json_t *port, *stats; - uint32_t i; + int i; num_metrics = rte_metrics_get_names(NULL, 0); if (num_metrics < 0) { @@ -453,10 +453,10 @@ rte_telemetry_encode_json_format(struct telemetry_impl *telemetry, { int ret; json_t *root, *ports; - uint32_t i; + int i; uint32_t port_id; - uint32_t num_port_ids; - uint32_t num_metric_ids; + int num_port_ids; + int num_metric_ids; ports = json_array(); if (ports == NULL) { @@ -589,7 +589,7 @@ rte_telemetry_send_ports_stats_values(struct telemetry_encode_param *ep, int ret; char *json_buffer = NULL; uint32_t port_id; - unsigned int i; + int i; if (telemetry == NULL) { TELEMETRY_LOG_ERR("Invalid telemetry argument"); diff --git a/lib/librte_telemetry/rte_telemetry_internal.h b/lib/librte_telemetry/rte_telemetry_internal.h index 6a91d0c44..ce1ee8865 100644 --- a/lib/librte_telemetry/rte_telemetry_internal.h +++ b/lib/librte_telemetry/rte_telemetry_internal.h @@ -60,13 +60,13 @@ struct telemetry_encode_param { enum rte_telemetry_stats_type type; union { struct port_param { - uint32_t num_metric_ids; + int num_metric_ids; uint32_t metric_ids[MAX_METRICS]; - uint32_t num_port_ids; + int num_port_ids; uint32_t port_ids[RTE_MAX_ETHPORTS]; } pp; struct global_param { - uint32_t num_metric_ids; + int num_metric_ids; uint32_t metric_ids[MAX_METRICS]; } gp; }; -- 2.21.0