connmgr: Remove connmgr_must_output_local().
authorEthan Jackson <ethan@nicira.com>
Sat, 22 Jun 2013 17:48:42 +0000 (10:48 -0700)
committerEthan Jackson <ethan@nicira.com>
Fri, 28 Jun 2013 01:23:40 +0000 (18:23 -0700)
connmgr_must_output_local() requires a 'struct connmgr' handle,
when in principle, it should simply be enough to know whether or
not in_band is enabled.  Breaking this up will allow
ofproto-dpif-xlate to disentangle itself from ofproto-dpif in future
patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto/connmgr.c
ofproto/connmgr.h
ofproto/ofproto-dpif-xlate.c

index 9ddae5c..01b894f 100644 (file)
@@ -1645,13 +1645,9 @@ any_extras_changed(const struct connmgr *mgr,
 /* In-band implementation. */
 
 bool
-connmgr_must_output_local(struct connmgr *mgr, const struct flow *flow,
-                          odp_port_t local_odp_port,
-                          const struct nlattr *odp_actions,
-                          size_t actions_len)
+connmgr_has_in_band(struct connmgr *mgr)
 {
-    return !mgr->in_band || in_band_rule_check(flow, local_odp_port,
-                                               odp_actions, actions_len);
+    return mgr->in_band != NULL;
 }
 \f
 /* Fail-open and in-band implementation. */
index 0242116..f92a523 100644 (file)
@@ -156,10 +156,7 @@ void connmgr_set_extra_in_band_remotes(struct connmgr *,
 void connmgr_set_in_band_queue(struct connmgr *, int queue_id);
 
 /* In-band implementation. */
-bool connmgr_must_output_local(struct connmgr *, const struct flow *,
-                               odp_port_t local_odp_port,
-                               const struct nlattr *odp_actions,
-                               size_t actions_len);
+bool connmgr_has_in_band(struct connmgr *);
 
 /* Fail-open and in-band implementation. */
 void connmgr_flushed(struct connmgr *);
index 7cd889a..852afdb 100644 (file)
@@ -26,6 +26,7 @@
 #include "coverage.h"
 #include "dpif.h"
 #include "dynamic-string.h"
+#include "in-band.h"
 #include "lacp.h"
 #include "learn.h"
 #include "mac-learning.h"
@@ -2009,10 +2010,10 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
         }
 
         local_odp_port = ofp_port_to_odp_port(ctx.ofproto, OFPP_LOCAL);
-        if (!connmgr_must_output_local(ctx.ofproto->up.connmgr, flow,
-                                       local_odp_port,
-                                       ctx.xout->odp_actions.data,
-                                       ctx.xout->odp_actions.size)) {
+        if (connmgr_has_in_band(ctx.ofproto->up.connmgr)
+            && !in_band_rule_check(flow, local_odp_port,
+                                   ctx.xout->odp_actions.data,
+                                   ctx.xout->odp_actions.size)) {
             compose_output_action(&ctx, OFPP_LOCAL);
         }
         if (ctx.ofproto->has_mirrors) {