Flush pattern template */
| 2385 | |
| 2386 | /** Flush pattern template */ |
| 2387 | int |
| 2388 | port_flow_pattern_template_flush(portid_t port_id) |
| 2389 | { |
| 2390 | struct rte_port *port; |
| 2391 | struct port_template **tmp; |
| 2392 | int ret = 0; |
| 2393 | |
| 2394 | if (port_id_is_invalid(port_id, ENABLED_WARN) || |
| 2395 | port_id == (portid_t)RTE_PORT_ALL) |
| 2396 | return -EINVAL; |
| 2397 | port = &ports[port_id]; |
| 2398 | tmp = &port->pattern_templ_list; |
| 2399 | while (*tmp) { |
| 2400 | struct rte_flow_error error; |
| 2401 | struct port_template *pit = *tmp; |
| 2402 | |
| 2403 | /* |
| 2404 | * Poisoning to make sure PMDs update it in case |
| 2405 | * of error. |
| 2406 | */ |
| 2407 | memset(&error, 0x33, sizeof(error)); |
| 2408 | if (pit->template.pattern_template && |
| 2409 | rte_flow_pattern_template_destroy(port_id, |
| 2410 | pit->template.pattern_template, &error)) { |
| 2411 | printf("Pattern template #%u not destroyed\n", pit->id); |
| 2412 | ret = port_flow_complain(&error); |
| 2413 | tmp = &pit->next; |
| 2414 | } else { |
| 2415 | *tmp = pit->next; |
| 2416 | free(pit); |
| 2417 | } |
| 2418 | } |
| 2419 | return ret; |
| 2420 | } |
| 2421 | |
| 2422 | /** Create actions template */ |
| 2423 | int |