aboutsummaryrefslogtreecommitdiff
path: root/lib/odp-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/odp-util.h')
-rw-r--r--lib/odp-util.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/odp-util.h b/lib/odp-util.h
index cdafbe46..c52e4709 100644
--- a/lib/odp-util.h
+++ b/lib/odp-util.h
@@ -123,18 +123,20 @@ enum user_action_cookie_type {
/* user_action_cookie is passed as argument to OVS_ACTION_ATTR_USERSPACE.
* Since it is passed to kernel as u64, its size has to be 8 bytes. */
-struct user_action_cookie {
+union user_action_cookie {
uint16_t type; /* enum user_action_cookie_type. */
- /* The following members are used only by USER_ACTION_COOKIE_SFLOW. */
- ovs_be16 vlan_tci; /* Destination VLAN TCI. */
- uint32_t output; /* SFL_FLOW_SAMPLE_TYPE 'output' value. */
+ struct {
+ uint16_t type; /* USER_ACTION_COOKIE_SFLOW. */
+ ovs_be16 vlan_tci; /* Destination VLAN TCI. */
+ uint32_t output; /* SFL_FLOW_SAMPLE_TYPE 'output' value. */
+ } sflow;
};
-BUILD_ASSERT_DECL(sizeof(struct user_action_cookie) == 8);
+BUILD_ASSERT_DECL(sizeof(union user_action_cookie) == 8);
size_t odp_put_userspace_action(uint32_t pid,
- const struct user_action_cookie *,
+ const union user_action_cookie *,
struct ofpbuf *odp_actions);
void commit_odp_actions(const struct flow *, struct flow *base,