Signed-off-by: Johnson Li <johnson...@intel.com>

diff --git a/lib/match.c b/lib/match.c
index db78831..4eab67f 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -1031,6 +1031,52 @@ format_flow_tunnel(struct ds *s, const struct match 
*match)
 }
 
 static void
+format_flow_nsh(struct ds *s, const struct match *match)
+{
+    const struct flow_wildcards *wc = &match->wc;
+    const struct flow_nsh *nsh = &match->flow.nsh;
+
+    if (nsh->nsp) {
+        format_be32_masked(s, "nsp", nsh->nsp, wc->masks.nsh.nsp);
+        ds_put_format(s, "nsi=%"PRIu8",", nsh->nsi);
+
+        if (wc->masks.nsh.flags) {
+            format_be32_masked(s, "flags", nsh->flags, wc->masks.nsh.flags);
+        }
+        if (wc->masks.nsh.md_type) {
+            ds_put_format(s, "md_type=%"PRIu8",", nsh->md_type);
+        }
+        if (wc->masks.nsh.next_proto) {
+            ds_put_format(s, "next_proto=%"PRIu8",", nsh->next_proto);
+        }
+
+        if(nsh->md_type == 0x1) { /* NSH_MD_TYPE1 */
+            if (wc->masks.nsh.nshc1) {
+                format_be32_masked(s, "nshc1", nsh->nshc1,
+                                   wc->masks.nsh.nshc1);
+            }
+            if (wc->masks.nsh.nshc2) {
+                format_be32_masked(s, "nshc2", nsh->nshc2,
+                                   wc->masks.nsh.nshc2);
+            }
+            if (wc->masks.nsh.nshc3) {
+                format_be32_masked(s, "nshc3", nsh->nshc3,
+                                   wc->masks.nsh.nshc3);
+            }
+            if (wc->masks.nsh.nshc4) {
+                format_be32_masked(s, "nshc4", nsh->nshc4,
+                                   wc->masks.nsh.nshc4);
+            }
+#if 0
+        } else if (nsh->md_type == 0x2) { /* NSH_MD_TYPE2 */
+            /* Prototype of MD type 2 with TUN_METADATA APIs. */
+            tun_metadata_match_format(s, match);
+#endif
+        }
+    }
+}
+
+static void
 format_ct_label_masked(struct ds *s, const ovs_u128 *key, const ovs_u128 *mask)
 {
     if (!ovs_u128_is_zero(*mask)) {
@@ -1187,6 +1233,8 @@ match_format(const struct match *match, struct ds *s, int 
priority)
 
     format_be64_masked(s, "metadata", f->metadata, wc->masks.metadata);
 
+    format_flow_nsh(s, match);
+
     if (wc->masks.in_port.ofp_port) {
         ds_put_format(s, "%sin_port=%s", colors.param, colors.end);
         ofputil_format_port(f->in_port.ofp_port, s);
-- 
1.8.4.2

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.

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

Reply via email to