summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-07-11 14:24:37 +0300
committerJohn Lo <loj@cisco.com>2017-07-13 12:11:44 +0000
commited8a105ee3f468756ddb86c8539236f4f1c34c4c (patch)
tree0aa9071da39e1dcbbff01441e0f2f38fd044cf4a /src/vnet
parentbea5ebf205e0bec922bf26c6c1a6a9392b4cad67 (diff)
L2INPUT:fix features mask cailculation
Change-Id: I84cea7530b01302a0adeef95b4924f54dc2e41ec Signed-off-by: Eyal Bari <ebari@cisco.com> (cherry picked from commit 8af1b2fdecc883eadfec6b91434adc6044e24cb2)
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/l2/l2_input.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/vnet/l2/l2_input.h b/src/vnet/l2/l2_input.h
index c1b669b4082..244ef445ca8 100644
--- a/src/vnet/l2/l2_input.h
+++ b/src/vnet/l2/l2_input.h
@@ -124,22 +124,26 @@ typedef enum
#define _(sym,str) L2INPUT_FEAT_##sym##_BIT,
foreach_l2input_feat
#undef _
- L2INPUT_N_FEAT,
- L2INPUT_VALID_MASK =
-#define _(sym,str) L2INPUT_FEAT_##sym##_BIT |
- foreach_l2input_feat
-#undef _
- 0,
+ L2INPUT_N_FEAT
} l2input_feat_t;
+STATIC_ASSERT (L2INPUT_N_FEAT <= 32, "too many l2 input features");
+
/* Feature bit masks */
typedef enum
{
#define _(sym,str) L2INPUT_FEAT_##sym = (1<<L2INPUT_FEAT_##sym##_BIT),
foreach_l2input_feat
#undef _
+ L2INPUT_VALID_MASK =
+#define _(sym,str) L2INPUT_FEAT_##sym |
+ foreach_l2input_feat
+#undef _
+ 0
} l2input_feat_masks_t;
+STATIC_ASSERT ((u64) L2INPUT_VALID_MASK == (1ull << L2INPUT_N_FEAT) - 1, "");
+
/** Return an array of strings containing graph node names of each feature */
char **l2input_get_feat_names (void);