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

Function port_flow_validate

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

Validate flow rule. */

Source from the content-addressed store, hash-verified

2258
2259/** Validate flow rule. */
2260int
2261port_flow_validate(portid_t port_id,
2262 const struct rte_flow_attr *attr,
2263 const struct rte_flow_item *pattern,
2264 const struct rte_flow_action *actions,
2265 const struct tunnel_ops *tunnel_ops)
2266{
2267 struct rte_flow_error error;
2268 struct port_flow_tunnel *pft = NULL;
2269 int ret;
2270
2271 /* Poisoning to make sure PMDs update it in case of error. */
2272 memset(&error, 0x11, sizeof(error));
2273 if (tunnel_ops->enabled) {
2274 pft = port_flow_tunnel_offload_cmd_prep(port_id, pattern,
2275 actions, tunnel_ops);
2276 if (!pft)
2277 return -ENOENT;
2278 if (pft->items)
2279 pattern = pft->items;
2280 if (pft->actions)
2281 actions = pft->actions;
2282 }
2283 ret = rte_flow_validate(port_id, attr, pattern, actions, &error);
2284 if (tunnel_ops->enabled)
2285 port_flow_tunnel_offload_cmd_release(port_id, tunnel_ops, pft);
2286 if (ret)
2287 return port_flow_complain(&error);
2288 printf("Flow rule validated\n");
2289 return 0;
2290}
2291
2292/** Return age action structure if exists, otherwise NULL. */
2293static struct rte_flow_action_age *

Callers 1

cmd_flow_parsedFunction · 0.85

Calls 6

memsetFunction · 0.85
rte_flow_validateFunction · 0.85
port_flow_complainFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected