The assertions make it easier to find all the places that need to be
updated when adding protocol support.

Signed-off-by: Ben Pfaff <[email protected]>
---
 lib/odp-util.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 6e545b80ba6c..f60536c1d9dc 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -5819,6 +5819,11 @@ static void
 odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
                          bool export_mask, struct ofpbuf *buf)
 {
+    /* New "struct flow" fields that are visible to the datapath (including all
+     * data fields) should be translated into equivalent datapath flow fields
+     * here (you will have to add a OVS_KEY_ATTR_* for them). */
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 41);
+
     struct ovs_key_ethernet *eth_key;
     size_t encap[FLOW_MAX_VLAN_HEADERS] = {0};
     size_t max_vlans;
@@ -6900,6 +6905,11 @@ odp_flow_key_to_flow__(const struct nlattr *key, size_t 
key_len,
                        struct flow *flow, const struct flow *src_flow,
                        char **errorp)
 {
+    /* New "struct flow" fields that are visible to the datapath (including all
+     * data fields) should be translated from equivalent datapath flow fields
+     * here (you will have to add a OVS_KEY_ATTR_* for them).  */
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 41);
+
     enum odp_key_fitness fitness = ODP_FIT_ERROR;
     if (errorp) {
         *errorp = NULL;
-- 
2.20.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to