odp-util: Make it harder to forget to update ODPUTIL_FLOW_KEY_BYTES.
authorBen Pfaff <blp@nicira.com>
Fri, 13 Jun 2014 15:40:00 +0000 (08:40 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 13 Jun 2014 23:21:48 +0000 (16:21 -0700)
We've forgotten more than once.  Most updates coincide with adding
new flow members, so a build assertion on FLOW_WC_SEQ seems appropriate.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/odp-util.h

index 8045e3e..aad3098 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <stdint.h>
 #include <string.h>
 #include <linux/openvswitch.h>
+#include "flow.h"
 #include "hash.h"
 #include "hmap.h"
 #include "openflow/openflow.h"
 #include "util.h"
 
 struct ds;
-struct flow;
-struct flow_tnl;
-struct flow_wildcards;
 struct nlattr;
 struct ofpbuf;
 struct simap;
@@ -125,6 +123,7 @@ void odp_portno_names_destroy(struct hmap *portno_names);
  * add another field and forget to adjust this value.
  */
 #define ODPUTIL_FLOW_KEY_BYTES 256
+BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26);
 
 /* A buffer with sufficient size and alignment to hold an nlattr-formatted flow
  * key.  An array of "struct nlattr" might not, in theory, be sufficiently