Flush actions template */
| 2499 | |
| 2500 | /** Flush actions template */ |
| 2501 | int |
| 2502 | port_flow_actions_template_flush(portid_t port_id) |
| 2503 | { |
| 2504 | struct rte_port *port; |
| 2505 | struct port_template **tmp; |
| 2506 | int ret = 0; |
| 2507 | |
| 2508 | if (port_id_is_invalid(port_id, ENABLED_WARN) || |
| 2509 | port_id == (portid_t)RTE_PORT_ALL) |
| 2510 | return -EINVAL; |
| 2511 | port = &ports[port_id]; |
| 2512 | tmp = &port->actions_templ_list; |
| 2513 | while (*tmp) { |
| 2514 | struct rte_flow_error error; |
| 2515 | struct port_template *pat = *tmp; |
| 2516 | |
| 2517 | /* |
| 2518 | * Poisoning to make sure PMDs update it in case |
| 2519 | * of error. |
| 2520 | */ |
| 2521 | memset(&error, 0x33, sizeof(error)); |
| 2522 | |
| 2523 | if (pat->template.actions_template && |
| 2524 | rte_flow_actions_template_destroy(port_id, |
| 2525 | pat->template.actions_template, &error)) { |
| 2526 | ret = port_flow_complain(&error); |
| 2527 | printf("Actions template #%u not destroyed\n", pat->id); |
| 2528 | tmp = &pat->next; |
| 2529 | } else { |
| 2530 | *tmp = pat->next; |
| 2531 | free(pat); |
| 2532 | } |
| 2533 | } |
| 2534 | return ret; |
| 2535 | } |
| 2536 | |
| 2537 | /** Create table */ |
| 2538 | int |