aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
diff options
context:
space:
mode:
authorRoi Dayan <roid@mellanox.com>2019-02-21 18:24:48 +0200
committerSaeed Mahameed <saeedm@mellanox.com>2019-03-01 12:04:16 -0800
commit724b509ca02367dbd5f5f90b0c8546280c5abc72 (patch)
tree5e8cd5142c7af2f163a697576d73e1ca9dfedadd /drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
parentnet/mlx5: Use own workqueue for lag netdev events processing (diff)
downloadlinux-dev-724b509ca02367dbd5f5f90b0c8546280c5abc72.tar.xz
linux-dev-724b509ca02367dbd5f5f90b0c8546280c5abc72.zip
net/mlx5: Add multipath mode
In order to offload ecmp-on-host scheme where next-hop routes are used, we will make use of HW LAG. Add accessor function to let upper layers in the driver to realize if the lag acts in multi-path mode. Signed-off-by: Roi Dayan <roid@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c b/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
new file mode 100644
index 000000000000..2d2861cd4e02
--- /dev/null
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
+/* Copyright (c) 2019 Mellanox Technologies. */
+
+#include <linux/netdevice.h>
+#include "lag.h"
+#include "mlx5_core.h"
+#include "eswitch.h"
+
+static bool __mlx5_lag_is_multipath(struct mlx5_lag *ldev)
+{
+ return !!(ldev->flags & MLX5_LAG_FLAG_MULTIPATH);
+}
+
+bool mlx5_lag_is_multipath(struct mlx5_core_dev *dev)
+{
+ struct mlx5_lag *ldev;
+ bool res;
+
+ ldev = mlx5_lag_dev_get(dev);
+ res = ldev && __mlx5_lag_is_multipath(ldev);
+
+ return res;
+}