| 2452 | } |
| 2453 | |
| 2454 | static int |
| 2455 | sfc_flow_insert(struct sfc_adapter *sa, struct rte_flow *flow, |
| 2456 | struct rte_flow_error *error) |
| 2457 | { |
| 2458 | const struct sfc_flow_ops_by_spec *ops; |
| 2459 | int rc; |
| 2460 | |
| 2461 | ops = sfc_flow_get_ops_by_spec(flow); |
| 2462 | if (ops == NULL || ops->insert == NULL) { |
| 2463 | rte_flow_error_set(error, ENOTSUP, |
| 2464 | RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, |
| 2465 | "No backend to handle this flow"); |
| 2466 | return rte_errno; |
| 2467 | } |
| 2468 | |
| 2469 | rc = ops->insert(sa, flow); |
| 2470 | if (rc != 0) { |
| 2471 | rte_flow_error_set(error, rc, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, |
| 2472 | NULL, "Failed to insert the flow rule"); |
| 2473 | } |
| 2474 | |
| 2475 | return rc; |
| 2476 | } |
| 2477 | |
| 2478 | static int |
| 2479 | sfc_flow_remove(struct sfc_adapter *sa, struct rte_flow *flow, |
no test coverage detected