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 <et...@nicira.com> --- ofproto/connmgr.c | 8 ++------ ofproto/connmgr.h | 5 +---- ofproto/ofproto-dpif-xlate.c | 9 +++++---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 9ddae5c..01b894f 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -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; } /* Fail-open and in-band implementation. */ diff --git a/ofproto/connmgr.h b/ofproto/connmgr.h index 0242116..f92a523 100644 --- a/ofproto/connmgr.h +++ b/ofproto/connmgr.h @@ -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 *); diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index df8964f..852052a 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -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" @@ -2008,10 +2009,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 (mirror_ofproto_has_mirrors(ctx.ofproto)) { -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev