net/mlx5: Set num_vhca_ports capability
authorDaniel Jurgens <danielj@mellanox.com>
Thu, 4 Jan 2018 15:25:44 +0000 (17:25 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 8 Jan 2018 18:42:48 +0000 (11:42 -0700)
Set the current capability to the max capability. Doing so enables dual
port RoCE functionality if supported by the firmware.

Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c

index e382a3ca759ee95fc55b5bb265b980685574d9c3..d4a471a76d823d74e4ce3c774de5275e4ce9c3da 100644 (file)
@@ -557,6 +557,12 @@ static int handle_hca_cap(struct mlx5_core_dev *dev)
        if (MLX5_CAP_GEN_MAX(dev, dct))
                MLX5_SET(cmd_hca_cap, set_hca_cap, dct, 1);
 
+       if (MLX5_CAP_GEN_MAX(dev, num_vhca_ports))
+               MLX5_SET(cmd_hca_cap,
+                        set_hca_cap,
+                        num_vhca_ports,
+                        MLX5_CAP_GEN_MAX(dev, num_vhca_ports));
+
        err = set_caps(dev, set_ctx, set_sz,
                       MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE);