1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
// SPDX-License-Identifier: GPL-2.0-only
#ifndef XDP_REDIRECT_H
#define XDP_REDIRECT_H
#include <xdp/libxdp.h>
#include "params.h"
#include "util.h"
#define MAX_IFACE_NUM 32
int do_drop(const void *cfg, const char *pin_root_path);
int do_pass(const void *cfg, const char *pin_root_path);
int do_tx(const void *cfg, const char *pin_root_path);
int do_redirect_basic(const void *cfg, const char *pin_root_path);
int do_redirect_cpumap(const void *cfg, const char *pin_root_path);
int do_redirect_devmap(const void *cfg, const char *pin_root_path);
int do_redirect_devmap_multi(const void *cfg, const char *pin_root_path);
enum basic_program_mode {
BASIC_NO_TOUCH,
BASIC_READ_DATA,
BASIC_SWAP_MACS,
};
struct basic_opts {
bool extended;
bool rxq_stats;
__u32 interval;
enum xdp_attach_mode mode;
enum basic_program_mode program_mode;
struct iface iface_in;
};
struct redirect_opts {
bool stats;
bool extended;
__u32 interval;
enum xdp_attach_mode mode;
struct iface iface_in;
struct iface iface_out;
};
struct devmap_opts {
bool stats;
bool extended;
bool load_egress;
__u32 interval;
enum xdp_attach_mode mode;
struct iface iface_in;
struct iface iface_out;
};
struct devmap_multi_opts {
bool stats;
bool extended;
bool load_egress;
__u32 interval;
enum xdp_attach_mode mode;
struct iface *ifaces;
};
enum cpumap_remote_action {
ACTION_DISABLED,
ACTION_DROP,
ACTION_PASS,
ACTION_REDIRECT,
};
enum cpumap_program_mode {
CPUMAP_NO_TOUCH,
CPUMAP_TOUCH_DATA,
CPUMAP_CPU_ROUND_ROBIN,
CPUMAP_CPU_L4_PROTO,
CPUMAP_CPU_L4_PROTO_FILTER,
CPUMAP_CPU_L4_HASH,
};
struct cpumap_opts {
bool stats;
bool extended;
bool stress_mode;
__u32 interval;
__u32 qsize;
struct u32_multi cpus;
enum xdp_attach_mode mode;
enum cpumap_remote_action remote_action;
enum cpumap_program_mode program_mode;
struct iface iface_in;
struct iface redir_iface;
};
extern const struct basic_opts defaults_drop;
extern const struct basic_opts defaults_pass;
extern const struct basic_opts defaults_tx;
extern const struct redirect_opts defaults_redirect_basic;
extern const struct cpumap_opts defaults_redirect_cpumap;
extern const struct devmap_opts defaults_redirect_devmap;
extern const struct devmap_multi_opts defaults_redirect_devmap_multi;
#endif
|