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

Function port_queue_action_handle_update

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

Enqueue indirect action update operation. */

Source from the content-addressed store, hash-verified

3112
3113/** Enqueue indirect action update operation. */
3114int
3115port_queue_action_handle_update(portid_t port_id,
3116 uint32_t queue_id, bool postpone, uint32_t id,
3117 const struct rte_flow_action *action)
3118{
3119 const struct rte_flow_op_attr attr = { .postpone = postpone};
3120 struct rte_port *port;
3121 struct rte_flow_error error;
3122 struct rte_flow_action_handle *action_handle;
3123 struct queue_job *job;
3124 struct port_indirect_action *pia;
3125 struct rte_flow_update_meter_mark mtr_update;
3126 const void *update;
3127
3128 action_handle = port_action_handle_get_by_id(port_id, id);
3129 if (!action_handle)
3130 return -EINVAL;
3131
3132 port = &ports[port_id];
3133 if (queue_id >= port->queue_nb) {
3134 printf("Queue #%u is invalid\n", queue_id);
3135 return -EINVAL;
3136 }
3137
3138 job = calloc(1, sizeof(*job));
3139 if (!job) {
3140 printf("Queue action update job allocate failed\n");
3141 return -ENOMEM;
3142 }
3143 job->type = QUEUE_JOB_TYPE_ACTION_UPDATE;
3144
3145 pia = action_get_by_id(port_id, id);
3146 if (!pia) {
3147 free(job);
3148 return -EINVAL;
3149 }
3150
3151 switch (pia->type) {
3152 case RTE_FLOW_ACTION_TYPE_AGE:
3153 update = action->conf;
3154 break;
3155 case RTE_FLOW_ACTION_TYPE_METER_MARK:
3156 rte_memcpy(&mtr_update.meter_mark, action->conf,
3157 sizeof(struct rte_flow_action_meter_mark));
3158 if (mtr_update.meter_mark.profile)
3159 mtr_update.profile_valid = 1;
3160 if (mtr_update.meter_mark.policy)
3161 mtr_update.policy_valid = 1;
3162 mtr_update.color_mode_valid = 1;
3163 mtr_update.state_valid = 1;
3164 update = &mtr_update;
3165 break;
3166 default:
3167 update = action;
3168 break;
3169 }
3170
3171 if (rte_flow_async_action_handle_update(port_id, queue_id, &attr,

Callers 1

cmd_flow_parsedFunction · 0.85

Calls 8

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

Tested by

no test coverage detected