Catalli's threaded switch
[sliver-openvswitch.git] / lib / odp-util.h
index 6d67ec2..420bde5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #define ODP_UTIL_H 1
 
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdint.h>
 #include "openflow/openflow.h"
 #include "openvswitch/datapath-protocol.h"
+#include "util.h"
 
 struct ds;
 
@@ -28,6 +30,9 @@ struct ds;
  * memory, so there is no point in allocating more than that.  */
 enum { MAX_ODP_ACTIONS = 4096 / sizeof(union odp_action) };
 
+/* odp_actions_add() assumes that MAX_ODP_ACTIONS is a power of 2. */
+BUILD_ASSERT_DECL(IS_POW2(MAX_ODP_ACTIONS));
+
 struct odp_actions {
     size_t n_actions;
     union odp_action actions[MAX_ODP_ACTIONS];