[ovs-dev] [xlate v3 7/8] ofproto-dpif: Rename action_xlate_ctx.
Ethan Jackson
ethan at nicira.com
Tue May 28 21:36:10 UTC 2013
This patch changes the name of action_xlate_ctx to xlate_ctx. Aside
from being a bit snappier, it fits more cleanly with structures
added in future patches.
Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
ofproto/ofproto-dpif.c | 187 ++++++++++++++++++++++++------------------------
1 file changed, 92 insertions(+), 95 deletions(-)
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 0a40312..a7ea13f 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -208,8 +208,8 @@ static int set_stp_port(struct ofport *,
static bool ofbundle_includes_vlan(const struct ofbundle *, uint16_t vlan);
-struct action_xlate_ctx {
-/* action_xlate_ctx_init() initializes these members. */
+struct xlate_ctx {
+ /* xlate_ctx_init() initializes these members. */
/* The ofproto. */
struct ofproto_dpif *ofproto;
@@ -262,19 +262,19 @@ struct action_xlate_ctx {
* resubmit or OFPP_TABLE action didn't find a matching rule.
*
* This is normally null so the client has to set it manually after
- * calling action_xlate_ctx_init(). */
- void (*resubmit_hook)(struct action_xlate_ctx *, struct rule_dpif *rule);
+ * calling xlate_ctx_init(). */
+ void (*resubmit_hook)(struct xlate_ctx *, struct rule_dpif *rule);
/* If nonnull, flow translation calls this function to report some
* significant decision, e.g. to explain why OFPP_NORMAL translation
* dropped a packet. */
- void (*report_hook)(struct action_xlate_ctx *, const char *s);
+ void (*report_hook)(struct xlate_ctx *, const char *s);
/* If nonnull, flow translation credits the specified statistics to each
* rule reached through a resubmit or OFPP_TABLE action.
*
* This is normally null so the client has to set it manually after
- * calling action_xlate_ctx_init(). */
+ * calling xlate_ctx_init(). */
const struct dpif_flow_stats *resubmit_stats;
/* xlate_actions() initializes and uses these members. The client might want
@@ -317,18 +317,17 @@ struct initial_vals {
ovs_be16 vlan_tci;
};
-static void action_xlate_ctx_init(struct action_xlate_ctx *,
- struct ofproto_dpif *, const struct flow *,
- const struct initial_vals *initial_vals,
- struct rule_dpif *,
- uint8_t tcp_flags, const struct ofpbuf *);
-static void xlate_actions(struct action_xlate_ctx *,
- const struct ofpact *ofpacts, size_t ofpacts_len,
- struct ofpbuf *odp_actions);
-static void xlate_actions_for_side_effects(struct action_xlate_ctx *,
+static void xlate_ctx_init(struct xlate_ctx *, struct ofproto_dpif *,
+ const struct flow *,
+ const struct initial_vals *initial_vals,
+ struct rule_dpif *, uint8_t tcp_flags,
+ const struct ofpbuf *);
+static void xlate_actions(struct xlate_ctx *, const struct ofpact *ofpacts,
+ size_t ofpacts_len, struct ofpbuf *odp_actions);
+static void xlate_actions_for_side_effects(struct xlate_ctx *,
const struct ofpact *ofpacts,
size_t ofpacts_len);
-static void xlate_table_action(struct action_xlate_ctx *, uint16_t in_port,
+static void xlate_table_action(struct xlate_ctx *, uint16_t in_port,
uint8_t table_id, bool may_packet_in);
static size_t put_userspace_action(const struct ofproto_dpif *,
@@ -343,7 +342,7 @@ static void compose_slow_path(const struct ofproto_dpif *, const struct flow *,
const struct nlattr **actionsp,
size_t *actions_lenp);
-static void xlate_report(struct action_xlate_ctx *ctx, const char *s);
+static void xlate_report(struct xlate_ctx *ctx, const char *s);
/* A subfacet (see "struct subfacet" below) has three possible installation
* states:
@@ -817,7 +816,7 @@ static size_t compose_sflow_action(const struct ofproto_dpif *,
static void compose_ipfix_action(const struct ofproto_dpif *,
struct ofpbuf *odp_actions,
const struct flow *);
-static void add_mirror_actions(struct action_xlate_ctx *ctx,
+static void add_mirror_actions(struct xlate_ctx *ctx,
const struct flow *flow);
/* Global variables. */
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
@@ -3654,7 +3653,7 @@ handle_flow_miss_without_facet(struct flow_miss *miss,
{
struct rule_dpif *rule = rule_dpif_lookup(miss->ofproto, &miss->flow);
long long int now = time_msec();
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
struct ofpbuf *packet;
LIST_FOR_EACH (packet, list_node, &miss->packets) {
@@ -3669,9 +3668,8 @@ handle_flow_miss_without_facet(struct flow_miss *miss,
dpif_flow_stats_extract(&miss->flow, packet, now, &stats);
rule_credit_stats(rule, &stats);
- action_xlate_ctx_init(&ctx, miss->ofproto, &miss->flow,
- &miss->initial_vals, rule, stats.tcp_flags,
- packet);
+ xlate_ctx_init(&ctx, miss->ofproto, &miss->flow, &miss->initial_vals,
+ rule, stats.tcp_flags, packet);
ctx.resubmit_stats = &stats;
xlate_actions(&ctx, rule->up.ofpacts, rule->up.ofpacts_len,
&odp_actions);
@@ -3720,11 +3718,10 @@ handle_flow_miss_with_facet(struct flow_miss *miss, struct facet *facet,
handle_flow_miss_common(facet->rule, packet, &miss->flow);
if (want_path != SF_FAST_PATH) {
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
- action_xlate_ctx_init(&ctx, ofproto, &facet->flow,
- &facet->initial_vals, facet->rule, 0,
- packet);
+ xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
+ facet->rule, 0, packet);
xlate_actions_for_side_effects(&ctx, facet->rule->up.ofpacts,
facet->rule->up.ofpacts_len);
}
@@ -4614,7 +4611,7 @@ static struct facet *
facet_create(const struct flow_miss *miss, uint32_t hash)
{
struct ofproto_dpif *ofproto = miss->ofproto;
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
struct facet *facet;
facet = xzalloc(sizeof *facet);
@@ -4632,8 +4629,8 @@ facet_create(const struct flow_miss *miss, uint32_t hash)
ofpbuf_use_stub(&facet->odp_actions, &facet->odp_actions_stub,
sizeof facet->odp_actions_stub);
- action_xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
- facet->rule, 0, NULL);
+ xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
+ facet->rule, 0, NULL);
ctx.may_learn = true;
xlate_actions(&ctx, facet->rule->up.ofpacts, facet->rule->up.ofpacts_len,
&facet->odp_actions);
@@ -4721,7 +4718,7 @@ facet_learn(struct facet *facet)
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(facet->rule->up.ofproto);
long long int now = time_msec();
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
if (!facet->has_fin_timeout && now < facet->learn_rl) {
return;
@@ -4736,8 +4733,8 @@ facet_learn(struct facet *facet)
return;
}
- action_xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
- facet->rule, facet->tcp_flags, NULL);
+ xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
+ facet->rule, facet->tcp_flags, NULL);
ctx.may_learn = true;
xlate_actions_for_side_effects(&ctx, facet->rule->up.ofpacts,
facet->rule->up.ofpacts_len);
@@ -4906,7 +4903,7 @@ facet_check_consistency(struct facet *facet)
uint64_t odp_actions_stub[1024 / 8];
struct ofpbuf odp_actions;
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
struct rule_dpif *rule;
bool ok;
@@ -4932,8 +4929,8 @@ facet_check_consistency(struct facet *facet)
/* Check the datapath actions for consistency. */
ofpbuf_use_stub(&odp_actions, odp_actions_stub, sizeof odp_actions_stub);
- action_xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
- rule, 0, NULL);
+ xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals, rule, 0,
+ NULL);
xlate_actions(&ctx, rule->up.ofpacts, rule->up.ofpacts_len, &odp_actions);
ok = ofpbuf_equal(&facet->odp_actions, &odp_actions)
@@ -4984,9 +4981,9 @@ facet_revalidate(struct facet *facet)
uint64_t odp_actions_stub[1024 / 8];
struct ofpbuf odp_actions;
- struct action_xlate_ctx ctx;
struct rule_dpif *new_rule;
struct subfacet *subfacet;
+ struct xlate_ctx ctx;
COVERAGE_INC(facet_revalidate);
@@ -5017,8 +5014,8 @@ facet_revalidate(struct facet *facet)
* emit a NetFlow expiration and, if so, we need to have the old state
* around to properly compose it. */
ofpbuf_use_stub(&odp_actions, odp_actions_stub, sizeof odp_actions_stub);
- action_xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals,
- new_rule, 0, NULL);
+ xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals, new_rule,
+ 0, NULL);
xlate_actions(&ctx, new_rule->up.ofpacts, new_rule->up.ofpacts_len,
&odp_actions);
@@ -5164,12 +5161,12 @@ flow_push_stats(struct facet *facet, const struct dpif_flow_stats *stats)
{
struct rule_dpif *rule = facet->rule;
struct ofproto_dpif *ofproto = ofproto_dpif_cast(rule->up.ofproto);
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
ofproto_rule_update_used(&rule->up, stats->used);
- action_xlate_ctx_init(&ctx, ofproto, &facet->flow,
- &facet->initial_vals, rule, 0, NULL);
+ xlate_ctx_init(&ctx, ofproto, &facet->flow, &facet->initial_vals, rule, 0,
+ NULL);
ctx.resubmit_stats = stats;
xlate_actions_for_side_effects(&ctx, rule->up.ofpacts,
rule->up.ofpacts_len);
@@ -5599,7 +5596,7 @@ rule_dpif_execute(struct rule_dpif *rule, const struct flow *flow,
struct ofproto_dpif *ofproto = ofproto_dpif_cast(rule->up.ofproto);
struct initial_vals initial_vals;
struct dpif_flow_stats stats;
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
uint64_t odp_actions_stub[1024 / 8];
struct ofpbuf odp_actions;
@@ -5608,7 +5605,7 @@ rule_dpif_execute(struct rule_dpif *rule, const struct flow *flow,
initial_vals.vlan_tci = flow->vlan_tci;
ofpbuf_use_stub(&odp_actions, odp_actions_stub, sizeof odp_actions_stub);
- action_xlate_ctx_init(&ctx, ofproto, flow, &initial_vals,
+ xlate_ctx_init(&ctx, ofproto, flow, &initial_vals,
rule, stats.tcp_flags, packet);
ctx.resubmit_stats = &stats;
xlate_actions(&ctx, rule->up.ofpacts, rule->up.ofpacts_len, &odp_actions);
@@ -5648,7 +5645,7 @@ send_packet(const struct ofport_dpif *ofport, struct ofpbuf *packet)
struct dpif_flow_stats stats;
struct odputil_keybuf keybuf;
struct ofpact_output output;
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
struct flow flow;
int error;
@@ -5665,7 +5662,7 @@ send_packet(const struct ofport_dpif *ofport, struct ofpbuf *packet)
output.port = ofport->up.ofp_port;
output.max_len = 0;
- action_xlate_ctx_init(&ctx, ofproto, &flow, NULL, NULL, 0, packet);
+ xlate_ctx_init(&ctx, ofproto, &flow, NULL, NULL, 0, packet);
ctx.resubmit_stats = &stats;
xlate_actions(&ctx, &output.ofpact, sizeof output, &odp_actions);
@@ -5688,10 +5685,10 @@ send_packet(const struct ofport_dpif *ofport, struct ofpbuf *packet)
/* OpenFlow to datapath action translation. */
-static bool may_receive(const struct ofport_dpif *, struct action_xlate_ctx *);
+static bool may_receive(const struct ofport_dpif *, struct xlate_ctx *);
static void do_xlate_actions(const struct ofpact *, size_t ofpacts_len,
- struct action_xlate_ctx *);
-static void xlate_normal(struct action_xlate_ctx *);
+ struct xlate_ctx *);
+static void xlate_normal(struct xlate_ctx *);
/* Composes an ODP action for a "slow path" action for 'flow' within 'ofproto'.
* The action will state 'slow' as the reason that the action is in the slow
@@ -5867,7 +5864,7 @@ compose_ipfix_action(const struct ofproto_dpif *ofproto,
* actions. At this point we do not have all information required to
* build it. So try to build sample action as complete as possible. */
static void
-add_sflow_action(struct action_xlate_ctx *ctx)
+add_sflow_action(struct xlate_ctx *ctx)
{
ctx->user_cookie_offset = compose_sflow_action(ctx->ofproto,
ctx->odp_actions,
@@ -5879,7 +5876,7 @@ add_sflow_action(struct action_xlate_ctx *ctx)
/* SAMPLE action for IPFIX must be 1st or 2nd action in any given list
* of actions, eventually after the SAMPLE action for sFlow. */
static void
-add_ipfix_action(struct action_xlate_ctx *ctx)
+add_ipfix_action(struct xlate_ctx *ctx)
{
compose_ipfix_action(ctx->ofproto, ctx->odp_actions, &ctx->flow);
}
@@ -5888,7 +5885,7 @@ add_ipfix_action(struct action_xlate_ctx *ctx)
* We need to fix SAMPLE actions OVS_SAMPLE_ATTR_ACTIONS attribute, i.e. nested
* USERSPACE action's user-cookie which is required for sflow. */
static void
-fix_sflow_action(struct action_xlate_ctx *ctx)
+fix_sflow_action(struct xlate_ctx *ctx)
{
const struct flow *base = &ctx->base_flow;
union user_action_cookie *cookie;
@@ -5906,7 +5903,7 @@ fix_sflow_action(struct action_xlate_ctx *ctx)
}
static void
-compose_output_action__(struct action_xlate_ctx *ctx, uint16_t ofp_port,
+compose_output_action__(struct xlate_ctx *ctx, uint16_t ofp_port,
bool check_stp)
{
const struct ofport_dpif *ofport = get_ofp_port(ctx->ofproto, ofp_port);
@@ -6041,13 +6038,13 @@ compose_output_action__(struct action_xlate_ctx *ctx, uint16_t ofp_port,
}
static void
-compose_output_action(struct action_xlate_ctx *ctx, uint16_t ofp_port)
+compose_output_action(struct xlate_ctx *ctx, uint16_t ofp_port)
{
compose_output_action__(ctx, ofp_port, true);
}
static void
-tag_the_flow(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
+tag_the_flow(struct xlate_ctx *ctx, struct rule_dpif *rule)
{
struct ofproto_dpif *ofproto = ctx->ofproto;
uint8_t table_id = ctx->table_id;
@@ -6066,7 +6063,7 @@ tag_the_flow(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
/* Common rule processing in one place to avoid duplicating code. */
static struct rule_dpif *
-ctx_rule_hooks(struct action_xlate_ctx *ctx, struct rule_dpif *rule,
+ctx_rule_hooks(struct xlate_ctx *ctx, struct rule_dpif *rule,
bool may_packet_in)
{
if (ctx->resubmit_hook) {
@@ -6089,7 +6086,7 @@ ctx_rule_hooks(struct action_xlate_ctx *ctx, struct rule_dpif *rule,
}
static void
-xlate_table_action(struct action_xlate_ctx *ctx,
+xlate_table_action(struct xlate_ctx *ctx,
uint16_t in_port, uint8_t table_id, bool may_packet_in)
{
if (ctx->recurse < MAX_RESUBMIT_RECURSION) {
@@ -6132,7 +6129,7 @@ xlate_table_action(struct action_xlate_ctx *ctx,
}
static void
-xlate_ofpact_resubmit(struct action_xlate_ctx *ctx,
+xlate_ofpact_resubmit(struct xlate_ctx *ctx,
const struct ofpact_resubmit *resubmit)
{
uint16_t in_port;
@@ -6152,7 +6149,7 @@ xlate_ofpact_resubmit(struct action_xlate_ctx *ctx,
}
static void
-flood_packets(struct action_xlate_ctx *ctx, bool all)
+flood_packets(struct xlate_ctx *ctx, bool all)
{
struct ofport_dpif *ofport;
@@ -6174,7 +6171,7 @@ flood_packets(struct action_xlate_ctx *ctx, bool all)
}
static void
-execute_controller_action(struct action_xlate_ctx *ctx, int len,
+execute_controller_action(struct xlate_ctx *ctx, int len,
enum ofp_packet_in_reason reason,
uint16_t controller_id)
{
@@ -6246,7 +6243,7 @@ execute_controller_action(struct action_xlate_ctx *ctx, int len,
}
static void
-execute_mpls_push_action(struct action_xlate_ctx *ctx, ovs_be16 eth_type)
+execute_mpls_push_action(struct xlate_ctx *ctx, ovs_be16 eth_type)
{
ovs_assert(eth_type_mpls(eth_type));
@@ -6271,7 +6268,7 @@ execute_mpls_push_action(struct action_xlate_ctx *ctx, ovs_be16 eth_type)
}
static void
-execute_mpls_pop_action(struct action_xlate_ctx *ctx, ovs_be16 eth_type)
+execute_mpls_pop_action(struct xlate_ctx *ctx, ovs_be16 eth_type)
{
ovs_assert(eth_type_mpls(ctx->flow.dl_type));
ovs_assert(!eth_type_mpls(eth_type));
@@ -6286,7 +6283,7 @@ execute_mpls_pop_action(struct action_xlate_ctx *ctx, ovs_be16 eth_type)
}
static bool
-compose_dec_ttl(struct action_xlate_ctx *ctx, struct ofpact_cnt_ids *ids)
+compose_dec_ttl(struct xlate_ctx *ctx, struct ofpact_cnt_ids *ids)
{
if (ctx->flow.dl_type != htons(ETH_TYPE_IP) &&
ctx->flow.dl_type != htons(ETH_TYPE_IPV6)) {
@@ -6310,7 +6307,7 @@ compose_dec_ttl(struct action_xlate_ctx *ctx, struct ofpact_cnt_ids *ids)
}
static bool
-execute_set_mpls_ttl_action(struct action_xlate_ctx *ctx, uint8_t ttl)
+execute_set_mpls_ttl_action(struct xlate_ctx *ctx, uint8_t ttl)
{
if (!eth_type_mpls(ctx->flow.dl_type)) {
return true;
@@ -6321,7 +6318,7 @@ execute_set_mpls_ttl_action(struct action_xlate_ctx *ctx, uint8_t ttl)
}
static bool
-execute_dec_mpls_ttl_action(struct action_xlate_ctx *ctx)
+execute_dec_mpls_ttl_action(struct xlate_ctx *ctx)
{
uint8_t ttl = mpls_lse_to_ttl(ctx->flow.mpls_lse);
@@ -6342,7 +6339,7 @@ execute_dec_mpls_ttl_action(struct action_xlate_ctx *ctx)
}
static void
-xlate_output_action(struct action_xlate_ctx *ctx,
+xlate_output_action(struct xlate_ctx *ctx,
uint16_t port, uint16_t max_len, bool may_packet_in)
{
uint16_t prev_nf_output_iface = ctx->nf_output_iface;
@@ -6391,7 +6388,7 @@ xlate_output_action(struct action_xlate_ctx *ctx,
}
static void
-xlate_output_reg_action(struct action_xlate_ctx *ctx,
+xlate_output_reg_action(struct xlate_ctx *ctx,
const struct ofpact_output_reg *or)
{
uint64_t port = mf_get_subfield(&or->src, &ctx->flow);
@@ -6401,7 +6398,7 @@ xlate_output_reg_action(struct action_xlate_ctx *ctx,
}
static void
-xlate_enqueue_action(struct action_xlate_ctx *ctx,
+xlate_enqueue_action(struct xlate_ctx *ctx,
const struct ofpact_enqueue *enqueue)
{
uint16_t ofp_port = enqueue->port;
@@ -6440,7 +6437,7 @@ xlate_enqueue_action(struct action_xlate_ctx *ctx,
}
static void
-xlate_set_queue_action(struct action_xlate_ctx *ctx, uint32_t queue_id)
+xlate_set_queue_action(struct xlate_ctx *ctx, uint32_t queue_id)
{
uint32_t skb_priority;
@@ -6476,7 +6473,7 @@ slave_enabled_cb(uint16_t ofp_port, void *ofproto_)
}
static void
-xlate_bundle_action(struct action_xlate_ctx *ctx,
+xlate_bundle_action(struct xlate_ctx *ctx,
const struct ofpact_bundle *bundle)
{
uint16_t port;
@@ -6490,7 +6487,7 @@ xlate_bundle_action(struct action_xlate_ctx *ctx,
}
static void
-xlate_learn_action(struct action_xlate_ctx *ctx,
+xlate_learn_action(struct xlate_ctx *ctx,
const struct ofpact_learn *learn)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
@@ -6522,7 +6519,7 @@ reduce_timeout(uint16_t max, uint16_t *timeout)
}
static void
-xlate_fin_timeout(struct action_xlate_ctx *ctx,
+xlate_fin_timeout(struct xlate_ctx *ctx,
const struct ofpact_fin_timeout *oft)
{
if (ctx->tcp_flags & (TCP_FIN | TCP_RST) && ctx->rule) {
@@ -6534,7 +6531,7 @@ xlate_fin_timeout(struct action_xlate_ctx *ctx,
}
static void
-xlate_sample_action(struct action_xlate_ctx *ctx,
+xlate_sample_action(struct xlate_ctx *ctx,
const struct ofpact_sample *os)
{
union user_action_cookie cookie;
@@ -6551,7 +6548,7 @@ xlate_sample_action(struct action_xlate_ctx *ctx,
}
static bool
-may_receive(const struct ofport_dpif *port, struct action_xlate_ctx *ctx)
+may_receive(const struct ofport_dpif *port, struct xlate_ctx *ctx)
{
if (port->up.pp.config & (eth_addr_equals(ctx->flow.dl_dst, eth_addr_stp)
? OFPUTIL_PC_NO_RECV_STP
@@ -6572,7 +6569,7 @@ may_receive(const struct ofport_dpif *port, struct action_xlate_ctx *ctx)
}
static bool
-tunnel_ecn_ok(struct action_xlate_ctx *ctx)
+tunnel_ecn_ok(struct xlate_ctx *ctx)
{
if (is_ip_any(&ctx->base_flow)
&& (ctx->flow.tunnel.ip_tos & IP_ECN_MASK) == IP_ECN_CE) {
@@ -6591,7 +6588,7 @@ tunnel_ecn_ok(struct action_xlate_ctx *ctx)
static void
do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
- struct action_xlate_ctx *ctx)
+ struct xlate_ctx *ctx)
{
bool was_evictable = true;
const struct ofpact *a;
@@ -6844,11 +6841,11 @@ out:
}
static void
-action_xlate_ctx_init(struct action_xlate_ctx *ctx,
- struct ofproto_dpif *ofproto, const struct flow *flow,
- const struct initial_vals *initial_vals,
- struct rule_dpif *rule,
- uint8_t tcp_flags, const struct ofpbuf *packet)
+xlate_ctx_init(struct xlate_ctx *ctx, struct ofproto_dpif *ofproto,
+ const struct flow *flow,
+ const struct initial_vals *initial_vals,
+ struct rule_dpif *rule, uint8_t tcp_flags,
+ const struct ofpbuf *packet)
{
/* Flow initialization rules:
* - 'base_flow' must match the kernel's view of the packet at the
@@ -6892,7 +6889,7 @@ action_xlate_ctx_init(struct action_xlate_ctx *ctx,
/* Translates the 'ofpacts_len' bytes of "struct ofpacts" starting at 'ofpacts'
* into datapath actions in 'odp_actions', using 'ctx'. */
static void
-xlate_actions(struct action_xlate_ctx *ctx,
+xlate_actions(struct xlate_ctx *ctx,
const struct ofpact *ofpacts, size_t ofpacts_len,
struct ofpbuf *odp_actions)
{
@@ -7016,7 +7013,7 @@ xlate_actions(struct action_xlate_ctx *ctx,
/* Translates the 'ofpacts_len' bytes of "struct ofpact"s starting at 'ofpacts'
* into datapath actions, using 'ctx', and discards the datapath actions. */
static void
-xlate_actions_for_side_effects(struct action_xlate_ctx *ctx,
+xlate_actions_for_side_effects(struct xlate_ctx *ctx,
const struct ofpact *ofpacts,
size_t ofpacts_len)
{
@@ -7029,7 +7026,7 @@ xlate_actions_for_side_effects(struct action_xlate_ctx *ctx,
}
static void
-xlate_report(struct action_xlate_ctx *ctx, const char *s)
+xlate_report(struct xlate_ctx *ctx, const char *s)
{
if (ctx->report_hook) {
ctx->report_hook(ctx, s);
@@ -7150,7 +7147,7 @@ output_vlan_to_vid(const struct ofbundle *out_bundle, uint16_t vlan)
}
static void
-output_normal(struct action_xlate_ctx *ctx, const struct ofbundle *out_bundle,
+output_normal(struct xlate_ctx *ctx, const struct ofbundle *out_bundle,
uint16_t vlan)
{
struct ofport_dpif *port;
@@ -7218,7 +7215,7 @@ vlan_is_mirrored(const struct ofmirror *m, int vlan)
}
static void
-add_mirror_actions(struct action_xlate_ctx *ctx, const struct flow *orig_flow)
+add_mirror_actions(struct xlate_ctx *ctx, const struct flow *orig_flow)
{
struct ofproto_dpif *ofproto = ctx->ofproto;
mirror_mask_t mirrors;
@@ -7446,7 +7443,7 @@ lookup_input_bundle(const struct ofproto_dpif *ofproto, uint16_t in_port,
* so in one special case.
*/
static bool
-is_admissible(struct action_xlate_ctx *ctx, struct ofport_dpif *in_port,
+is_admissible(struct xlate_ctx *ctx, struct ofport_dpif *in_port,
uint16_t vlan)
{
struct ofproto_dpif *ofproto = ctx->ofproto;
@@ -7489,7 +7486,7 @@ is_admissible(struct action_xlate_ctx *ctx, struct ofport_dpif *in_port,
}
static void
-xlate_normal(struct action_xlate_ctx *ctx)
+xlate_normal(struct xlate_ctx *ctx)
{
struct ofport_dpif *in_port;
struct ofbundle *in_bundle;
@@ -7713,7 +7710,7 @@ packet_out(struct ofproto *ofproto_, struct ofpbuf *packet,
struct ofpbuf key;
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
uint64_t odp_actions_stub[1024 / 8];
struct ofpbuf odp_actions;
@@ -7724,8 +7721,8 @@ packet_out(struct ofproto *ofproto_, struct ofpbuf *packet,
dpif_flow_stats_extract(flow, packet, time_msec(), &stats);
initial_vals.vlan_tci = flow->vlan_tci;
- action_xlate_ctx_init(&ctx, ofproto, flow, &initial_vals, NULL,
- packet_get_tcp_flags(packet, flow), packet);
+ xlate_ctx_init(&ctx, ofproto, flow, &initial_vals, NULL,
+ packet_get_tcp_flags(packet, flow), packet);
ctx.resubmit_stats = &stats;
ofpbuf_use_stub(&odp_actions,
@@ -7865,7 +7862,7 @@ ofproto_unixctl_fdb_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
}
struct trace_ctx {
- struct action_xlate_ctx ctx;
+ struct xlate_ctx ctx;
struct flow flow;
struct ds *result;
};
@@ -7933,7 +7930,7 @@ trace_format_odp(struct ds *result, int level, const char *title,
}
static void
-trace_resubmit(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
+trace_resubmit(struct xlate_ctx *ctx, struct rule_dpif *rule)
{
struct trace_ctx *trace = CONTAINER_OF(ctx, struct trace_ctx, ctx);
struct ds *result = trace->result;
@@ -7946,7 +7943,7 @@ trace_resubmit(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
}
static void
-trace_report(struct action_xlate_ctx *ctx, const char *s)
+trace_report(struct xlate_ctx *ctx, const char *s)
{
struct trace_ctx *trace = CONTAINER_OF(ctx, struct trace_ctx, ctx);
struct ds *result = trace->result;
@@ -8108,8 +8105,8 @@ ofproto_trace(struct ofproto_dpif *ofproto, const struct flow *flow,
trace.flow = *flow;
ofpbuf_use_stub(&odp_actions,
odp_actions_stub, sizeof odp_actions_stub);
- action_xlate_ctx_init(&trace.ctx, ofproto, flow, initial_vals,
- rule, tcp_flags, packet);
+ xlate_ctx_init(&trace.ctx, ofproto, flow, initial_vals, rule,
+ tcp_flags, packet);
trace.ctx.resubmit_hook = trace_resubmit;
trace.ctx.report_hook = trace_report;
xlate_actions(&trace.ctx, rule->up.ofpacts, rule->up.ofpacts_len,
--
1.7.9.5
More information about the dev
mailing list