From f7f1ea290307cd60060bd7c87fab1eee3d7e3e0a Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Sat, 22 Jun 2013 10:48:42 -0700 Subject: [PATCH] connmgr: Remove connmgr_must_output_local(). 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 Acked-by: Ben Pfaff --- 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 9ddae5c22..01b894f78 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 0242116c9..f92a523fd 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 7cd889a87..852afdbf8 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" @@ -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) { -- 2.43.0