summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/eswitch.h
diff options
context:
space:
mode:
authorOr Gerlitz2018-05-31 10:16:18 +0200
committerSaeed Mahameed2018-06-27 00:26:29 +0200
commit0efc8562491b7d36f6bbc4fbc8f3348cb6641e9c (patch)
treea90ddb33dfba78270d7292955185b3eb2bfc08f1 /include/linux/mlx5/eswitch.h
parentnet/mlx5e: Don't attempt to dereference the ppriv struct if not being eswitch... (diff)
downloadkernel-qcow2-linux-0efc8562491b7d36f6bbc4fbc8f3348cb6641e9c.tar.gz
kernel-qcow2-linux-0efc8562491b7d36f6bbc4fbc8f3348cb6641e9c.tar.xz
kernel-qcow2-linux-0efc8562491b7d36f6bbc4fbc8f3348cb6641e9c.zip
net/mlx5: E-Switch, Avoid setup attempt if not being e-switch manager
In smartnic env, the host (PF) driver might not be an e-switch manager, hence the FW will err on driver attempts to deal with setting/unsetting the eswitch and as a result the overall setup of sriov will fail. Fix that by avoiding the operation if e-switch management is not allowed for this driver instance. While here, move to use the correct name for the esw manager capability name. Fixes: 81848731ff40 ('net/mlx5: E-Switch, Add SR-IOV (FDB) support') Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reported-by: Guy Kushnir <guyk@mellanox.com> Reviewed-by: Eli Cohen <eli@melloanox.com> Tested-by: Eli Cohen <eli@melloanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/eswitch.h')
-rw-r--r--include/linux/mlx5/eswitch.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index d3c9db492b30..fab5121ffb8f 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -8,6 +8,8 @@
#include <linux/mlx5/driver.h>
+#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)
+
enum {
SRIOV_NONE,
SRIOV_LEGACY,