struct multi_cores_pool {
uint32_t cores_count;
uint32_t rules_count;
- struct used_cpu_time create_meter;
- struct used_cpu_time create_flow;
+ struct used_cpu_time meters_record;
+ struct used_cpu_time flows_record;
int64_t last_alloc[RTE_MAX_LCORE];
int64_t current_alloc[RTE_MAX_LCORE];
} __rte_cache_aligned;
for (i = 0; i < RTE_DIM(flow_options); i++) {
if (strcmp(flow_options[i].str, token) == 0) {
printf("%s,", token);
- encap_data |= flow_options[i].mask;
+ decap_data |= flow_options[i].mask;
break;
}
/* Reached last item with no match */
/*create meter*/
params.meter_profile_id = default_prof_id;
- params.action[RTE_COLOR_GREEN] =
- MTR_POLICER_ACTION_COLOR_GREEN;
- params.action[RTE_COLOR_YELLOW] =
- MTR_POLICER_ACTION_COLOR_YELLOW;
- params.action[RTE_COLOR_RED] =
- MTR_POLICER_ACTION_DROP;
-
ret = rte_mtr_create(port_id, counter, ¶ms, 1, &error);
if (ret != 0) {
printf("Port %u create meter idx(%d) error(%d) message: %s\n",
cpu_time_used, insertion_rate);
if (ops == METER_CREATE)
- mc_pool.create_meter.insertion[port_id][core_id]
+ mc_pool.meters_record.insertion[port_id][core_id]
= cpu_time_used;
else
- mc_pool.create_meter.deletion[port_id][core_id]
+ mc_pool.meters_record.deletion[port_id][core_id]
= cpu_time_used;
}
printf(":: Port %d :: Core %d :: The time for deleting %d rules is %f seconds\n",
port_id, core_id, rules_count_per_core, cpu_time_used);
- mc_pool.create_flow.deletion[port_id][core_id] = cpu_time_used;
+ mc_pool.flows_record.deletion[port_id][core_id] = cpu_time_used;
}
static struct rte_flow **
struct rte_flow **flows_list;
struct rte_flow_error error;
clock_t start_batch, end_batch;
+ double first_flow_latency;
double cpu_time_used;
double insertion_rate;
double cpu_time_per_batch[MAX_BATCHES_COUNT] = { 0 };
encap_data, decap_data,
core_id, unique_data, &error);
+ if (!counter) {
+ first_flow_latency = (double) (rte_get_timer_cycles() - start_batch);
+ first_flow_latency /= rte_get_timer_hz();
+ /* In millisecond */
+ first_flow_latency *= 1000;
+ printf(":: First Flow Latency :: Port %d :: First flow "
+ "installed in %f milliseconds\n",
+ port_id, first_flow_latency);
+ }
+
if (force_quit)
counter = end_counter;
printf(":: Port %d :: Core %d :: The time for creating %d in rules %f seconds\n",
port_id, core_id, rules_count_per_core, cpu_time_used);
- mc_pool.create_flow.insertion[port_id][core_id] = cpu_time_used;
+ mc_pool.flows_record.insertion[port_id][core_id] = cpu_time_used;
return flows_list;
}
rte_eal_mp_wait_lcore();
RTE_ETH_FOREACH_DEV(port) {
+ /* If port outside portmask */
+ if (!((ports_mask >> port) & 0x1))
+ continue;
if (has_meter())
dump_used_cpu_time("Meters:",
- port, &mc_pool.create_meter);
+ port, &mc_pool.meters_record);
dump_used_cpu_time("Flows:",
- port, &mc_pool.create_flow);
+ port, &mc_pool.flows_record);
dump_used_mem(port);
}