git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
event/cnxk: add timer arm routine
[dpdk.git]
/
drivers
/
event
/
opdl
/
opdl_evdev_xstats.c
diff --git
a/drivers/event/opdl/opdl_evdev_xstats.c
b/drivers/event/opdl/opdl_evdev_xstats.c
index
94dfeee
..
27b3d88
100644
(file)
--- a/
drivers/event/opdl/opdl_evdev_xstats.c
+++ b/
drivers/event/opdl/opdl_evdev_xstats.c
@@
-1,6
+1,5
@@
-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
*/
#include "opdl_evdev.h"
*/
#include "opdl_evdev.h"
@@
-33,10
+32,9
@@
opdl_xstats_init(struct rte_eventdev *dev)
uint32_t index = (i * max_num_port_xstat) + j;
/* Name */
uint32_t index = (i * max_num_port_xstat) + j;
/* Name */
- sprintf(device->port_xstat[index].stat.name,
- "port_%02u_%s",
- i,
- port_xstat_str[j]);
+ snprintf(device->port_xstat[index].stat.name,
+ sizeof(device->port_xstat[index].stat.name),
+ "port_%02u_%s", i, port_xstat_str[j]);
/* ID */
device->port_xstat[index].id = index;
/* ID */
device->port_xstat[index].id = index;
@@
-86,7
+84,8
@@
opdl_xstats_get_names(const struct rte_eventdev *dev,
uint32_t port_idx = queue_port_id * max_num_port_xstat;
uint32_t port_idx = queue_port_id * max_num_port_xstat;
- for (uint32_t j = 0; j < max_num_port_xstat; j++) {
+ uint32_t j;
+ for (j = 0; j < max_num_port_xstat; j++) {
strcpy(xstats_names[j].name,
device->port_xstat[j + port_idx].stat.name);
strcpy(xstats_names[j].name,
device->port_xstat[j + port_idx].stat.name);
@@
-121,7
+120,8
@@
opdl_xstats_get(const struct rte_eventdev *dev,
uint32_t p_start = queue_port_id * max_num_port_xstat;
uint32_t p_finish = p_start + max_num_port_xstat;
uint32_t p_start = queue_port_id * max_num_port_xstat;
uint32_t p_finish = p_start + max_num_port_xstat;
- for (uint32_t i = 0; i < n; i++) {
+ uint32_t i;
+ for (i = 0; i < n; i++) {
if (ids[i] < p_start || ids[i] >= p_finish)
return -EINVAL;
if (ids[i] < p_start || ids[i] >= p_finish)
return -EINVAL;
@@
-142,7
+142,8
@@
opdl_xstats_get_by_name(const struct rte_eventdev *dev,
uint32_t max_index = device->max_port_nb * max_num_port_xstat;
uint32_t max_index = device->max_port_nb * max_num_port_xstat;
- for (uint32_t i = 0; i < max_index; i++) {
+ uint32_t i;
+ for (i = 0; i < max_index; i++) {
if (strncmp(name,
device->port_xstat[i].stat.name,
if (strncmp(name,
device->port_xstat[i].stat.name,