ofproto-dpif: Fix in-band action for sFlow.
authorPravin B Shelar <pshelar@nicira.com>
Tue, 18 Oct 2011 18:15:43 +0000 (11:15 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Tue, 18 Oct 2011 18:15:43 +0000 (11:15 -0700)
        Use compose_output_action() API to generate OUTPUT action so
that sFlow can record output port.

ofproto/ofproto-dpif.c

index ae76e98516e8e3cdef65d8c3650efaee7ee7a5a3..9f73a8f8866dca66d65ea23767f73c20c8d9833c 100644 (file)
@@ -3886,7 +3886,6 @@ xlate_actions(struct action_xlate_ctx *ctx,
     } else {
         add_sflow_action(ctx);
         do_xlate_actions(in, n_in, ctx);
-        fix_sflow_action(ctx);
 
         if (!connmgr_may_set_up_flow(ctx->ofproto->up.connmgr, &ctx->flow,
                                      ctx->odp_actions->data,
@@ -3895,10 +3894,10 @@ xlate_actions(struct action_xlate_ctx *ctx,
             if (ctx->packet
                 && connmgr_msg_in_hook(ctx->ofproto->up.connmgr, &ctx->flow,
                                        ctx->packet)) {
-                nl_msg_push_u32(ctx->odp_actions, OVS_ACTION_ATTR_OUTPUT,
-                                OVSP_LOCAL);
+                compose_output_action(ctx, OVSP_LOCAL);
             }
         }
+        fix_sflow_action(ctx);
     }
 
     return ctx->odp_actions;