mlx5, xsk: Diversify return values from xsk_wakeup call paths
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Wed, 13 Apr 2022 15:30:12 +0000 (17:30 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 15 Apr 2022 19:11:01 +0000 (21:11 +0200)
commit7b7f2f273d8722d518758cc0770e784872cec781
tree06a09c3b5d2a6b596bfd0314d5bd7615979de8f2
parent0f8bf018899e0c3137912cb6d547d0d072fc3d20
mlx5, xsk: Diversify return values from xsk_wakeup call paths

Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO
return code as the case that XSK is not in the bound state. Returning
same code from ndo_xsk_wakeup can be misleading and simply makes it
harder to follow what is going on.

Change ENXIO in mlx5's ndo_xsk_wakeup() implementation to EINVAL, so
that when probing it is clear that something is wrong on the driver
side, not the xsk_{recv,send}msg.

There is a -ENETDOWN that can happen from both kernel/driver sides
though, but I don't have a correct replacement for this on one of the
sides, so let's keep it that way.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220413153015.453864-12-maciej.fijalkowski@intel.com
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c