diff options
author | Ben Pfaff <blp@ovn.org> | 2016-01-18 14:43:01 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-01-20 16:50:06 -0800 |
commit | 417509faf2dff3be26f2ab4c9dd45809ec32e5dc (patch) | |
tree | 4920ed01e4d8da5a24ea93a8a21df4b2634f1e1b /ofproto/ofproto-dpif-rid.c | |
parent | 5c1b231450df9e9681b7fb233217ee2f6199c11d (diff) | |
download | openvswitch-417509faf2dff3be26f2ab4c9dd45809ec32e5dc.tar.gz |
ofproto-dpif-rid: Use separate pointers for actions and action set.
During translation it makes some sense to concatenate these in a single
array, but in my opinion it's conceptually better to separate them for
the recirc_state; they are not naturally the same thing.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif-rid.c')
-rw-r--r-- | ofproto/ofproto-dpif-rid.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ofproto/ofproto-dpif-rid.c b/ofproto/ofproto-dpif-rid.c index c61b007cd..8aee68f2b 100644 --- a/ofproto/ofproto-dpif-rid.c +++ b/ofproto/ofproto-dpif-rid.c @@ -148,6 +148,10 @@ recirc_metadata_hash(const struct recirc_state *state) } hash = hash_int(state->mirrors, hash); hash = hash_int(state->action_set_len, hash); + if (state->action_set_len) { + hash = hash_bytes64(ALIGNED_CAST(const uint64_t *, state->action_set), + state->action_set_len, hash); + } if (state->ofpacts_len) { hash = hash_bytes64(ALIGNED_CAST(const uint64_t *, state->ofpacts), state->ofpacts_len, hash); @@ -168,9 +172,10 @@ recirc_metadata_equal(const struct recirc_state *a, && !memcmp(a->stack, b->stack, a->n_stack * sizeof *a->stack) && a->mirrors == b->mirrors && a->conntracked == b->conntracked - && a->action_set_len == b->action_set_len && ofpacts_equal(a->ofpacts, a->ofpacts_len, - b->ofpacts, b->ofpacts_len)); + b->ofpacts, b->ofpacts_len) + && ofpacts_equal(a->action_set, a->action_set_len, + b->action_set, b->action_set_len)); } /* Lockless RCU protected lookup. If node is needed accross RCU quiescent @@ -216,6 +221,9 @@ recirc_state_clone(struct recirc_state *new, const struct recirc_state *old, new->ofpacts = (new->ofpacts_len ? xmemdup(new->ofpacts, new->ofpacts_len) : NULL); + new->action_set = (new->action_set_len + ? xmemdup(new->action_set, new->action_set_len) + : NULL); } static void @@ -223,6 +231,7 @@ recirc_state_free(struct recirc_state *state) { free(state->stack); free(state->ofpacts); + free(state->action_set); } /* Allocate a unique recirculation id for the given set of flow metadata. |