bitrate: fix calculation to match API description
authorKevin Traynor <ktraynor@redhat.com>
Fri, 9 Jul 2021 15:19:37 +0000 (16:19 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 1 Oct 2021 13:31:06 +0000 (15:31 +0200)
commitbdd478eede455611245593edd43dc49a1d821449
tree9e349f6a25180363dc7648981b4f071dc4a12c3b
parent06ae9f0f92cf3bb85549f66dc3dfa11011d7db0f
bitrate: fix calculation to match API description

rte_stats_bitrate_calc() API states it returns 'Negative value on error'.

However, the implementation will return the error code from
rte_eth_stats_get() which may be non-zero on error.

Change the implementation of rte_stats_bitrate_calc() to match
the API description by always returning a negative value on error.

Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
lib/bitratestats/rte_bitrate.c