bitrate: use common macro RTE_DIM
Use RTE_DIM instead of re-defining ARRAY_SIZE. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
This commit is contained in:
parent
8ada5b15a9
commit
f1c16d40ed
@ -8,8 +8,6 @@
|
||||
#include <rte_metrics.h>
|
||||
#include <rte_bitrate.h>
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
/*
|
||||
* Persistent bit-rate data.
|
||||
* @internal
|
||||
@ -50,7 +48,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data)
|
||||
if (bitrate_data == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
return_value = rte_metrics_reg_names(&names[0], ARRAY_SIZE(names));
|
||||
return_value = rte_metrics_reg_names(&names[0], RTE_DIM(names));
|
||||
if (return_value >= 0)
|
||||
bitrate_data->id_stats_set = return_value;
|
||||
return return_value;
|
||||
@ -126,7 +124,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data,
|
||||
values[4] = port_data->peak_ibits;
|
||||
values[5] = port_data->peak_obits;
|
||||
ret = rte_metrics_update_values(port_id, bitrate_data->id_stats_set,
|
||||
values, ARRAY_SIZE(values));
|
||||
values, RTE_DIM(values));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user