Enqueue indirect action query operation. */
| 3215 | |
| 3216 | /** Enqueue indirect action query operation. */ |
| 3217 | int |
| 3218 | port_queue_action_handle_query(portid_t port_id, |
| 3219 | uint32_t queue_id, bool postpone, uint32_t id) |
| 3220 | { |
| 3221 | const struct rte_flow_op_attr attr = { .postpone = postpone}; |
| 3222 | struct rte_port *port; |
| 3223 | struct rte_flow_error error; |
| 3224 | struct rte_flow_action_handle *action_handle; |
| 3225 | struct port_indirect_action *pia; |
| 3226 | struct queue_job *job; |
| 3227 | |
| 3228 | pia = action_get_by_id(port_id, id); |
| 3229 | action_handle = pia ? pia->handle : NULL; |
| 3230 | if (!action_handle) |
| 3231 | return -EINVAL; |
| 3232 | |
| 3233 | port = &ports[port_id]; |
| 3234 | if (queue_id >= port->queue_nb) { |
| 3235 | printf("Queue #%u is invalid\n", queue_id); |
| 3236 | return -EINVAL; |
| 3237 | } |
| 3238 | |
| 3239 | job = calloc(1, sizeof(*job)); |
| 3240 | if (!job) { |
| 3241 | printf("Queue action update job allocate failed\n"); |
| 3242 | return -ENOMEM; |
| 3243 | } |
| 3244 | job->type = QUEUE_JOB_TYPE_ACTION_QUERY; |
| 3245 | job->pia = pia; |
| 3246 | |
| 3247 | if (rte_flow_async_action_handle_query(port_id, queue_id, &attr, |
| 3248 | action_handle, &job->query, job, &error)) { |
| 3249 | free(job); |
| 3250 | return port_flow_complain(&error); |
| 3251 | } |
| 3252 | printf("Indirect action #%u update queued\n", id); |
| 3253 | return 0; |
| 3254 | } |
| 3255 | |
| 3256 | /** Push all the queue operations in the queue to the NIC. */ |
| 3257 | int |
no test coverage detected