This commit replace a while loop in miniflow_equal() with a call to memcmp() for performace reasons.
Signed-off-by: Daniele Di Proietto <[email protected]> --- This seems to improve throughput in my benchmarks (forwading one flow between two 'netdev-dpdk's). --- lib/flow.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/flow.c b/lib/flow.c index 9c9adc5..da4f79b 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -1748,11 +1748,7 @@ miniflow_equal(const struct miniflow *a, const struct miniflow *b) if (OVS_LIKELY(a_map == b_map)) { int count = miniflow_n_values(a); - while (count--) { - if (*ap++ != *bp++) { - return false; - } - } + return !memcmp(ap, bp, count * sizeof *ap); } else { uint64_t map; -- 2.0.0.rc0 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
