Flush table */
| 2664 | |
| 2665 | /** Flush table */ |
| 2666 | int |
| 2667 | port_flow_template_table_flush(portid_t port_id) |
| 2668 | { |
| 2669 | struct rte_port *port; |
| 2670 | struct port_table **tmp; |
| 2671 | int ret = 0; |
| 2672 | |
| 2673 | if (port_id_is_invalid(port_id, ENABLED_WARN) || |
| 2674 | port_id == (portid_t)RTE_PORT_ALL) |
| 2675 | return -EINVAL; |
| 2676 | port = &ports[port_id]; |
| 2677 | tmp = &port->table_list; |
| 2678 | while (*tmp) { |
| 2679 | struct rte_flow_error error; |
| 2680 | struct port_table *pt = *tmp; |
| 2681 | |
| 2682 | /* |
| 2683 | * Poisoning to make sure PMDs update it in case |
| 2684 | * of error. |
| 2685 | */ |
| 2686 | memset(&error, 0x33, sizeof(error)); |
| 2687 | |
| 2688 | if (pt->table && |
| 2689 | rte_flow_template_table_destroy(port_id, |
| 2690 | pt->table, |
| 2691 | &error)) { |
| 2692 | ret = port_flow_complain(&error); |
| 2693 | printf("Template table #%u not destroyed\n", pt->id); |
| 2694 | tmp = &pt->next; |
| 2695 | } else { |
| 2696 | *tmp = pt->next; |
| 2697 | free(pt); |
| 2698 | } |
| 2699 | } |
| 2700 | return ret; |
| 2701 | } |
| 2702 | |
| 2703 | /** Enqueue create flow rule operation. */ |
| 2704 | int |