]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | /* SPDX-License-Identifier: BSD-3-Clause |
2 | * Copyright 2017 6WIND S.A. | |
3 | * Copyright 2017 Mellanox Technologies, Ltd | |
7c673cae FG |
4 | */ |
5 | ||
11fdf7f2 TL |
6 | #ifndef _TAP_FLOW_H_ |
7 | #define _TAP_FLOW_H_ | |
7c673cae | 8 | |
11fdf7f2 TL |
9 | #include <rte_flow.h> |
10 | #include <rte_flow_driver.h> | |
11 | #include <rte_eth_tap.h> | |
9f95a23c | 12 | #include <tap_autoconf.h> |
7c673cae | 13 | |
11fdf7f2 TL |
14 | /** |
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. | |
7c673cae | 18 | */ |
11fdf7f2 TL |
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 | |
9f95a23c | 25 | #define RSS_PRIORITY_OFFSET RTE_PMD_TAP_MAX_QUEUES |
7c673cae | 26 | |
11fdf7f2 TL |
27 | /** |
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). | |
7c673cae | 32 | */ |
11fdf7f2 TL |
33 | enum implicit_rule_index { |
34 | TAP_REMOTE_TX, | |
9f95a23c | 35 | TAP_ISOLATE, |
11fdf7f2 TL |
36 | TAP_REMOTE_BROADCASTV6, |
37 | TAP_REMOTE_BROADCAST, | |
38 | TAP_REMOTE_ALLMULTI, | |
39 | TAP_REMOTE_PROMISC, | |
40 | TAP_REMOTE_LOCAL_MAC, | |
41 | TAP_REMOTE_MAX_IDX, | |
42 | }; | |
7c673cae | 43 | |
9f95a23c TL |
44 | enum bpf_fd_idx { |
45 | SEC_L3_L4, | |
46 | SEC_MAX, | |
47 | }; | |
48 | ||
11fdf7f2 TL |
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, | |
52 | void *arg); | |
53 | int tap_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error); | |
7c673cae | 54 | |
11fdf7f2 TL |
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); | |
7c673cae | 61 | |
9f95a23c TL |
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); | |
67 | ||
11fdf7f2 | 68 | #endif /* _TAP_FLOW_H_ */ |