DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] telemetry: fix build
@ 2019-06-27 19:51 Ferruh Yigit
  2019-06-28  8:46 ` Laatz, Kevin
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2019-06-27 19:51 UTC (permalink / raw)
  To: Thomas Monjalon, Kevin Laatz; +Cc: dev, stable, Reshma Pattan, Flavia Musatescu

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 <ferruh.yigit@intel.com>
---
Cc: Reshma Pattan <reshma.pattan@intel.com>
Cc: Flavia Musatescu <flavia.musatescu@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] telemetry: fix build
  2019-06-27 19:51 [dpdk-dev] [PATCH] telemetry: fix build Ferruh Yigit
@ 2019-06-28  8:46 ` Laatz, Kevin
  2019-06-28  9:17   ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Laatz, Kevin @ 2019-06-28  8:46 UTC (permalink / raw)
  To: Ferruh Yigit, Thomas Monjalon
  Cc: dev, stable, Reshma Pattan, Flavia Musatescu


On 27/06/2019 20:51, Ferruh Yigit wrote:
> 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 <ferruh.yigit@intel.com>
> ---
> Cc: Reshma Pattan <reshma.pattan@intel.com>
> Cc: Flavia Musatescu <flavia.musatescu@intel.com>
> ---
>   lib/librte_telemetry/rte_telemetry.c          | 12 ++++++------
>   lib/librte_telemetry/rte_telemetry_internal.h |  6 +++---
>   2 files changed, 9 insertions(+), 9 deletions(-)

Acked-by: Kevin Laatz <kevin.laatz@intel.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] telemetry: fix build
  2019-06-28  8:46 ` Laatz, Kevin
@ 2019-06-28  9:17   ` Thomas Monjalon
  2019-06-28  9:55     ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-06-28  9:17 UTC (permalink / raw)
  To: Laatz, Kevin, Ferruh Yigit; +Cc: dev, stable, Reshma Pattan, Flavia Musatescu

28/06/2019 10:46, Laatz, Kevin:
> 
> On 27/06/2019 20:51, Ferruh Yigit wrote:
> > 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.

No, I compile telemetry with make and with meson.
I cannot reproduce the error. I guess it depends of the compiler version?

> > 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 <ferruh.yigit@intel.com>
> > ---
> > Cc: Reshma Pattan <reshma.pattan@intel.com>
> > Cc: Flavia Musatescu <flavia.musatescu@intel.com>
> > ---
> >   lib/librte_telemetry/rte_telemetry.c          | 12 ++++++------
> >   lib/librte_telemetry/rte_telemetry_internal.h |  6 +++---
> >   2 files changed, 9 insertions(+), 9 deletions(-)
> 
> Acked-by: Kevin Laatz <kevin.laatz@intel.com>

Applied, thanks



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] telemetry: fix build
  2019-06-28  9:17   ` Thomas Monjalon
@ 2019-06-28  9:55     ` Ferruh Yigit
  2019-06-28  9:57       ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2019-06-28  9:55 UTC (permalink / raw)
  To: Thomas Monjalon, Laatz, Kevin
  Cc: dev, stable, Reshma Pattan, Flavia Musatescu

On 6/28/2019 10:17 AM, Thomas Monjalon wrote:
> 28/06/2019 10:46, Laatz, Kevin:
>>
>> On 27/06/2019 20:51, Ferruh Yigit wrote:
>>> 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.
> 
> No, I compile telemetry with make and with meson.
> I cannot reproduce the error. I guess it depends of the compiler version?

At least I am seeing this via clang 4.0.1

> 
>>> 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 <ferruh.yigit@intel.com>
>>> ---
>>> Cc: Reshma Pattan <reshma.pattan@intel.com>
>>> Cc: Flavia Musatescu <flavia.musatescu@intel.com>
>>> ---
>>>   lib/librte_telemetry/rte_telemetry.c          | 12 ++++++------
>>>   lib/librte_telemetry/rte_telemetry_internal.h |  6 +++---
>>>   2 files changed, 9 insertions(+), 9 deletions(-)
>>
>> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
> 
> Applied, thanks
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] telemetry: fix build
  2019-06-28  9:55     ` Ferruh Yigit
@ 2019-06-28  9:57       ` Thomas Monjalon
  2019-06-28 10:28         ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-06-28  9:57 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Laatz, Kevin, dev, stable, Reshma Pattan, Flavia Musatescu

28/06/2019 11:55, Ferruh Yigit:
> On 6/28/2019 10:17 AM, Thomas Monjalon wrote:
> > 28/06/2019 10:46, Laatz, Kevin:
> >>
> >> On 27/06/2019 20:51, Ferruh Yigit wrote:
> >>> 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.
> > 
> > No, I compile telemetry with make and with meson.
> > I cannot reproduce the error. I guess it depends of the compiler version?
> 
> At least I am seeing this via clang 4.0.1

clang version 8.0.0 here.
Go update your machine :)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] telemetry: fix build
  2019-06-28  9:57       ` Thomas Monjalon
@ 2019-06-28 10:28         ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2019-06-28 10:28 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Laatz, Kevin, dev, stable, Reshma Pattan, Flavia Musatescu

On 6/28/2019 10:57 AM, Thomas Monjalon wrote:
> 28/06/2019 11:55, Ferruh Yigit:
>> On 6/28/2019 10:17 AM, Thomas Monjalon wrote:
>>> 28/06/2019 10:46, Laatz, Kevin:
>>>>
>>>> On 27/06/2019 20:51, Ferruh Yigit wrote:
>>>>> 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.
>>>
>>> No, I compile telemetry with make and with meson.
>>> I cannot reproduce the error. I guess it depends of the compiler version?
>>
>> At least I am seeing this via clang 4.0.1
> 
> clang version 8.0.0 here.
> Go update your machine :)
> 

But I believe the warning is valid, no idea why clang 8 is not warning


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-28 10:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 19:51 [dpdk-dev] [PATCH] telemetry: fix build Ferruh Yigit
2019-06-28  8:46 ` Laatz, Kevin
2019-06-28  9:17   ` Thomas Monjalon
2019-06-28  9:55     ` Ferruh Yigit
2019-06-28  9:57       ` Thomas Monjalon
2019-06-28 10:28         ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).