| 2575 | } |
| 2576 | |
| 2577 | struct rte_flow * |
| 2578 | sfc_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 | |
| 2609 | fail_flow_insert: |
| 2610 | TAILQ_REMOVE(&sa->flow_list, flow, entries); |
| 2611 | |
| 2612 | fail_bad_value: |
| 2613 | sfc_flow_free(sa, flow); |
| 2614 | |
| 2615 | fail_no_mem: |
| 2616 | return NULL; |
| 2617 | } |
| 2618 | |
| 2619 | static int |
| 2620 | sfc_flow_destroy(struct rte_eth_dev *dev, |
no test coverage detected