nx-match: Encode dp_hash and recirc_id in OXM also.
authorBen Pfaff <blp@nicira.com>
Fri, 12 Sep 2014 21:42:47 +0000 (14:42 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 29 Sep 2014 22:07:43 +0000 (15:07 -0700)
dp_hash and recirc_id are specific to OVS, but that doesn't mean that we
shouldn't encode them into flow matches when OXM is used in OpenFlow 1.2
and later.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
lib/nx-match.c

index b896450..6537601 100644 (file)
@@ -621,17 +621,13 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
 
     /* Metadata. */
     if (match->wc.masks.dp_hash) {
-        if (!oxm) {
-            nxm_put_32m(b, mf_oxm_header(MFF_DP_HASH, oxm),
-                        htonl(flow->dp_hash), htonl(match->wc.masks.dp_hash));
-        }
+        nxm_put_32m(b, mf_oxm_header(MFF_DP_HASH, oxm),
+                    htonl(flow->dp_hash), htonl(match->wc.masks.dp_hash));
     }
 
     if (match->wc.masks.recirc_id) {
-        if (!oxm) {
-            nxm_put_32(b, mf_oxm_header(MFF_RECIRC_ID, oxm),
-                       htonl(flow->recirc_id));
-        }
+        nxm_put_32(b, mf_oxm_header(MFF_RECIRC_ID, oxm),
+                   htonl(flow->recirc_id));
     }
 
     if (match->wc.masks.in_port.ofp_port) {