regex/mlx5: improve error messages in RXP rules flush
authorMichael Baum <michaelba@nvidia.com>
Wed, 18 Nov 2020 17:00:09 +0000 (17:00 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 22 Nov 2020 13:53:24 +0000 (14:53 +0100)
commit3fed64d0e4ed841d091b01a26fae209df8e6ce86
tree9ec3be91ad257a147595d7e2c5c01a9d44be9f7c
parentacb93dbcd0a766330d6f84340fb174ad2a97a943
regex/mlx5: improve error messages in RXP rules flush

During the rules flush, the rxp_poll_csr_for_value function is called
twice. The rxp_poll_csr_for_value function can fail for two reasons:
1. It could not read the value from register, in which case the
function returns -1.
2. It read a value, but not the value it expected to receive. In this
case it returns -EBUSY.

When the function fails it prints an error message that is relevant only
for a second type of failure. Moreover, for failure of the first type it
prints a value of an uninitialized variable.
In case of success, the function prints a debug message about the number
of cycles it took. This line was probably copied by mistake, since the
variable it reads from, is always equal to 0 and is not an indicator of
the number of cycles.

Remove the incorrect line about the cycles, and reduce the error print
only for the relevant error.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
drivers/regex/mlx5/mlx5_rxp.c