- int i, j, count = 0;
-
- for (i = 0; i < g_configuration->num_ports; i++) {
- cdtime_t time = g_configuration->port_read_time[i];
- char dev_name[64];
- int len = g_configuration->num_stats_in_port[i];
- ssnprintf(dev_name, sizeof(dev_name), "port.%d", i);
- struct rte_eth_xstats *xstats = (&g_configuration->xstats);
- xstats += count; /* pointer arithmetic to jump to each stats struct */
- for (j = 0; j < len; j++) {
- value_t dpdkstat_values[1];
- value_list_t dpdkstat_vl = VALUE_LIST_INIT;
-
- dpdkstat_values[0].counter = xstats[j].value;
- dpdkstat_vl.values = dpdkstat_values;
- dpdkstat_vl.values_len = 1; /* Submit stats one at a time */
- dpdkstat_vl.time = time;
- sstrncpy (dpdkstat_vl.host, hostname_g, sizeof (dpdkstat_vl.host));
- sstrncpy (dpdkstat_vl.plugin, "dpdkstat", sizeof (dpdkstat_vl.plugin));
- sstrncpy (dpdkstat_vl.plugin_instance, dev_name,
- sizeof (dpdkstat_vl.plugin_instance));
- sstrncpy (dpdkstat_vl.type, "counter",
- sizeof (dpdkstat_vl.type));
- sstrncpy (dpdkstat_vl.type_instance, xstats[j].name,
- sizeof (dpdkstat_vl.type_instance));
- plugin_dispatch_values (&dpdkstat_vl);
- }
- count += len;
- } /* for each port */
+ int count = 0;
+
+ for (int i = 0; i < g_configuration->num_ports; i++) {
+ cdtime_t time = g_configuration->port_read_time[i];
+ char dev_name[64];
+ int len = g_configuration->num_stats_in_port[i];
+ ssnprintf(dev_name, sizeof(dev_name), "port.%d", i);
+ struct rte_eth_xstats *xstats = (&g_configuration->xstats);
+ xstats += count; /* pointer arithmetic to jump to each stats struct */
+ for (int j = 0; j < len; j++) {
+ value_t dpdkstat_values[1];
+ value_list_t dpdkstat_vl = VALUE_LIST_INIT
+
+ dpdkstat_values[0].counter = xstats[j].value;
+ dpdkstat_vl.values = dpdkstat_values;
+ dpdkstat_vl.values_len = 1; /* Submit stats one at a time */
+ dpdkstat_vl.time = time;
+ sstrncpy (dpdkstat_vl.host, hostname_g, sizeof (dpdkstat_vl.host));
+ sstrncpy (dpdkstat_vl.plugin, "dpdkstat", sizeof (dpdkstat_vl.plugin));
+ sstrncpy (dpdkstat_vl.plugin_instance, dev_name,
+ sizeof (dpdkstat_vl.plugin_instance));
+ sstrncpy (dpdkstat_vl.type, "counter",
+ sizeof (dpdkstat_vl.type));
+ sstrncpy (dpdkstat_vl.type_instance, xstats[j].name,
+ sizeof (dpdkstat_vl.type_instance));
+ plugin_dispatch_values (&dpdkstat_vl);
+ }
+ count += len;
+ } /* for each port */