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_filter_ctrl(struct rte_eth_dev *dev,
50 enum rte_filter_type filter_type,
51 enum rte_filter_op filter_op,
53 int tap_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error);
55 int tap_flow_implicit_create(struct pmd_internals *pmd,
56 enum implicit_rule_index idx);
57 int tap_flow_implicit_destroy(struct pmd_internals *pmd,
58 enum implicit_rule_index idx);
59 int tap_flow_implicit_flush(struct pmd_internals *pmd,
60 struct rte_flow_error *error);
62 int tap_flow_bpf_cls_q(__u32 queue_idx);
63 int tap_flow_bpf_calc_l3_l4_hash(__u32 key_idx, int map_fd);
64 int tap_flow_bpf_rss_map_create(unsigned int key_size, unsigned int value_size,
65 unsigned int max_entries);
66 int tap_flow_bpf_update_rss_elem(int fd, void *key, void *value);
68 #endif /* _TAP_FLOW_H_ */