1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015-2020
6 #include <rte_flow_driver.h>
8 #include "txgbe_ethdev.h"
11 * Create or destroy a flow rule.
12 * Theorically one rule can match more than one filters.
13 * We will let it use the filter which it hitt first.
14 * So, the sequence matters.
16 static struct rte_flow *
17 txgbe_flow_create(struct rte_eth_dev *dev,
18 const struct rte_flow_attr *attr,
19 const struct rte_flow_item pattern[],
20 const struct rte_flow_action actions[],
21 struct rte_flow_error *error)
23 struct rte_flow *flow = NULL;
28 * Check if the flow rule is supported by txgbe.
29 * It only checks the format. Don't guarantee the rule can be programmed into
30 * the HW. Because there can be no enough room for the rule.
33 txgbe_flow_validate(struct rte_eth_dev *dev,
34 const struct rte_flow_attr *attr,
35 const struct rte_flow_item pattern[],
36 const struct rte_flow_action actions[],
37 struct rte_flow_error *error)
44 /* Destroy a flow rule on txgbe. */
46 txgbe_flow_destroy(struct rte_eth_dev *dev,
47 struct rte_flow *flow,
48 struct rte_flow_error *error)
55 /* Destroy all flow rules associated with a port on txgbe. */
57 txgbe_flow_flush(struct rte_eth_dev *dev,
58 struct rte_flow_error *error)
65 const struct rte_flow_ops txgbe_flow_ops = {
66 .validate = txgbe_flow_validate,
67 .create = txgbe_flow_create,
68 .destroy = txgbe_flow_destroy,
69 .flush = txgbe_flow_flush,