| 2070 | } |
| 2071 | |
| 2072 | int |
| 2073 | port_action_handle_query(portid_t port_id, uint32_t id) |
| 2074 | { |
| 2075 | struct rte_flow_error error; |
| 2076 | struct port_indirect_action *pia; |
| 2077 | union port_action_query query; |
| 2078 | |
| 2079 | pia = action_get_by_id(port_id, id); |
| 2080 | if (!pia) |
| 2081 | return -EINVAL; |
| 2082 | switch (pia->type) { |
| 2083 | case RTE_FLOW_ACTION_TYPE_AGE: |
| 2084 | case RTE_FLOW_ACTION_TYPE_COUNT: |
| 2085 | case RTE_FLOW_ACTION_TYPE_QUOTA: |
| 2086 | break; |
| 2087 | default: |
| 2088 | fprintf(stderr, |
| 2089 | "Indirect action %u (type: %d) on port %u doesn't support query\n", |
| 2090 | id, pia->type, port_id); |
| 2091 | return -ENOTSUP; |
| 2092 | } |
| 2093 | /* Poisoning to make sure PMDs update it in case of error. */ |
| 2094 | memset(&error, 0x55, sizeof(error)); |
| 2095 | memset(&query, 0, sizeof(query)); |
| 2096 | if (rte_flow_action_handle_query(port_id, pia->handle, &query, &error)) |
| 2097 | return port_flow_complain(&error); |
| 2098 | port_action_handle_query_dump(port_id, pia, &query); |
| 2099 | return 0; |
| 2100 | } |
| 2101 | |
| 2102 | static struct port_flow_tunnel * |
| 2103 | port_flow_tunnel_offload_cmd_prep(portid_t port_id, |
no test coverage detected