diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-11-12 21:59:49 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-11-22 19:57:31 +0100 |
commit | dfb631a187b9b04c066df60e28adf05334112ca6 (patch) | |
tree | 1fcae49d7f217e70467aab13ec8e375b62ba4a7c /drivers/infiniband/hw/mlx5 | |
parent | mlx4: trigger IB events needed by SMC (diff) | |
download | linux-dfb631a187b9b04c066df60e28adf05334112ca6.tar.xz linux-dfb631a187b9b04c066df60e28adf05334112ca6.zip |
RDMA/mlx5: Do not generate the uabi specs unconditionally
For DM there is no reason not to add the spec for the START_OFFSET, if DM
is not supported then ib_dev.alloc_dm is already set to NULL which ensures
we do not call the method.
For IPSEC, the core code should be setting ib_dev.create_flow_action_esp
to NULL to disable it, not relying on wonky manipulation of the specs.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 3e9057c1fedb..f12e045981fc 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -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; |