test/lpm: fix cycle calculation in RCU perf tests
authorDharmik Thakkar <dharmik.thakkar@arm.com>
Wed, 4 Nov 2020 18:58:55 +0000 (12:58 -0600)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 5 Nov 2020 14:59:26 +0000 (15:59 +0100)
commitc4c5b44c2146a2a048be3f49c70716660c88a11e
treedfae2da01d4902ff01b76796e481498adff83ff2
parentf8e90bcc1d407a191435cffb1b6b5b0a8ff01c92
test/lpm: fix cycle calculation in RCU perf tests

Fix incorrect calculations for LPM adds, LPM deletes,
and average cycles in RCU QSBR perf tests

Since, rcu qsbr tests run for 'RCU_ITERATIONS' and not
'ITERATIONS', replace 'ITERATIONS' with 'RCU_ITERATIONS'
for calculating adds, deletes, and cycles.

Also, for multi-writer perf test, each writer only writes
half of NUM_LDEPTH_ROUTE_ENTRIES.
For 2 writers, total adds (or deletes) should be
(RCU_ITERATIONS * NUM_LDEPTH_ROUTE_ENTRIES) instead of
(2 * RCU_ITERATIONS * NUM_LDEPTH_ROUTE_ENTRIES).

Since, for both the single and multi writer tests, total adds/deletes
is equal to (RCU_ITERATIONS * NUM_LDEPTH_ROUTE_ENTRIES),
this has been replaced with a macro 'TOTAL_WRITES' and furthermore,
'g_writes' has been removed since it is always a fixed value
equal to TOTAL_WRITES.

Fixes: eff30b59cc2e ("test/lpm: add RCU performance tests")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
app/test/test_lpm_perf.c