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

Function sfc_flow_create_locked

dpdk/drivers/net/sfc/sfc_flow.c:2577–2617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2575}
2576
2577struct rte_flow *
2578sfc_flow_create_locked(struct sfc_adapter *sa, bool internal,
2579 const struct rte_flow_attr *attr,
2580 const struct rte_flow_item pattern[],
2581 const struct rte_flow_action actions[],
2582 struct rte_flow_error *error)
2583{
2584 struct rte_flow *flow = NULL;
2585 int rc;
2586
2587 SFC_ASSERT(sfc_adapter_is_locked(sa));
2588
2589 flow = sfc_flow_zmalloc(error);
2590 if (flow == NULL)
2591 goto fail_no_mem;
2592
2593 flow->internal = internal;
2594
2595 rc = sfc_flow_parse(sa->eth_dev, attr, pattern, actions, flow, error);
2596 if (rc != 0)
2597 goto fail_bad_value;
2598
2599 TAILQ_INSERT_TAIL(&sa->flow_list, flow, entries);
2600
2601 if (flow->internal || sa->state == SFC_ETHDEV_STARTED) {
2602 rc = sfc_flow_insert(sa, flow, error);
2603 if (rc != 0)
2604 goto fail_flow_insert;
2605 }
2606
2607 return flow;
2608
2609fail_flow_insert:
2610 TAILQ_REMOVE(&sa->flow_list, flow, entries);
2611
2612fail_bad_value:
2613 sfc_flow_free(sa, flow);
2614
2615fail_no_mem:
2616 return NULL;
2617}
2618
2619static int
2620sfc_flow_destroy(struct rte_eth_dev *dev,

Callers 2

sfc_mae_repr_flow_createFunction · 0.85
sfc_flow_createFunction · 0.85

Calls 4

sfc_flow_zmallocFunction · 0.85
sfc_flow_parseFunction · 0.85
sfc_flow_insertFunction · 0.85
sfc_flow_freeFunction · 0.85

Tested by

no test coverage detected