1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2017 6WIND S.A.
3 * Copyright 2017 Mellanox Technologies, Ltd
10 #include <rte_flow_driver.h>
11 #include <rte_eth_tap.h>
12 #include <tap_autoconf.h>
15 * In TC, priority 0 means we require the kernel to allocate one for us.
16 * In rte_flow, however, we want the priority 0 to be the most important one.
17 * Use an offset to have the most important priority being 1 in TC.
19 #define PRIORITY_OFFSET 1
20 #define PRIORITY_MASK (0xfff)
21 #define MAX_PRIORITY (PRIORITY_MASK - PRIORITY_OFFSET)
22 #define GROUP_MASK (0xf)
23 #define GROUP_SHIFT 12
24 #define MAX_GROUP GROUP_MASK
25 #define RSS_PRIORITY_OFFSET RTE_PMD_TAP_MAX_QUEUES
28 * These index are actually in reversed order: their priority is processed
29 * by subtracting their value to the lowest priority (PRIORITY_MASK).
30 * Thus the first one will have the lowest priority in the end
31 * (but biggest value).
33 enum implicit_rule_index {
36 TAP_REMOTE_BROADCASTV6,
49 int tap_dev_flow_ops_get(struct rte_eth_dev *dev,
50 const struct rte_flow_ops **ops);
51 int tap_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error);
53 int tap_flow_implicit_create(struct pmd_internals *pmd,
54 enum implicit_rule_index idx);
55 int tap_flow_implicit_destroy(struct pmd_internals *pmd,
56 enum implicit_rule_index idx);
57 int tap_flow_implicit_flush(struct pmd_internals *pmd,
58 struct rte_flow_error *error);
60 int tap_flow_bpf_cls_q(__u32 queue_idx);
61 int tap_flow_bpf_calc_l3_l4_hash(__u32 key_idx, int map_fd);
62 int tap_flow_bpf_rss_map_create(unsigned int key_size, unsigned int value_size,
63 unsigned int max_entries);
64 int tap_flow_bpf_update_rss_elem(int fd, void *key, void *value);
66 #endif /* _TAP_FLOW_H_ */