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

Function port_flow_actions_template_create

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

Create actions template */

Source from the content-addressed store, hash-verified

2421
2422/** Create actions template */
2423int
2424port_flow_actions_template_create(portid_t port_id, uint32_t id,
2425 const struct rte_flow_actions_template_attr *attr,
2426 const struct rte_flow_action *actions,
2427 const struct rte_flow_action *masks)
2428{
2429 struct rte_port *port;
2430 struct port_template *pat;
2431 int ret;
2432 struct rte_flow_error error;
2433
2434 if (port_id_is_invalid(port_id, ENABLED_WARN) ||
2435 port_id == (portid_t)RTE_PORT_ALL)
2436 return -EINVAL;
2437 port = &ports[port_id];
2438 ret = template_alloc(id, &pat, &port->actions_templ_list);
2439 if (ret)
2440 return ret;
2441 /* Poisoning to make sure PMDs update it in case of error. */
2442 memset(&error, 0x22, sizeof(error));
2443 pat->template.actions_template = rte_flow_actions_template_create(port_id,
2444 attr, actions, masks, &error);
2445 if (!pat->template.actions_template) {
2446 uint32_t destroy_id = pat->id;
2447 port_flow_actions_template_destroy(port_id, 1, &destroy_id);
2448 return port_flow_complain(&error);
2449 }
2450 printf("Actions template #%u created\n", pat->id);
2451 return 0;
2452}
2453
2454/** Destroy actions template */
2455int

Callers 1

cmd_flow_parsedFunction · 0.85

Calls 7

port_id_is_invalidFunction · 0.85
template_allocFunction · 0.85
memsetFunction · 0.85
port_flow_complainFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected