aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/mellanox/mlx4/intf.c
diff options
context:
space:
mode:
authorPetr Pavlu <petr.pavlu@suse.com>2023-08-21 15:12:24 +0200
committerDavid S. Miller <davem@davemloft.net>2023-08-23 08:25:28 +0100
commit7d22b1cb9d84d209bdd6f43ef683d7322682d6b4 (patch)
tree1aace2277a1192e917213cc035acd2f6f1209df5 /drivers/net/ethernet/mellanox/mlx4/intf.c
parentmlx4: Connect the ethernet part to the auxiliary bus (diff)
downloadwireguard-linux-7d22b1cb9d84d209bdd6f43ef683d7322682d6b4.tar.xz
wireguard-linux-7d22b1cb9d84d209bdd6f43ef683d7322682d6b4.zip
mlx4: Connect the infiniband part to the auxiliary bus
Use the auxiliary bus to perform device management of the infiniband part of the mlx4 driver. Signed-off-by: Petr Pavlu <petr.pavlu@suse.com> Tested-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Acked-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/intf.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/intf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/intf.c b/drivers/net/ethernet/mellanox/mlx4/intf.c
index 95ff0ea435e2..7579031786ac 100644
--- a/drivers/net/ethernet/mellanox/mlx4/intf.c
+++ b/drivers/net/ethernet/mellanox/mlx4/intf.c
@@ -59,11 +59,24 @@ static bool is_eth_supported(struct mlx4_dev *dev)
return false;
}
+static bool is_ib_supported(struct mlx4_dev *dev)
+{
+ for (int port = 1; port <= dev->caps.num_ports; port++)
+ if (dev->caps.port_type[port] == MLX4_PORT_TYPE_IB)
+ return true;
+
+ if (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)
+ return true;
+
+ return false;
+}
+
static const struct mlx4_adev_device {
const char *suffix;
bool (*is_supported)(struct mlx4_dev *dev);
} mlx4_adev_devices[] = {
{ "eth", is_eth_supported },
+ { "ib", is_ib_supported },
};
int mlx4_adev_init(struct mlx4_dev *dev)