Skip to content

Commit

Permalink
actions: Separate action structures for "next" and "ct_next".
Browse files Browse the repository at this point in the history
These actions aren't very similar but until now they both had the same
action structure.  These structures are going to diverge in an upcoming
commit, so separate them now.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Mickey Spiegel <[email protected]>
  • Loading branch information
blp committed Jan 21, 2017
1 parent b3bd2c3 commit ebb467f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 8 additions & 2 deletions include/ovn/actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct simap;
OVNACT(MOVE, ovnact_move) \
OVNACT(EXCHANGE, ovnact_move) \
OVNACT(DEC_TTL, ovnact_null) \
OVNACT(CT_NEXT, ovnact_next) \
OVNACT(CT_NEXT, ovnact_ct_next) \
OVNACT(CT_COMMIT, ovnact_ct_commit) \
OVNACT(CT_DNAT, ovnact_ct_nat) \
OVNACT(CT_SNAT, ovnact_ct_nat) \
Expand Down Expand Up @@ -140,7 +140,7 @@ struct ovnact_null {
struct ovnact ovnact;
};

/* OVNACT_NEXT, OVNACT_CT_NEXT. */
/* OVNACT_NEXT. */
struct ovnact_next {
struct ovnact ovnact;
uint8_t ltable; /* Logical table ID of next table. */
Expand All @@ -160,6 +160,12 @@ struct ovnact_move {
struct expr_field rhs;
};

/* OVNACT_CT_NEXT. */
struct ovnact_ct_next {
struct ovnact ovnact;
uint8_t ltable; /* Logical table ID of next table. */
};

/* OVNACT_CT_COMMIT. */
struct ovnact_ct_commit {
struct ovnact ovnact;
Expand Down
11 changes: 8 additions & 3 deletions ovn/lib/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,24 +530,29 @@ parse_CT_NEXT(struct action_context *ctx)
}

static void
format_CT_NEXT(const struct ovnact_next *next OVS_UNUSED, struct ds *s)
format_CT_NEXT(const struct ovnact_ct_next *ct_next OVS_UNUSED, struct ds *s)
{
ds_put_cstr(s, "ct_next;");
}

static void
encode_CT_NEXT(const struct ovnact_next *next,
encode_CT_NEXT(const struct ovnact_ct_next *ct_next,
const struct ovnact_encode_params *ep,
struct ofpbuf *ofpacts)
{
struct ofpact_conntrack *ct = ofpact_put_CT(ofpacts);
ct->recirc_table = ep->first_ptable + next->ltable;
ct->recirc_table = ep->first_ptable + ct_next->ltable;
ct->zone_src.field = ep->is_switch ? mf_from_id(MFF_LOG_CT_ZONE)
: mf_from_id(MFF_LOG_DNAT_ZONE);
ct->zone_src.ofs = 0;
ct->zone_src.n_bits = 16;
ofpact_finish(ofpacts, &ct->ofpact);
}

static void
ovnact_ct_next_free(struct ovnact_ct_next *a OVS_UNUSED)
{
}

static void
parse_ct_commit_arg(struct action_context *ctx,
Expand Down

0 comments on commit ebb467f

Please sign in to comment.