dpif: Abstract translation from OpenFlow queue ID into ODP priority value.
[openvswitch] / lib / ofp-print.c
index bcaf2307907c41a895ede7cd8bfe4e05d57e347b..c7130607fe2e9d464b10630beac8d6e69834d411 100644 (file)
@@ -134,8 +134,8 @@ ofp_packet_in(struct ds *string, const void *oh, size_t len, int verbosity)
         struct ofp_match match;
         packet.data = (void *) op->data;
         packet.size = data_len;
-        flow_extract(&packet, ntohs(op->in_port), &flow);
-        flow_to_match(&flow, 0, &match);
+        flow_extract(&packet, 0, ntohs(op->in_port), &flow);
+        flow_to_match(&flow, 0, false, &match);
         ofp_print_match(string, &match, verbosity);
         ds_put_char(string, '\n');
     }
@@ -193,6 +193,13 @@ ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
         break;
     }
 
+    case NXAST_SET_TUNNEL: {
+        const struct nx_action_set_tunnel *nast =
+                                            (struct nx_action_set_tunnel *)nah;
+        ds_put_format(string, "set_tunnel:0x%08"PRIx32, ntohl(nast->tun_id));
+        break;
+    }
+
     default:
         ds_put_format(string, "***unknown Nicira action:%d***\n",
                       ntohs(nah->subtype));
@@ -306,6 +313,20 @@ ofp_print_action(struct ds *string, const struct ofp_action_header *ah,
         break;
     }
 
+    case OFPAT_ENQUEUE: {
+        struct ofp_action_enqueue *ea = (struct ofp_action_enqueue *)ah;
+        unsigned int port = ntohs(ea->port);
+        unsigned int queue_id = ntohl(ea->queue_id);
+        ds_put_format(string, "enqueue:");
+        if (port != OFPP_IN_PORT) {
+            ds_put_format(string, "%u", port);
+        } else {
+            ds_put_cstr(string, "IN_PORT");
+        }
+        ds_put_format(string, "q%u", queue_id);
+        break;
+    }
+
     case OFPAT_SET_VLAN_VID: {
         struct ofp_action_vlan_vid *va = (struct ofp_action_vlan_vid *)ah;
         ds_put_format(string, "mod_vlan_vid:%"PRIu16, ntohs(va->vlan_vid));
@@ -672,6 +693,9 @@ ofp_match_to_string(const struct ofp_match *om, int verbosity)
             skip_type = false;
         }
     }
+    if (w & NXFW_TUN_ID) {
+        ds_put_cstr(&f, "tun_id_wild,");
+    }
     print_wild(&f, "in_port=", w & OFPFW_IN_PORT, verbosity,
                "%d", ntohs(om->in_port));
     print_wild(&f, "dl_vlan=", w & OFPFW_DL_VLAN, verbosity,