meta-flow: New "subfield" data structure.
[sliver-openvswitch.git] / ofproto / ofproto-dpif.c
index 51d3f3f..a0c7b28 100644 (file)
@@ -34,6 +34,7 @@
 #include "lacp.h"
 #include "learn.h"
 #include "mac-learning.h"
+#include "meta-flow.h"
 #include "multipath.h"
 #include "netdev.h"
 #include "netlink.h"
@@ -2424,7 +2425,7 @@ struct flow_miss_op {
  * OpenFlow controller as necessary according to their individual
  * configurations. */
 static void
-send_packet_in_miss(struct ofproto_dpif *ofproto, struct ofpbuf *packet,
+send_packet_in_miss(struct ofproto_dpif *ofproto, const struct ofpbuf *packet,
                     const struct flow *flow)
 {
     struct ofputil_packet_in pin;
@@ -4568,9 +4569,11 @@ static void
 xlate_output_reg_action(struct action_xlate_ctx *ctx,
                         const struct nx_action_output_reg *naor)
 {
+    struct mf_subfield src;
     uint64_t ofp_port;
 
-    ofp_port = nxm_read_field_bits(naor->src, naor->ofs_nbits, &ctx->flow);
+    nxm_decode(&src, naor->src, naor->ofs_nbits);
+    ofp_port = mf_get_subfield(&src, &ctx->flow);
 
     if (ofp_port <= UINT16_MAX) {
         xlate_output_action__(ctx, ofp_port, ntohs(naor->max_len));