diff options
| -rw-r--r-- | drivers/infiniband/hw/mlx5/devx.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index 169ffffcf5ed..80b42d069328 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c | |||
| @@ -154,7 +154,7 @@ bool mlx5_ib_devx_is_flow_counter(void *obj, u32 *counter_id) | |||
| 154 | * must be considered upon checking for a valid object id. | 154 | * must be considered upon checking for a valid object id. |
| 155 | * For that the opcode of the creator command is encoded as part of the obj_id. | 155 | * For that the opcode of the creator command is encoded as part of the obj_id. |
| 156 | */ | 156 | */ |
| 157 | static u64 get_enc_obj_id(u16 opcode, u32 obj_id) | 157 | static u64 get_enc_obj_id(u32 opcode, u32 obj_id) |
| 158 | { | 158 | { |
| 159 | return ((u64)opcode << 32) | obj_id; | 159 | return ((u64)opcode << 32) | obj_id; |
| 160 | } | 160 | } |
| @@ -167,7 +167,9 @@ static u64 devx_get_obj_id(const void *in) | |||
| 167 | switch (opcode) { | 167 | switch (opcode) { |
| 168 | case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT: | 168 | case MLX5_CMD_OP_MODIFY_GENERAL_OBJECT: |
| 169 | case MLX5_CMD_OP_QUERY_GENERAL_OBJECT: | 169 | case MLX5_CMD_OP_QUERY_GENERAL_OBJECT: |
| 170 | obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_GENERAL_OBJECT, | 170 | obj_id = get_enc_obj_id(MLX5_CMD_OP_CREATE_GENERAL_OBJECT | |
| 171 | MLX5_GET(general_obj_in_cmd_hdr, in, | ||
| 172 | obj_type) << 16, | ||
| 171 | MLX5_GET(general_obj_in_cmd_hdr, in, | 173 | MLX5_GET(general_obj_in_cmd_hdr, in, |
| 172 | obj_id)); | 174 | obj_id)); |
| 173 | break; | 175 | break; |
| @@ -1171,6 +1173,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( | |||
| 1171 | struct mlx5_ib_dev *dev = to_mdev(c->ibucontext.device); | 1173 | struct mlx5_ib_dev *dev = to_mdev(c->ibucontext.device); |
| 1172 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)]; | 1174 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)]; |
| 1173 | struct devx_obj *obj; | 1175 | struct devx_obj *obj; |
| 1176 | u16 obj_type = 0; | ||
| 1174 | int err; | 1177 | int err; |
| 1175 | int uid; | 1178 | int uid; |
| 1176 | u32 obj_id; | 1179 | u32 obj_id; |
| @@ -1230,7 +1233,11 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( | |||
| 1230 | if (err) | 1233 | if (err) |
| 1231 | goto err_copy; | 1234 | goto err_copy; |
| 1232 | 1235 | ||
| 1233 | obj->obj_id = get_enc_obj_id(opcode, obj_id); | 1236 | if (opcode == MLX5_CMD_OP_CREATE_GENERAL_OBJECT) |
| 1237 | obj_type = MLX5_GET(general_obj_in_cmd_hdr, cmd_in, obj_type); | ||
| 1238 | |||
| 1239 | obj->obj_id = get_enc_obj_id(opcode | obj_type << 16, obj_id); | ||
| 1240 | |||
| 1234 | return 0; | 1241 | return 0; |
| 1235 | 1242 | ||
| 1236 | err_copy: | 1243 | err_copy: |
