Destroy all flow rules associated with a port. */
| 478 | |
| 479 | /* Destroy all flow rules associated with a port. */ |
| 480 | int |
| 481 | rte_flow_flush(uint16_t port_id, |
| 482 | struct rte_flow_error *error) |
| 483 | { |
| 484 | struct rte_eth_dev *dev = &rte_eth_devices[port_id]; |
| 485 | const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); |
| 486 | int ret; |
| 487 | |
| 488 | if (unlikely(!ops)) |
| 489 | return -rte_errno; |
| 490 | if (likely(!!ops->flush)) { |
| 491 | fts_enter(dev); |
| 492 | ret = ops->flush(dev, error); |
| 493 | fts_exit(dev); |
| 494 | ret = flow_err(port_id, ret, error); |
| 495 | |
| 496 | rte_flow_trace_flush(port_id, ret); |
| 497 | |
| 498 | return ret; |
| 499 | } |
| 500 | return rte_flow_error_set(error, ENOSYS, |
| 501 | RTE_FLOW_ERROR_TYPE_UNSPECIFIED, |
| 502 | NULL, rte_strerror(ENOSYS)); |
| 503 | } |
| 504 | |
| 505 | /* Query an existing flow rule. */ |
| 506 | int |
no test coverage detected