diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-09-23 08:25:23 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-09-23 08:25:23 +0000 |
commit | d906eed08e3d23868018b3ca9a888d1e8bed6227 (patch) | |
tree | 9dd2d1b8a362f8f127119ef5f39be76faecf7d4f /sys/dev/mlx5/mlx5_en/mlx5_en_main.c | |
parent | 77f0950ec9cc1ebc34452b0cf96a4b9d768e9f88 (diff) | |
download | FreeBSD-src-d906eed08e3d23868018b3ca9a888d1e8bed6227.zip FreeBSD-src-d906eed08e3d23868018b3ca9a888d1e8bed6227.tar.gz |
MFC r305875:
mlx5en: Verify port type is ethernet before creating network device
Else the mlx5en driver might attach to infiniband ports.
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/dev/mlx5/mlx5_en/mlx5_en_main.c')
-rw-r--r-- | sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 70a1af8..340c038 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -2654,6 +2654,9 @@ mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev) /* TODO: add more must-to-have features */ + if (MLX5_CAP_GEN(mdev, port_type) != MLX5_CAP_PORT_TYPE_ETH) + return (-ENODEV); + return (0); } |