MCPcopy Index your code
hub / github.com/F-Stack/f-stack / rte_flow_validate

Function rte_flow_validate

dpdk/lib/ethdev/rte_flow.c:361–394  ·  view source on GitHub ↗

Check whether a flow rule can be created on a given port. */

Source from the content-addressed store, hash-verified

359
360/* Check whether a flow rule can be created on a given port. */
361int
362rte_flow_validate(uint16_t port_id,
363 const struct rte_flow_attr *attr,
364 const struct rte_flow_item pattern[],
365 const struct rte_flow_action actions[],
366 struct rte_flow_error *error)
367{
368 const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
369 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
370 int ret;
371
372 if (likely(!!attr) && attr->transfer &&
373 (attr->ingress || attr->egress)) {
374 return rte_flow_error_set(error, EINVAL,
375 RTE_FLOW_ERROR_TYPE_ATTR,
376 attr, "cannot use attr ingress/egress with attr transfer");
377 }
378
379 if (unlikely(!ops))
380 return -rte_errno;
381 if (likely(!!ops->validate)) {
382 fts_enter(dev);
383 ret = ops->validate(dev, attr, pattern, actions, error);
384 fts_exit(dev);
385 ret = flow_err(port_id, ret, error);
386
387 rte_flow_trace_validate(port_id, attr, pattern, actions, ret);
388
389 return ret;
390 }
391 return rte_flow_error_set(error, ENOSYS,
392 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
393 NULL, rte_strerror(ENOSYS));
394}
395
396/* Create a flow rule on a given port. */
397struct rte_flow *

Callers 15

create_tcp_flowFunction · 0.85
init_flowFunction · 0.85
create_ipip_flowFunction · 0.85
fdir_add_tcp_flowFunction · 0.85
bond_flow_validateFunction · 0.85
fs_flow_validateFunction · 0.85
create_default_flowFunction · 0.85
create_default_flowFunction · 0.85
port_flow_validateFunction · 0.85
create_inline_sessionFunction · 0.85
create_ipsec_esp_flowFunction · 0.85

Calls 6

rte_flow_ops_getFunction · 0.85
rte_flow_error_setFunction · 0.85
fts_enterFunction · 0.85
fts_exitFunction · 0.85
flow_errFunction · 0.85
rte_strerrorFunction · 0.85

Tested by 2

create_default_flowFunction · 0.68
create_default_flowFunction · 0.68