]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: Move two functions from mlxsw's qos_lib to lib
authorPetr Machata <petrm@mellanox.com>
Fri, 24 Jan 2020 13:23:15 +0000 (15:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Jan 2020 09:56:31 +0000 (10:56 +0100)
commite54ebc9467f62d533586107237a00a738ea9677a
treebf4af539ef122aa6662bfcb028367b0d4952c238
parentfda3fcf91bc801c9c5fe533dcb4d82f518d400cd
selftests: Move two functions from mlxsw's qos_lib to lib

The function humanize() is used for converting value in bits/s to a
human-friendly approximate value in Kbps, Mbps or Gbps. There is nothing
hardware-specific in that, so move the function to lib.sh.

Similarly for the rate() function, which just does a bit of math to
calculate a rate, given two counter values and a time interval.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh
tools/testing/selftests/net/forwarding/lib.sh