32
struct flow_wildcards;
36
#define OVSP_NONE UINT32_MAX
37
#define ODPP_LOCAL ODP_PORT_C(OVSP_LOCAL)
38
#define ODPP_NONE ODP_PORT_C(UINT32_MAX)
38
40
void format_odp_actions(struct ds *, const struct nlattr *odp_actions,
39
41
size_t actions_len);
87
89
uint32_t keybuf[DIV_ROUND_UP(ODPUTIL_FLOW_KEY_BYTES, 4)];
92
enum odp_key_fitness odp_tun_key_from_attr(const struct nlattr *,
95
void odp_flow_format(const struct nlattr *key, size_t key_len,
96
const struct nlattr *mask, size_t mask_len,
90
98
void odp_flow_key_format(const struct nlattr *, size_t, struct ds *);
91
int odp_flow_key_from_string(const char *s, const struct simap *port_names,
99
int odp_flow_from_string(const char *s,
100
const struct simap *port_names,
101
struct ofpbuf *, struct ofpbuf *);
94
103
void odp_flow_key_from_flow(struct ofpbuf *, const struct flow *,
95
uint32_t odp_in_port);
104
odp_port_t odp_in_port);
105
void odp_flow_key_from_mask(struct ofpbuf *, const struct flow *mask,
106
const struct flow *flow, uint32_t odp_in_port);
97
108
uint32_t odp_flow_key_hash(const struct nlattr *, size_t);
116
127
void commit_odp_tunnel_action(const struct flow *, struct flow *base,
117
128
struct ofpbuf *odp_actions);
118
129
void commit_odp_actions(const struct flow *, struct flow *base,
119
struct ofpbuf *odp_actions);
130
struct ofpbuf *odp_actions,
131
struct flow_wildcards *wc);
121
133
/* ofproto-dpif interface.
128
140
enum user_action_cookie_type {
129
141
USER_ACTION_COOKIE_UNSPEC,
130
USER_ACTION_COOKIE_SFLOW, /* Packet for sFlow sampling. */
131
USER_ACTION_COOKIE_SLOW_PATH /* Userspace must process this flow. */
142
USER_ACTION_COOKIE_SFLOW, /* Packet for per-bridge sFlow sampling. */
143
USER_ACTION_COOKIE_SLOW_PATH, /* Userspace must process this flow. */
144
USER_ACTION_COOKIE_FLOW_SAMPLE, /* Packet for per-flow sampling. */
145
USER_ACTION_COOKIE_IPFIX, /* Packet for per-bridge IPFIX sampling. */
134
148
/* user_action_cookie is passed as argument to OVS_ACTION_ATTR_USERSPACE.
148
162
uint32_t reason; /* enum slow_path_reason. */
166
uint16_t type; /* USER_ACTION_COOKIE_FLOW_SAMPLE. */
167
uint16_t probability; /* Sampling probability. */
168
uint32_t collector_set_id; /* ID of IPFIX collector set. */
169
uint32_t obs_domain_id; /* Observation Domain ID. */
170
uint32_t obs_point_id; /* Observation Point ID. */
174
uint16_t type; /* USER_ACTION_COOKIE_IPFIX. */
151
BUILD_ASSERT_DECL(sizeof(union user_action_cookie) == 8);
177
BUILD_ASSERT_DECL(sizeof(union user_action_cookie) == 16);
153
179
size_t odp_put_userspace_action(uint32_t pid,
154
const union user_action_cookie *,
180
const void *userdata, size_t userdata_size,
155
181
struct ofpbuf *odp_actions);
156
182
void odp_put_tunnel_action(const struct flow_tnl *tunnel,
157
183
struct ofpbuf *odp_actions);
161
187
/* Reasons why a subfacet might not be fast-pathable. */
162
188
enum slow_path_reason {
163
/* These reasons are mutually exclusive. */
164
SLOW_CFM = 1 << 0, /* CFM packets need per-packet processing. */
165
SLOW_LACP = 1 << 1, /* LACP packets need per-packet processing. */
166
SLOW_STP = 1 << 2, /* STP packets need per-packet processing. */
167
SLOW_IN_BAND = 1 << 3, /* In-band control needs every packet. */
169
/* Mutually exclusive with SLOW_CFM, SLOW_LACP, SLOW_STP.
170
* Could possibly appear with SLOW_IN_BAND. */
171
SLOW_CONTROLLER = 1 << 4, /* Packets must go to OpenFlow controller. */
173
/* This can appear on its own, or, theoretically at least, along with any
174
* other combination of reasons. */
175
SLOW_MATCH = 1 << 5, /* Datapath can't match specifically enough. */
189
SLOW_CFM = 1, /* CFM packets need per-packet processing. */
190
SLOW_LACP, /* LACP packets need per-packet processing. */
191
SLOW_STP, /* STP packets need per-packet processing. */
192
SLOW_BFD, /* BFD packets need per-packet processing. */
193
SLOW_CONTROLLER, /* Packets must go to OpenFlow controller. */
178
197
#endif /* odp-util.h */