net/mlx5: fix errno for unsupported Direct Rules
authorOri Kam <orika@mellanox.com>
Tue, 7 May 2019 13:41:34 +0000 (13:41 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 8 May 2019 15:29:31 +0000 (17:29 +0200)
commit617ecc900087868adca9bccd148e7446aabf5743
tree7d25d28e54cd7b986a4a94c46a69bdf6320c41e9
parent10cfa5f2d4affef0561e5245aad4bc69b29cd671
net/mlx5: fix errno for unsupported Direct Rules

When Direct Rules API is not supported we don't set the errno.
This results in failing the function but with errno equals to zero.
The result of this is that a function that failed, is considered as
a function that worked correctly.

This commit fixes this issue by setting the errno to ENOTSUP and
returning this error when error value should be returned.

Since RDMA-CORE are returning positive errno we are also returning
positive error values.

Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5_glue.c