summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2020-08-18 16:13:29 +0200
committerIlya Maximets <i.maximets@ovn.org>2020-08-26 11:58:13 +0200
commit79a5251a501d64b04e76c68db50274a7b8ebfc88 (patch)
tree11bfcddd8738acc7ef8ac9ae9235449a1038700b
parent00d3374d8d54283428e9cbbf158cbe60a08531f3 (diff)
downloadopenvswitch-79a5251a501d64b04e76c68db50274a7b8ebfc88.tar.gz
test-conntrack: Fix conntrack benchmark by clearing conntrack metadata.
Packets in the benchmark must be treated as new packets, i.e. they should not have conntrack metadata set. Current code will set up 'pkt->md.conn' after the first run and all subsequent calls will hit the 'fast' processing that is intended for recirculated packets making a false impression that current conntrack implementation is lightning fast. Before the change: $ ./ovstest test-conntrack benchmark 4 33554432 32 1 conntrack: 1059 ms After (correct): $ ./ovstest test-conntrack benchmark 4 33554432 32 1 conntrack: 92785 ms Fixes: 594570ea1cde ("conntrack: Optimize recirculations.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
-rw-r--r--tests/test-conntrack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test-conntrack.c b/tests/test-conntrack.c
index e7c73220a..24c93e4a4 100644
--- a/tests/test-conntrack.c
+++ b/tests/test-conntrack.c
@@ -82,6 +82,7 @@ ct_thread_main(void *aux_)
{
struct thread_aux *aux = aux_;
struct dp_packet_batch *pkt_batch;
+ struct dp_packet *pkt;
ovs_be16 dl_type;
size_t i;
long long now = time_msec();
@@ -91,6 +92,9 @@ ct_thread_main(void *aux_)
for (i = 0; i < n_pkts; i += batch_size) {
conntrack_execute(ct, pkt_batch, dl_type, false, true, 0, NULL, NULL,
0, 0, NULL, NULL, now, 0);
+ DP_PACKET_BATCH_FOR_EACH (j, pkt, pkt_batch) {
+ pkt_metadata_init_conn(&pkt->md);
+ }
}
ovs_barrier_block(&barrier);
destroy_packets(pkt_batch);