| 1497 | } |
| 1498 | |
| 1499 | static void |
| 1500 | flows_handler(uint8_t core_id) |
| 1501 | { |
| 1502 | struct rte_flow **flows_list; |
| 1503 | uint16_t port_idx = 0; |
| 1504 | uint16_t nr_ports; |
| 1505 | int port_id; |
| 1506 | |
| 1507 | nr_ports = rte_eth_dev_count_avail(); |
| 1508 | |
| 1509 | if (rules_batch > rules_count) |
| 1510 | rules_batch = rules_count; |
| 1511 | |
| 1512 | printf(":: Rules Count per port: %d\n\n", rules_count); |
| 1513 | |
| 1514 | for (port_id = 0; port_id < nr_ports; port_id++) { |
| 1515 | /* If port outside portmask */ |
| 1516 | if (!((ports_mask >> port_id) & 0x1)) |
| 1517 | continue; |
| 1518 | |
| 1519 | /* Insertion part. */ |
| 1520 | mc_pool.last_alloc[core_id] = (int64_t)dump_socket_mem(stdout); |
| 1521 | if (has_meter()) |
| 1522 | meters_handler(port_id, core_id, METER_CREATE); |
| 1523 | flows_list = insert_flows(port_id, core_id, |
| 1524 | dst_ports[port_idx++]); |
| 1525 | if (flows_list == NULL) |
| 1526 | rte_exit(EXIT_FAILURE, "Error: Insertion Failed!\n"); |
| 1527 | mc_pool.current_alloc[core_id] = (int64_t)dump_socket_mem(stdout); |
| 1528 | |
| 1529 | /* Deletion part. */ |
| 1530 | if (delete_flag) { |
| 1531 | destroy_flows(port_id, core_id, flows_list); |
| 1532 | if (has_meter()) |
| 1533 | meters_handler(port_id, core_id, METER_DELETE); |
| 1534 | } |
| 1535 | } |
| 1536 | } |
| 1537 | |
| 1538 | static void |
| 1539 | dump_used_cpu_time(const char *item, |
no test coverage detected