datapath: Avoid calling flow_hash() twice for the same key.
[openvswitch] / lib / ofp-util.c
index ad9d19403dfe85c3cd7f30efae604a7069e42692..8f28edbd90b9755ae811c32cf812e1f7b006b4e7 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include "byte-order.h"
 #include "classifier.h"
+#include "multipath.h"
 #include "nx-match.h"
 #include "ofp-util.h"
 #include "ofpbuf.h"
@@ -362,7 +363,7 @@ ofputil_lookup_openflow_message(const struct ofputil_msg_category *cat,
         }
     }
 
-    VLOG_WARN_RL(&bad_ofmsg_rl, "received %s of unknown type %u",
+    VLOG_WARN_RL(&bad_ofmsg_rl, "received %s of unknown type %"PRIu32,
                  cat->name, value);
     return cat->missing_error;
 }
@@ -471,7 +472,7 @@ ofputil_decode_nxst_request(const struct ofp_header *oh,
     };
 
     static const struct ofputil_msg_category nxst_request_category = {
-        "Nicira extension statistics",
+        "Nicira extension statistics request",
         nxst_requests, ARRAY_SIZE(nxst_requests),
         OFP_MKERR(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE)
     };
@@ -505,7 +506,7 @@ ofputil_decode_nxst_reply(const struct ofp_header *oh,
     };
 
     static const struct ofputil_msg_category nxst_reply_category = {
-        "Nicira extension statistics",
+        "Nicira extension statistics reply",
         nxst_replies, ARRAY_SIZE(nxst_replies),
         OFP_MKERR(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE)
     };
@@ -1747,6 +1748,14 @@ check_nicira_action(const union ofp_action *a, unsigned int len,
         return check_action_exact_len(a, len,
                                       sizeof(struct nx_action_set_tunnel64));
 
+    case NXAST_MULTIPATH:
+        error = check_action_exact_len(a, len,
+                                       sizeof(struct nx_action_multipath));
+        if (error) {
+            return error;
+        }
+        return multipath_check((const struct nx_action_multipath *) a);
+
     case NXAST_SNAT__OBSOLETE:
     default:
         return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_VENDOR_TYPE);