summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrell Ball <dlu998@gmail.com>2017-06-05 06:34:33 -0700
committerBen Pfaff <blp@ovn.org>2017-06-07 09:40:47 -0700
commit6cf5c521474e2b85c5f7d2a76af8d37c6a2d0d8f (patch)
tree4a3aa69c407f0dd66ffe722efbc85402a9d3eea1
parent0e71e47f636378fb695a17c1d003a1101c7864af (diff)
downloadopenvswitch-6cf5c521474e2b85c5f7d2a76af8d37c6a2d0d8f.tar.gz
flow: Refactor ct_orig_tuple check in miniflow_extract().
The checks to populate ct_orig_tuple in miniflow_extract include recirc_id being non-zero. Now, ct_orig_tuple is only populated if the packet has passed through the connection tracker, which is a prerequisite for having valid ct_orig_tuple information. This is recognized by having a non-zero ct_state. This has an added benefit of saving some processing time. Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--lib/flow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/flow.c b/lib/flow.c
index b30ecbfd6..1f51b66e7 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -615,12 +615,15 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
}
miniflow_push_uint32(mf, dp_hash, md->dp_hash);
miniflow_push_uint32(mf, in_port, odp_to_u32(md->in_port.odp_port));
- if (md->recirc_id || md->ct_state) {
+ if (md->ct_state) {
miniflow_push_uint32(mf, recirc_id, md->recirc_id);
miniflow_push_uint8(mf, ct_state, md->ct_state);
ct_nw_proto_p = miniflow_pointer(mf, ct_nw_proto);
miniflow_push_uint8(mf, ct_nw_proto, 0);
miniflow_push_uint16(mf, ct_zone, md->ct_zone);
+ } else if (md->recirc_id) {
+ miniflow_push_uint32(mf, recirc_id, md->recirc_id);
+ miniflow_pad_to_64(mf, recirc_id);
}
if (md->ct_state) {