RDMA/mlx5: Do not generate the uabi specs unconditionally
[sfrench/cifs-2.6.git] / drivers / infiniband / hw / mlx5 / main.c
index 3e9057c1fedbc33c94d188a16d2a0f2220853e0b..f12e045981fcb41f4634952a92b0af8f38e76999 100644 (file)
@@ -5555,12 +5555,8 @@ static int populate_specs_root(struct mlx5_ib_dev *dev)
        const struct uverbs_object_tree_def **trees = dev->driver_trees;
        size_t num_trees = 0;
 
-       if (mlx5_accel_ipsec_device_caps(dev->mdev) &
-           MLX5_ACCEL_IPSEC_CAP_DEVICE)
-               trees[num_trees++] = &mlx5_ib_flow_action;
-
-       if (MLX5_CAP_DEV_MEM(dev->mdev, memic))
-               trees[num_trees++] = &mlx5_ib_dm;
+       trees[num_trees++] = &mlx5_ib_flow_action;
+       trees[num_trees++] = &mlx5_ib_dm;
 
        if (MLX5_CAP_GEN_64(dev->mdev, general_obj_types) &
            MLX5_GENERAL_OBJ_TYPES_CAP_UCTX)
@@ -5878,9 +5874,14 @@ int mlx5_ib_stage_caps_init(struct mlx5_ib_dev *dev)
        dev->ib_dev.uverbs_ex_cmd_mask |=
                        (1ull << IB_USER_VERBS_EX_CMD_CREATE_FLOW) |
                        (1ull << IB_USER_VERBS_EX_CMD_DESTROY_FLOW);
-       dev->ib_dev.create_flow_action_esp = mlx5_ib_create_flow_action_esp;
+       if (mlx5_accel_ipsec_device_caps(dev->mdev) &
+           MLX5_ACCEL_IPSEC_CAP_DEVICE) {
+               dev->ib_dev.create_flow_action_esp =
+                       mlx5_ib_create_flow_action_esp;
+               dev->ib_dev.modify_flow_action_esp =
+                       mlx5_ib_modify_flow_action_esp;
+       }
        dev->ib_dev.destroy_flow_action = mlx5_ib_destroy_flow_action;
-       dev->ib_dev.modify_flow_action_esp = mlx5_ib_modify_flow_action_esp;
        dev->ib_dev.driver_id = RDMA_DRIVER_MLX5;
        dev->ib_dev.create_counters = mlx5_ib_create_counters;
        dev->ib_dev.destroy_counters = mlx5_ib_destroy_counters;