| 1873 | } |
| 1874 | |
| 1875 | int |
| 1876 | port_action_handle_flush(portid_t port_id) |
| 1877 | { |
| 1878 | struct rte_port *port; |
| 1879 | struct port_indirect_action **tmp; |
| 1880 | int ret = 0; |
| 1881 | |
| 1882 | if (port_id_is_invalid(port_id, ENABLED_WARN) || |
| 1883 | port_id == (portid_t)RTE_PORT_ALL) |
| 1884 | return -EINVAL; |
| 1885 | port = &ports[port_id]; |
| 1886 | tmp = &port->actions_list; |
| 1887 | while (*tmp != NULL) { |
| 1888 | struct rte_flow_error error; |
| 1889 | struct port_indirect_action *pia = *tmp; |
| 1890 | |
| 1891 | /* Poisoning to make sure PMDs update it in case of error. */ |
| 1892 | memset(&error, 0x44, sizeof(error)); |
| 1893 | if (pia->handle != NULL) { |
| 1894 | ret = pia->type == RTE_FLOW_ACTION_TYPE_INDIRECT_LIST ? |
| 1895 | rte_flow_action_list_handle_destroy |
| 1896 | (port_id, pia->list_handle, &error) : |
| 1897 | rte_flow_action_handle_destroy |
| 1898 | (port_id, pia->handle, &error); |
| 1899 | if (ret) { |
| 1900 | printf("Indirect action #%u not destroyed\n", |
| 1901 | pia->id); |
| 1902 | ret = port_flow_complain(&error); |
| 1903 | } |
| 1904 | } |
| 1905 | *tmp = pia->next; |
| 1906 | free(pia); |
| 1907 | } |
| 1908 | return ret; |
| 1909 | } |
| 1910 | |
| 1911 | /** Get indirect action by port + id */ |
| 1912 | struct rte_flow_action_handle * |