2
* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
2
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
42
40
SPR(SLOW_BFD, "bfd", "Consists of BFD packets") \
43
41
SPR(SLOW_LACP, "lacp", "Consists of LACP packets") \
44
42
SPR(SLOW_STP, "stp", "Consists of STP packets") \
43
SPR(SLOW_LLDP, "lldp", "Consists of LLDP packets") \
45
44
SPR(SLOW_CONTROLLER, "controller", \
46
45
"Sends \"packet-in\" messages to the OpenFlow controller") \
47
46
SPR(SLOW_ACTION, "action", \
66
/* Mask of all slow_path_reasons. */
68
SLOW_PATH_REASON_MASK = 0
69
#define SPR(ENUM, STRING, EXPLANATION) | 1 << ENUM##_INDEX
67
74
const char *slow_path_reason_to_explanation(enum slow_path_reason);
69
76
#define ODPP_LOCAL ODP_PORT_C(OVSP_LOCAL)
106
113
* - OVS_TUNNEL_KEY_ATTR_TTL 1 3 4 8
107
114
* - OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT 0 -- 4 4
108
115
* - OVS_TUNNEL_KEY_ATTR_CSUM 0 -- 4 4
116
* - OVS_TUNNEL_KEY_ATTR_OAM 0 -- 4 4
117
* - OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS 256 -- 4 260
118
* - OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS - -- - - (shared with _GENEVE_OPTS)
109
119
* OVS_KEY_ATTR_IN_PORT 4 -- 4 8
110
120
* OVS_KEY_ATTR_SKB_MARK 4 -- 4 8
121
* OVS_KEY_ATTR_DP_HASH 4 -- 4 8
122
* OVS_KEY_ATTR_RECIRC_ID 4 -- 4 8
111
123
* OVS_KEY_ATTR_ETHERNET 12 -- 4 16
112
124
* OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (outer VLAN ethertype)
113
* OVS_KEY_ATTR_8021Q 4 -- 4 8
125
* OVS_KEY_ATTR_VLAN 2 2 4 8
114
126
* OVS_KEY_ATTR_ENCAP 0 -- 4 4 (VLAN encapsulation)
115
127
* OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (inner VLAN ethertype)
116
128
* OVS_KEY_ATTR_IPV6 40 -- 4 44
117
129
* OVS_KEY_ATTR_ICMPV6 2 2 4 8
118
130
* OVS_KEY_ATTR_ND 28 -- 4 32
119
131
* ----------------------------------------------------------
122
134
* We include some slack space in case the calculation isn't quite right or we
123
135
* add another field and forget to adjust this value.
125
#define ODPUTIL_FLOW_KEY_BYTES 256
137
#define ODPUTIL_FLOW_KEY_BYTES 512
138
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 31);
127
140
/* A buffer with sufficient size and alignment to hold an nlattr-formatted flow
128
141
* key. An array of "struct nlattr" might not, in theory, be sufficiently
134
147
enum odp_key_fitness odp_tun_key_from_attr(const struct nlattr *,
135
148
struct flow_tnl *);
150
int odp_ufid_from_string(const char *s_, ovs_u128 *ufid);
151
void odp_format_ufid(const ovs_u128 *ufid, struct ds *);
137
152
void odp_flow_format(const struct nlattr *key, size_t key_len,
138
153
const struct nlattr *mask, size_t mask_len,
139
154
const struct hmap *portno_names, struct ds *,
144
159
struct ofpbuf *, struct ofpbuf *);
146
161
void odp_flow_key_from_flow(struct ofpbuf *, const struct flow * flow,
147
const struct flow *mask, odp_port_t odp_in_port);
162
const struct flow *mask, odp_port_t odp_in_port,
148
164
void odp_flow_key_from_mask(struct ofpbuf *, const struct flow *mask,
149
165
const struct flow *flow, uint32_t odp_in_port,
150
size_t max_mpls_depth);
166
size_t max_mpls_depth, bool recirc);
152
168
uint32_t odp_flow_key_hash(const struct nlattr *, size_t);
180
196
void commit_odp_tunnel_action(const struct flow *, struct flow *base,
181
197
struct ofpbuf *odp_actions);
198
void commit_masked_set_action(struct ofpbuf *odp_actions,
199
enum ovs_key_attr key_type, const void *key,
200
const void *mask, size_t key_size);
182
201
enum slow_path_reason commit_odp_actions(const struct flow *,
183
202
struct flow *base,
184
203
struct ofpbuf *odp_actions,
185
struct flow_wildcards *wc);
204
struct flow_wildcards *wc,
187
207
/* ofproto-dpif interface.
228
uint16_t type; /* USER_ACTION_COOKIE_IPFIX. */
248
uint16_t type; /* USER_ACTION_COOKIE_IPFIX. */
249
odp_port_t output_odp_port; /* The output odp port. */
231
252
BUILD_ASSERT_DECL(sizeof(union user_action_cookie) == 16);
233
254
size_t odp_put_userspace_action(uint32_t pid,
234
255
const void *userdata, size_t userdata_size,
256
odp_port_t tunnel_out_port,
235
257
struct ofpbuf *odp_actions);
236
258
void odp_put_tunnel_action(const struct flow_tnl *tunnel,
237
259
struct ofpbuf *odp_actions);
238
void odp_put_pkt_mark_action(const uint32_t pkt_mark,
239
struct ofpbuf *odp_actions);
261
void odp_put_tnl_push_action(struct ofpbuf *odp_actions,
262
struct ovs_action_push_tnl *data);
241
263
#endif /* odp-util.h */