MCPcopy Create free account
hub / github.com/F-Stack/f-stack / port_queue_action_handle_query

Function port_queue_action_handle_query

dpdk/app/test-pmd/config.c:3217–3254  ·  view source on GitHub ↗

Enqueue indirect action query operation. */

Source from the content-addressed store, hash-verified

3215
3216/** Enqueue indirect action query operation. */
3217int
3218port_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. */
3257int

Callers 1

cmd_flow_parsedFunction · 0.85

Calls 6

action_get_by_idFunction · 0.85
callocFunction · 0.85
port_flow_complainFunction · 0.70
printfFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected