Signed-off-by: Flavio Leitner <f...@redhat.com>
---
 lib/flow.c                   |  4 ++--
 lib/flow.h                   | 22 ++++++++++++++++------
 lib/match.c                  |  2 +-
 lib/nx-match.c               |  2 +-
 lib/ofp-util.c               |  2 +-
 ofproto/ofproto-dpif-xlate.c |  2 +-
 6 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index 6c6978d..83b926f 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -499,7 +499,7 @@ flow_unwildcard_tp_ports(const struct flow *flow, struct 
flow_wildcards *wc)
 void
 flow_get_metadata(const struct flow *flow, struct flow_metadata *fmd)
 {
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26);
 
     fmd->dp_hash = flow->dp_hash;
     fmd->recirc_id = flow->recirc_id;
@@ -1165,7 +1165,7 @@ flow_push_mpls(struct flow *flow, int n, ovs_be16 
mpls_eth_type,
         flow->mpls_lse[0] = set_mpls_lse_values(ttl, tc, 1, htonl(label));
 
         /* Clear all L3 and L4 fields. */
-        BUILD_ASSERT(FLOW_WC_SEQ == 25);
+        BUILD_ASSERT(FLOW_WC_SEQ == 26);
         memset((char *) flow + FLOW_SEGMENT_2_ENDS_AT, 0,
                sizeof(struct flow) - FLOW_SEGMENT_2_ENDS_AT);
     }
diff --git a/lib/flow.h b/lib/flow.h
index d6dc308..5e3604a 100644
--- a/lib/flow.h
+++ b/lib/flow.h
@@ -37,7 +37,7 @@ struct pkt_metadata;
 /* This sequence number should be incremented whenever anything involving flows
  * or the wildcarding of flows changes.  This will cause build assertion
  * failures in places which likely need to be updated. */
-#define FLOW_WC_SEQ 25
+#define FLOW_WC_SEQ 26
 
 #define FLOW_N_REGS 8
 BUILD_ASSERT_DECL(FLOW_N_REGS <= NXM_NX_MAX_REGS);
@@ -60,6 +60,12 @@ BUILD_ASSERT_DECL(FLOW_NW_FRAG_LATER == NX_IP_FRAG_LATER);
 
 const char *flow_tun_flag_to_string(uint32_t flags);
 
+struct flow_igmp_group {
+    union {
+        ovs_be32 ip4;
+    } u;
+};
+
 struct flow_tnl {
     ovs_be64 tun_id;
     ovs_be32 ip_src;
@@ -133,17 +139,21 @@ struct flow {
     uint32_t dp_hash;           /* Datapath computed hash value. The exact
                                    computation is opaque to the user space.*/
     ovs_be16 tp_src;            /* TCP/UDP/SCTP source port. */
-    ovs_be16 tp_dst;            /* TCP/UDP/SCTP destination port.
-                                 * Keep last for the BUILD_ASSERT_DECL below */
+#define igmp_type tp_src        /* IGMP type */
+    ovs_be16 tp_dst;            /* TCP/UDP/SCTP destination port. */
+#define igmp_code tp_dst        /* IGMP code */
+    struct flow_igmp_group igmp_group;  /* IGMP group */
+                                /* the last field is used for the
+                                 * BUILD_ASSERT_DECL below */
 };
 BUILD_ASSERT_DECL(sizeof(struct flow) % 4 == 0);
 
 #define FLOW_U32S (sizeof(struct flow) / 4)
 
 /* Remember to update FLOW_WC_SEQ when changing 'struct flow'. */
-BUILD_ASSERT_DECL(offsetof(struct flow, tp_dst) + 2
-                  == sizeof(struct flow_tnl) + 172
-                  && FLOW_WC_SEQ == 25);
+BUILD_ASSERT_DECL(offsetof(struct flow, igmp_group) + 4
+                  == sizeof(struct flow_tnl) + 176
+                  && FLOW_WC_SEQ == 26);
 
 /* Incremental points at which flow classification may be performed in
  * segments.
diff --git a/lib/match.c b/lib/match.c
index 514e7f9..87d6a60 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -943,7 +943,7 @@ match_format(const struct match *match, struct ds *s, 
unsigned int priority)
 
     int i;
 
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26);
 
     if (priority != OFP_DEFAULT_PRIORITY) {
         ds_put_format(s, "priority=%u,", priority);
diff --git a/lib/nx-match.c b/lib/nx-match.c
index ed491ef..3839f19 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -572,7 +572,7 @@ nx_put_raw(struct ofpbuf *b, bool oxm, const struct match 
*match,
     int match_len;
     int i;
 
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26);
 
     /* Metadata. */
     if (match->wc.masks.dp_hash) {
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index b3d86e9..1bbe779 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -85,7 +85,7 @@ ofputil_netmask_to_wcbits(ovs_be32 netmask)
 void
 ofputil_wildcard_from_ofpfw10(uint32_t ofpfw, struct flow_wildcards *wc)
 {
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26);
 
     /* Initialize most of wc. */
     flow_wildcards_init_catchall(wc);
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 91ce7b7..a742637 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1717,7 +1717,7 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t 
ofp_port,
 
     /* If 'struct flow' gets additional metadata, we'll need to zero it out
      * before traversing a patch port. */
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 26);
 
     if (!xport) {
         xlate_report(ctx, "Nonexistent output port");
-- 
1.9.0

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to