Enrich DEVX support
Subsystems (5)
cover Enrich DEVX support
From: Leon Romanovsky <[email protected]>
Quoted 1 line
From Yishai,
-----------------------------------
This series enriches DEVX support in few aspects: it enables interoperability between DEVX and verbs and improves mechanism for controlling privileged DEVX commands.
The first patch updates mlx5 ifc file.
Next 3 patches enable modifying and querying verbs objects via the DEVX interface.
To achieve that the core layer introduced the 'UVERBS_IDR_ANY_OBJECT' type to match any IDR object. Once it's used by some driver's method, the infrastructure skips checking for the IDR type and it becomes the driver handler responsibility.
The DEVX methods of modify and query were changed to get any object type via the 'UVERBS_IDR_ANY_OBJECT' mechanism. The type checking is done per object as part of the driver code.
The next 3 patches introduce more robust mechanism for controlling privileged DEVX commands. The responsibility to block/allow per command was moved to be done in the firmware based on the UID credentials that the driver reports upon user context creation. This enables more granularity per command based on the device security model and the user credentials.
In addition, by introducing a valid range for 'general commands' we prevent the need to touch the driver's code any time that a new future command will be added.
The last patch fixes the XRC verbs flow once a DEVX context is used. This is needed as XRCD is some shared kernel resource and as such a kernel UID (=0) should be used in its related resources.
Thanks
Yishai Hadas (7):
net/mlx5: Update mlx5_ifc with DEVX UCTX capabilities bits IB/core: Introduce UVERBS_IDR_ANY_OBJECT
IB/core: Enable getting an object type from a given uobject IB/mlx5: Enable modify and query verbs objects via DEVX IB/mlx5: Enforce DEVX privilege by firmware IB/mlx5: Update the supported DEVX commands IB/mlx5: Allow XRC usage via verbs in DEVX context
drivers/infiniband/core/rdma_core.c | 27 +++-- drivers/infiniband/core/rdma_core.h | 21 ++-- drivers/infiniband/core/uverbs_uapi.c | 10 +- drivers/infiniband/hw/mlx5/devx.c | 142 ++++++++++++++++++++++---- drivers/infiniband/hw/mlx5/main.c | 4 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 +- drivers/infiniband/hw/mlx5/qp.c | 12 +-- drivers/infiniband/hw/mlx5/srq.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 26 ++++- include/rdma/uverbs_ioctl.h | 6 ++ include/rdma/uverbs_std_types.h | 12 +++ 11 files changed, 215 insertions(+), 53 deletions(-)
PATCH 1/7 net/mlx5: Update mlx5_ifc with DEVX UCTX capabilities bits
From: Yishai Hadas <[email protected]>
Expose device capabilities for DEVX user context, it includes which caps the device is supported and a matching bit to set as part of user context creation.
--- include/linux/mlx5/mlx5_ifc.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
include/linux/mlx5/mlx5_ifc.h +14 -2
@@ -883,6 +883,10 @@ enum { MLX5_CAP_UMR_FENCE_NONE = 0x2, }; +enum { +MLX5_UCTX_CAP_RAW_TX =1UL <<0 , +}; +struct mlx5_ifc_cmd_hca_cap_bits {u8 reserved_at_0[0x30 ];u8 vhca_id[0x10 ];
@@ -1193,7 +1197,13 @@ struct mlx5_ifc_cmd_hca_cap_bits {u8 num_vhca_ports[0x8 ];u8 reserved_at_618[0x6 ];u8 sw_owner_id[0x1 ]; -u8 reserved_at_61f[0x1e1 ]; +u8 reserved_at_61f[0x1 ]; + +u8 reserved_at_620[0x80 ]; + +u8 uctx_cap[0x20 ]; + +u8 reserved_at_6c0[0x140 ]; };enum mlx5_flow_destination_type {
@@ -9276,7 +9286,9 @@ struct mlx5_ifc_umem_bits {struct mlx5_ifc_uctx_bits {u8 modify_field_select[0x40 ]; -u8 reserved_at_40[0x1c0 ]; +u8 cap[0x20 ]; + +u8 reserved_at_60[0x1a0 ]; };struct mlx5_ifc_create_umem_in_bits {
Signature · 1 line
2.19.1
PATCH 2/7 IB/core: Introduce UVERBS_IDR_ANY_OBJECT
In reply to Leon RomanovskyFrom: Yishai Hadas <[email protected]>
Introduce the UVERBS_IDR_ANY_OBJECT type to match any IDR object.
Once used, the infrastructure skips checking for the IDR type, it becomes the driver handler responsibility.
This enables drivers to get in a given method an object from various of types.
--- drivers/infiniband/core/rdma_core.c | 27 +++++++++++++++++---------- drivers/infiniband/core/rdma_core.h | 16 +++++++++++++++- drivers/infiniband/core/uverbs_uapi.c | 9 +++++++-- include/rdma/uverbs_ioctl.h | 6 ++++++ 4 files changed, 45 insertions(+), 13 deletions(-)
drivers/infiniband/core/rdma_core.c +17 -10
@@ -398,16 +398,23 @@ struct ib_uobject *rdma_lookup_get_uobject(const struct uverbs_api_object *obj,struct ib_uobject *uobj;int ret; -if (!obj) -return ERR_PTR (-EINVAL ); +if (IS_ERR (obj) &&PTR_ERR (obj) == -ENOMSG ) { +/* must be UVERBS_IDR_ANY_OBJECT, see uapi_get_object() */ + uobj =lookup_get_idr_uobject (NULL , ufile, id, mode); +if (IS_ERR (uobj)) +return uobj; + }else { +if (IS_ERR (obj)) +return ERR_PTR (-EINVAL ); - uobj = obj->type_class->lookup_get (obj, ufile, id, mode); -if (IS_ERR (uobj)) -return uobj; + uobj = obj->type_class->lookup_get (obj, ufile, id, mode); +if (IS_ERR (uobj)) +return uobj; -if (uobj->uapi_object != obj) { - ret = -EINVAL ; - goto free; +if (uobj->uapi_object != obj) { + ret = -EINVAL ; + goto free; + } }/*
@@ -427,7 +434,7 @@ struct ib_uobject *rdma_lookup_get_uobject(const struct uverbs_api_object *obj,return uobj; free: - obj->type_class->lookup_put (uobj, mode); + uobj->uapi_object->type_class->lookup_put (uobj, mode);uverbs_uobject_put (uobj);return ERR_PTR (ret); }
@@ -491,7 +498,7 @@ struct ib_uobject *rdma_alloc_begin_uobject(const struct uverbs_api_object *obj, {struct ib_uobject *ret; -if (!obj) +if (IS_ERR (obj))return ERR_PTR (-EINVAL );/*
drivers/infiniband/core/rdma_core.h +15 -1
@@ -162,10 +162,24 @@ struct uverbs_api {const struct uverbs_api_write_method **write_ex_methods; }; +/* +* Get an uverbs_api_object that corresponds to the given object_id. +* Note: +* -ENOMSG means that any object is allowed to match during lookup. +*/ static inline const struct uverbs_api_object *uapi_get_object (struct uverbs_api *uapi,u16 object_id) { -return radix_tree_lookup (&uapi->radix,uapi_key_obj (object_id)); +const struct uverbs_api_object *res; + +if (object_id ==UVERBS_IDR_ANY_OBJECT ) +return ERR_PTR (-ENOMSG ); + + res =radix_tree_lookup (&uapi->radix,uapi_key_obj (object_id)); +if (!res) +return ERR_PTR (-ENOENT ); + +return res; }char *uapi_key_format (char *S ,unsigned int key);
drivers/infiniband/core/uverbs_uapi.c +7 -2
@@ -580,8 +580,13 @@ static void uapi_finalize_disable(struct uverbs_api *uapi)if (obj_key ==UVERBS_API_KEY_ERR )continue ; tmp_obj =uapi_get_object (uapi, obj_key); -if (tmp_obj && !tmp_obj->disabled) -continue ; +if (IS_ERR (tmp_obj)) { +if (PTR_ERR (tmp_obj) == -ENOMSG ) +continue ; + }else { +if (!tmp_obj->disabled) +continue ; + } starting_key = iter.index; uapi_remove_method(
include/rdma/uverbs_ioctl.h +6 -0
@@ -524,6 +524,12 @@ struct uapi_definition { .u2.objs_arr.max_len = _max_len, \ __VA_ARGS__ } }) +/* +* Only for use with UVERBS_ATTR_IDR, allows any uobject type to be accepted, +* the user must validate the type of the uobject instead. +*/ +#define UVERBS_IDR_ANY_OBJECT 0xFFFF +#define UVERBS_ATTR_IDR (_attr_id, _idr_type, _access, ...) \ (&(const struct uverbs_attr_def){ \ .id = _attr_id, \
Signature · 1 line
2.19.1
PATCH 3/7 IB/core: Enable getting an object type from a given uobject
In reply to Leon RomanovskyFrom: Yishai Hadas <[email protected]>
Enable getting an object type from a given uobject, the type is saved upon tree merging and is returned as part of some helper function.
--- drivers/infiniband/core/rdma_core.h | 5 ----- drivers/infiniband/core/uverbs_uapi.c | 1 + include/rdma/uverbs_std_types.h | 12 ++++++++++++ 3 files changed, 13 insertions(+), 5 deletions(-)
drivers/infiniband/core/rdma_core.h +0 -5
@@ -118,11 +118,6 @@ void release_ufile_idr_uobject(struct ib_uverbs_file *ufile);* Depending on ID the slot pointer in the radix tree points at one of these * structs. */ -struct uverbs_api_object { -const struct uverbs_obj_type *type_attrs; -const struct uverbs_obj_type_class *type_class; -u8 disabled:1 ; -};struct uverbs_api_ioctl_method {int (__rcu *handler)(struct uverbs_attr_bundle *attrs);
drivers/infiniband/core/uverbs_uapi.c +1 -0
@@ -184,6 +184,7 @@ static int uapi_merge_obj_tree(struct uverbs_api *uapi,if (WARN_ON (obj_elm->type_attrs))return -EINVAL ; + obj_elm->id = obj->id; obj_elm->type_attrs = obj->type_attrs; obj_elm->type_class = obj->type_attrs->type_class;/*
include/rdma/uverbs_std_types.h +12 -0
@@ -182,5 +182,17 @@ static inline void ib_set_flow(struct ib_uobject *uobj, struct ib_flow *ibflow, uflow->resources = uflow_res; } +struct uverbs_api_object { +const struct uverbs_obj_type *type_attrs; +const struct uverbs_obj_type_class *type_class; +u8 disabled:1 ; +u32 id; +}; + +static inline u32 uobj_get_object_id (struct ib_uobject *uobj) +{ +return uobj->uapi_object->id; +} +#endif
Signature · 1 line
2.19.1
PATCH 4/7 IB/mlx5: Enable modify and query verbs objects via DEVX
In reply to Leon RomanovskyFrom: Yishai Hadas <[email protected]>
Enables modify and query verbs objects via the DEVX interface. To support this the above DEVX handlers were changed to get any object type via the UVERBS_IDR_ANY_OBJECT mechanism.
The type checking and handling is done per object as part of the driver code.
--- drivers/infiniband/hw/mlx5/devx.c | 108 ++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 12 deletions(-)
drivers/infiniband/hw/mlx5/devx.c +96 -12
@@ -9,6 +9,7 @@#include <rdma/uverbs_ioctl.h> #include <rdma/mlx5_user_ioctl_cmds.h> #include <rdma/ib_umem.h> +#include <rdma/uverbs_std_types.h> #include <linux/mlx5/driver.h> #include <linux/mlx5/fs.h> #include "mlx5_ib.h"
@@ -132,7 +133,7 @@ static u64 get_enc_obj_id(u16 opcode, u32 obj_id)return ((u64 )opcode <<32 ) | obj_id; } -static int devx_is_valid_obj_id (struct devx_obj *obj,const void *in) +static u64 devx_get_obj_id (const void *in) {u16 opcode =MLX5_GET (general_obj_in_cmd_hdr, in, opcode);u64 obj_id;
@@ -336,13 +337,96 @@ static int devx_is_valid_obj_id(struct devx_obj *obj, const void *in) MLX5_GET(arm_xrq_in, in, xrqn));break ;default : + obj_id =0 ; + } + +return obj_id; +} + +static bool devx_is_valid_obj_id (struct ib_uobject *uobj,const void *in) +{ +u64 obj_id =devx_get_obj_id (in); + +if (!obj_id)return false; + +switch (uobj_get_object_id (uobj)) { +case UVERBS_OBJECT_CQ : +return get_enc_obj_id (MLX5_CMD_OP_CREATE_CQ , +to_mcq (uobj->object)->mcq.cqn) == + obj_id; + +case UVERBS_OBJECT_SRQ : + { +struct mlx5_core_srq *srq = &(to_msrq (uobj->object)->msrq); +struct mlx5_ib_dev *dev =to_mdev (uobj->context->device); +u16 opcode; + +switch (srq->common.res) { +case MLX5_RES_XSRQ : + opcode =MLX5_CMD_OP_CREATE_XRC_SRQ ; +break ; +case MLX5_RES_XRQ : + opcode =MLX5_CMD_OP_CREATE_XRQ ; +break ; +default : +if (!dev->mdev->issi) + opcode =MLX5_CMD_OP_CREATE_SRQ ; +else + opcode =MLX5_CMD_OP_CREATE_RMP ; + } + +return get_enc_obj_id (opcode, +to_msrq (uobj->object)->msrq.srqn) == + obj_id; } -if (obj_id == obj->obj_id) -return true; +case UVERBS_OBJECT_QP : + { +struct mlx5_ib_qp *qp =to_mqp (uobj->object); +enum ib_qp_type qp_type = qp->ibqp.qp_type; + +if (qp_type ==IB_QPT_RAW_PACKET || + (qp->flags &MLX5_IB_QP_UNDERLAY )) { +struct mlx5_ib_raw_packet_qp *raw_packet_qp = + &qp->raw_packet_qp; +struct mlx5_ib_rq *rq = &raw_packet_qp->rq; +struct mlx5_ib_sq *sq = &raw_packet_qp->sq; + +return (get_enc_obj_id (MLX5_CMD_OP_CREATE_RQ , + rq->base.mqp.qpn) == obj_id || +get_enc_obj_id (MLX5_CMD_OP_CREATE_SQ , + sq->base.mqp.qpn) == obj_id || +get_enc_obj_id (MLX5_CMD_OP_CREATE_TIR , + rq->tirn) == obj_id || +get_enc_obj_id (MLX5_CMD_OP_CREATE_TIS , + sq->tisn) == obj_id); + } + +if (qp_type ==MLX5_IB_QPT_DCT ) +return get_enc_obj_id (MLX5_CMD_OP_CREATE_DCT , + qp->dct.mdct.mqp.qpn) == obj_id; + +return get_enc_obj_id (MLX5_CMD_OP_CREATE_QP , + qp->ibqp.qp_num) == obj_id; + } -return false; +case UVERBS_OBJECT_WQ : +return get_enc_obj_id (MLX5_CMD_OP_CREATE_RQ , +to_mrwq (uobj->object)->core_qp.qpn) == + obj_id; + +case UVERBS_OBJECT_RWQ_IND_TBL : +return get_enc_obj_id (MLX5_CMD_OP_CREATE_RQT , +to_mrwq_ind_table (uobj->object)->rqtn) == + obj_id; + +case MLX5_IB_OBJECT_DEVX_OBJ : +return ((struct devx_obj *)uobj->object)->obj_id == obj_id; + +default : +return false; + } }static void devx_set_umem_valid (const void *in)
@@ -994,7 +1078,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_MODIFY)(struct ib_uobject *uobj =uverbs_attr_get_uobject (attrs,MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE );struct mlx5_ib_ucontext *c =to_mucontext (uobj->context); -struct devx_obj *obj = uobj->object; +struct mlx5_ib_dev *mdev =to_mdev (uobj->context->device);void *cmd_out;int err;int uid;
@@ -1006,7 +1090,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_MODIFY)(if (!devx_is_obj_modify_cmd (cmd_in))return -EINVAL ; -if (!devx_is_valid_obj_id (obj, cmd_in)) +if (!devx_is_valid_obj_id (uobj, cmd_in))return -EINVAL ; cmd_out =uverbs_zalloc (attrs, cmd_out_len);
@@ -1016,7 +1100,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_MODIFY)(MLX5_SET (general_obj_in_cmd_hdr, cmd_in, uid, uid);devx_set_umem_valid (cmd_in); - err =mlx5_cmd_exec (obj->mdev, cmd_in, + err =mlx5_cmd_exec (mdev->mdev, cmd_in,uverbs_attr_get_len (attrs,MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN ), cmd_out, cmd_out_len);if (err)
@@ -1035,10 +1119,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_QUERY)(struct ib_uobject *uobj =uverbs_attr_get_uobject (attrs,MLX5_IB_ATTR_DEVX_OBJ_QUERY_HANDLE );struct mlx5_ib_ucontext *c =to_mucontext (uobj->context); -struct devx_obj *obj = uobj->object;void *cmd_out;int err;int uid; +struct mlx5_ib_dev *mdev =to_mdev (uobj->context->device); uid =devx_get_uid (c, cmd_in);if (uid <0 )
@@ -1047,7 +1131,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_QUERY)(if (!devx_is_obj_query_cmd (cmd_in))return -EINVAL ; -if (!devx_is_valid_obj_id (obj, cmd_in)) +if (!devx_is_valid_obj_id (uobj, cmd_in))return -EINVAL ; cmd_out =uverbs_zalloc (attrs, cmd_out_len);
@@ -1055,7 +1139,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_QUERY)(return PTR_ERR (cmd_out);MLX5_SET (general_obj_in_cmd_hdr, cmd_in, uid, uid); - err =mlx5_cmd_exec (obj->mdev, cmd_in, + err =mlx5_cmd_exec (mdev->mdev, cmd_in,uverbs_attr_get_len (attrs,MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_IN ), cmd_out, cmd_out_len);if (err)
@@ -1293,7 +1377,7 @@ DECLARE_UVERBS_NAMED_METHOD_DESTROY( DECLARE_UVERBS_NAMED_METHOD( MLX5_IB_METHOD_DEVX_OBJ_MODIFY, UVERBS_ATTR_IDR(MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE, - MLX5_IB_OBJECT_DEVX_OBJ, + UVERBS_IDR_ANY_OBJECT, UVERBS_ACCESS_WRITE, UA_MANDATORY), UVERBS_ATTR_PTR_IN(
@@ -1309,7 +1393,7 @@ DECLARE_UVERBS_NAMED_METHOD( DECLARE_UVERBS_NAMED_METHOD( MLX5_IB_METHOD_DEVX_OBJ_QUERY, UVERBS_ATTR_IDR(MLX5_IB_ATTR_DEVX_OBJ_QUERY_HANDLE, - MLX5_IB_OBJECT_DEVX_OBJ, + UVERBS_IDR_ANY_OBJECT, UVERBS_ACCESS_READ, UA_MANDATORY), UVERBS_ATTR_PTR_IN(
Signature · 1 line
2.19.1
PATCH 5/7 IB/mlx5: Enforce DEVX privilege by firmware
In reply to Leon RomanovskyFrom: Yishai Hadas <[email protected]>
Enforce DEVX privilege by firmware, this enables future device functionality without the need to make driver changes unless a new privilege type will be introduced.
--- drivers/infiniband/hw/mlx5/devx.c | 17 +++++++++-------- drivers/infiniband/hw/mlx5/main.c | 4 ++-- drivers/infiniband/hw/mlx5/mlx5_ib.h | 5 +++-- 3 files changed, 14 insertions(+), 12 deletions(-)
drivers/infiniband/hw/mlx5/devx.c +9 -8
@@ -47,24 +47,31 @@ devx_ufile2uctx(const struct uverbs_attr_bundle *attrs)return to_mucontext (ib_uverbs_get_ucontext (attrs)); } -int mlx5_ib_devx_create (struct mlx5_ib_dev *dev) +int mlx5_ib_devx_create (struct mlx5_ib_dev *dev,bool is_user) {u32 in[MLX5_ST_SZ_DW (create_uctx_in)] = {0 };u32 out[MLX5_ST_SZ_DW (general_obj_out_cmd_hdr)] = {0 };u64 general_obj_types; -void *hdr; +void *hdr, *uctx;int err;u16 uid; +u32 cap =0 ; hdr =MLX5_ADDR_OF (create_uctx_in, in, hdr); + uctx =MLX5_ADDR_OF (create_uctx_in, in, uctx); general_obj_types =MLX5_CAP_GEN_64 (dev->mdev, general_obj_types);if (!(general_obj_types &MLX5_GENERAL_OBJ_TYPES_CAP_UCTX ) || !(general_obj_types &MLX5_GENERAL_OBJ_TYPES_CAP_UMEM ))return -EINVAL ; +if (is_user &&capable (CAP_NET_RAW ) && + (MLX5_CAP_GEN (dev->mdev, uctx_cap) &MLX5_UCTX_CAP_RAW_TX )) + cap |=MLX5_UCTX_CAP_RAW_TX ; +MLX5_SET (general_obj_in_cmd_hdr, hdr, opcode,MLX5_CMD_OP_CREATE_GENERAL_OBJECT );MLX5_SET (general_obj_in_cmd_hdr, hdr, obj_type,MLX5_OBJ_TYPE_UCTX ); +MLX5_SET (uctx, uctx, cap, cap); err =mlx5_cmd_exec (dev->mdev, in,sizeof (in), out,sizeof (out));if (err)
@@ -672,9 +679,6 @@ static int devx_get_uid(struct mlx5_ib_ucontext *c, void *cmd_in)if (!c->devx_uid)return -EINVAL ; -if (!capable (CAP_NET_RAW )) -return -EPERM ; -return c->devx_uid; }static bool devx_is_general_cmd (void *in)
@@ -1239,9 +1243,6 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_UMEM_REG)(if (!c->devx_uid)return -EINVAL ; -if (!capable (CAP_NET_RAW )) -return -EPERM ; - obj =kzalloc (sizeof (struct devx_umem ),GFP_KERNEL );if (!obj)return -ENOMEM ;
drivers/infiniband/hw/mlx5/main.c +2 -2
@@ -1763,7 +1763,7 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev,#endif if (req.flags &MLX5_IB_ALLOC_UCTX_DEVX ) { - err =mlx5_ib_devx_create (dev); + err =mlx5_ib_devx_create (dev, true);if (err <0 ) goto out_uars; context->devx_uid = err;
@@ -6234,7 +6234,7 @@ static int mlx5_ib_stage_devx_init(struct mlx5_ib_dev *dev) {int uid; - uid =mlx5_ib_devx_create (dev); + uid =mlx5_ib_devx_create (dev, false);if (uid >0 ) dev->devx_whitelist_uid = uid;
drivers/infiniband/hw/mlx5/mlx5_ib.h +3 -2
@@ -1268,7 +1268,7 @@ void mlx5_ib_put_native_port_mdev(struct mlx5_ib_dev *dev, u8 port_num);#if IS_ENABLED (CONFIG_INFINIBAND_USER_ACCESS ) -int mlx5_ib_devx_create (struct mlx5_ib_dev *dev); +int mlx5_ib_devx_create (struct mlx5_ib_dev *dev,bool is_user);void mlx5_ib_devx_destroy (struct mlx5_ib_dev *dev,u16 uid);const struct uverbs_object_tree_def *mlx5_ib_get_devx_tree (void );extern const struct uapi_definition mlx5_ib_devx_defs[];
@@ -1283,7 +1283,8 @@ int mlx5_ib_get_flow_trees(const struct uverbs_object_tree_def **root);void mlx5_ib_destroy_flow_action_raw (struct mlx5_ib_flow_action *maction);#else static inline int -mlx5_ib_devx_create (struct mlx5_ib_dev *dev) {return -EOPNOTSUPP ; }; +mlx5_ib_devx_create (struct mlx5_ib_dev *dev, +bool is_user) {return -EOPNOTSUPP ; }static inline void mlx5_ib_devx_destroy (struct mlx5_ib_dev *dev,u16 uid) {}static inline bool mlx5_ib_devx_is_flow_dest (void *obj,int *dest_id,int *dest_type)
Signature · 1 line
2.19.1
PATCH 6/7 IB/mlx5: Update the supported DEVX commands
In reply to Leon RomanovskyFrom: Yishai Hadas <[email protected]>
Update the supported DEVX commands, it includes adding to the query/modify command's list and to the encoding handling.
In addition, a valid range for general commands was added to be used for future commands.
--- drivers/infiniband/hw/mlx5/devx.c | 17 +++++++++++++++++ include/linux/mlx5/mlx5_ifc.h | 10 ++++++++++ 2 files changed, 27 insertions(+)
drivers/infiniband/hw/mlx5/devx.c +17 -0
@@ -314,6 +314,8 @@ static u64 devx_get_obj_id(const void *in) MLX5_GET(query_dct_in, in, dctn));break ;case MLX5_CMD_OP_QUERY_XRQ : +case MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY : +case MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS : obj_id =get_enc_obj_id (MLX5_CMD_OP_CREATE_XRQ ,MLX5_GET (query_xrq_in, in, xrqn));break ;
@@ -340,9 +342,16 @@ static u64 devx_get_obj_id(const void *in) MLX5_GET(drain_dct_in, in, dctn));break ;case MLX5_CMD_OP_ARM_XRQ : +case MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY : obj_id =get_enc_obj_id (MLX5_CMD_OP_CREATE_XRQ ,MLX5_GET (arm_xrq_in, in, xrqn));break ; +case MLX5_CMD_OP_QUERY_PACKET_REFORMAT_CONTEXT : + obj_id =get_enc_obj_id + (MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT , +MLX5_GET (query_packet_reformat_context_in, + in, packet_reformat_id)); +break ;default : obj_id =0 ; }
@@ -601,6 +610,7 @@ static bool devx_is_obj_modify_cmd(const void *in)case MLX5_CMD_OP_DRAIN_DCT :case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION :case MLX5_CMD_OP_ARM_XRQ : +case MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY :return true;case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY : {
@@ -642,6 +652,9 @@ static bool devx_is_obj_query_cmd(const void *in)case MLX5_CMD_OP_QUERY_XRC_SRQ :case MLX5_CMD_OP_QUERY_DCT :case MLX5_CMD_OP_QUERY_XRQ : +case MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY : +case MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS : +case MLX5_CMD_OP_QUERY_PACKET_REFORMAT_CONTEXT :return true;default :return false;
@@ -685,6 +698,10 @@ static bool devx_is_general_cmd(void *in) {u16 opcode =MLX5_GET (general_obj_in_cmd_hdr, in, opcode); +if (opcode >=MLX5_CMD_OP_GENERAL_START && + opcode <MLX5_CMD_OP_GENERAL_END ) +return true; +switch (opcode) {case MLX5_CMD_OP_QUERY_HCA_CAP :case MLX5_CMD_OP_QUERY_HCA_VPORT_CONTEXT :
include/linux/mlx5/mlx5_ifc.h +10 -0
@@ -144,6 +144,9 @@ enum {MLX5_CMD_OP_DESTROY_XRQ =0x718 ,MLX5_CMD_OP_QUERY_XRQ =0x719 ,MLX5_CMD_OP_ARM_XRQ =0x71a , +MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY =0x725 , +MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY =0x726 , +MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS =0x727 ,MLX5_CMD_OP_QUERY_VPORT_STATE =0x750 ,MLX5_CMD_OP_MODIFY_VPORT_STATE =0x751 , MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT = 0x752,
@@ -245,6 +248,7 @@ enum {MLX5_CMD_OP_MODIFY_FLOW_TABLE =0x93c ,MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT =0x93d ,MLX5_CMD_OP_DEALLOC_PACKET_REFORMAT_CONTEXT =0x93e , +MLX5_CMD_OP_QUERY_PACKET_REFORMAT_CONTEXT =0x93f ,MLX5_CMD_OP_ALLOC_MODIFY_HEADER_CONTEXT =0x940 ,MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT =0x941 , MLX5_CMD_OP_QUERY_MODIFY_HEADER_CONTEXT = 0x942,
@@ -260,6 +264,12 @@ enum {MLX5_CMD_OP_MAX }; +/* Valid range for general commands that don't work over an object */ +enum { +MLX5_CMD_OP_GENERAL_START =0xb00 , +MLX5_CMD_OP_GENERAL_END =0xd00 , +}; +struct mlx5_ifc_flow_table_fields_supported_bits {u8 outer_dmac[0x1 ];u8 outer_smac[0x1 ];
PATCH 7/7 IB/mlx5: Allow XRC usage via verbs in DEVX context
In reply to Leon RomanovskyFrom: Yishai Hadas <[email protected]>
Allows XRC usage from the verbs flow in a DEVX context.
As XRCD is some shared kernel resource between processes it should be created with UID=0 to point on that.
As a result once XRC QP/SRQ are created they must be used as well with UID=0 so that firmware will allow the XRCD usage.
--- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 - drivers/infiniband/hw/mlx5/qp.c | 12 +++++------- drivers/infiniband/hw/mlx5/srq.c | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-)
drivers/infiniband/hw/mlx5/mlx5_ib.h +0 -1
@@ -543,7 +543,6 @@ struct mlx5_ib_srq {struct mlx5_ib_xrcd {struct ib_xrcd ibxrcd;u32 xrcdn; -u16 uid; };enum mlx5_ib_mtt_access_flags {
drivers/infiniband/hw/mlx5/qp.c +5 -7
@@ -775,6 +775,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,__be64 *pas;void *qpc;int err; +u16 uid; err =ib_copy_from_udata (&ucmd, udata,sizeof (ucmd));if (err) {
@@ -836,7 +837,8 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, goto err_umem; } -MLX5_SET (create_qp_in, *in, uid,to_mpd (pd)->uid); + uid = (attr->qp_type !=IB_QPT_XRC_TGT ) ?to_mpd (pd)->uid :0 ; +MLX5_SET (create_qp_in, *in, uid, uid); pas = (__be64 *)MLX5_ADDR_OF (create_qp_in, *in, pas);if (ubuffer->umem)mlx5_ib_populate_pas (dev, ubuffer->umem, page_shift, pas,0 );
@@ -5513,7 +5515,6 @@ struct ib_xrcd *mlx5_ib_alloc_xrcd(struct ib_device *ibdev,struct mlx5_ib_dev *dev =to_mdev (ibdev);struct mlx5_ib_xrcd *xrcd;int err; -u16 uid;if (!MLX5_CAP_GEN (dev->mdev, xrc))return ERR_PTR (-ENOSYS );
@@ -5522,14 +5523,12 @@ struct ib_xrcd *mlx5_ib_alloc_xrcd(struct ib_device *ibdev,if (!xrcd)return ERR_PTR (-ENOMEM ); - uid = context ?to_mucontext (context)->devx_uid :0 ; - err =mlx5_cmd_xrcd_alloc (dev->mdev, &xrcd->xrcdn, uid); + err =mlx5_cmd_xrcd_alloc (dev->mdev, &xrcd->xrcdn,0 );if (err) {kfree (xrcd);return ERR_PTR (-ENOMEM ); } - xrcd->uid = uid;return &xrcd->ibxrcd; }
@@ -5537,10 +5536,9 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd) {struct mlx5_ib_dev *dev =to_mdev (xrcd->device);u32 xrcdn =to_mxrcd (xrcd)->xrcdn; -u16 uid =to_mxrcd (xrcd)->uid;int err; - err =mlx5_cmd_xrcd_dealloc (dev->mdev, xrcdn, uid); + err =mlx5_cmd_xrcd_dealloc (dev->mdev, xrcdn,0 );if (err)mlx5_ib_warn (dev,"failed to dealloc xrcdn 0x%x\n" , xrcdn);
drivers/infiniband/hw/mlx5/srq.c +1 -1
@@ -113,7 +113,7 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq, in->log_page_size = page_shift -MLX5_ADAPTER_PAGE_SHIFT ; in->page_offset = offset; - in->uid =to_mpd (pd)->uid; + in->uid = (in->type !=IB_SRQT_XRC ) ?to_mpd (pd)->uid :0 ;if (MLX5_CAP_GEN (dev->mdev, cqe_version) ==MLX5_CQE_VERSION_V1 && in->type !=IB_SRQT_BASIC ) in->user_index = uidx;
Signature · 1 line
2.19.1
Re: [PATCH mlx5-next 1/7] net/mlx5: Update mlx5_ifc with DEVX UCTX capabilities bits
In reply to Leon RomanovskyQuoted 9 lines · Leon Romanovsky
From: Yishai Hadas <[email protected]>
Expose device capabilities for DEVX user context, it includes which caps the device is supported and a matching bit to set as part of user context creation.
Signed-off-by Yishai Hadas <[email protected]>Reviewed-by Artemy Kovalyov <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>
This looks fine to me. Is it in mlx5-next yet?
Quoted 45 lines
--- include/linux/mlx5/mlx5_ifc.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)include/linux/mlx5/mlx5_ifc.h +14
-2@@ -883,6 +883,10 @@ enum { MLX5_CAP_UMR_FENCE_NONE = 0x2, }; +enum { +MLX5_UCTX_CAP_RAW_TX =1UL <<0 , +}; +struct mlx5_ifc_cmd_hca_cap_bits {u8 reserved_at_0[0x30 ];u8 vhca_id[0x10 ];@@ -1193,7 +1197,13 @@ struct mlx5_ifc_cmd_hca_cap_bits {u8 num_vhca_ports[0x8 ];u8 reserved_at_618[0x6 ];u8 sw_owner_id[0x1 ]; -u8 reserved_at_61f[0x1e1 ]; +u8 reserved_at_61f[0x1 ]; + +u8 reserved_at_620[0x80 ]; + +u8 uctx_cap[0x20 ]; + +u8 reserved_at_6c0[0x140 ]; };enum mlx5_flow_destination_type {@@ -9276,7 +9286,9 @@ struct mlx5_ifc_umem_bits {struct mlx5_ifc_uctx_bits {u8 modify_field_select[0x40 ]; -u8 reserved_at_40[0x1c0 ]; +u8 cap[0x20 ]; + +u8 reserved_at_60[0x1a0 ]; };struct mlx5_ifc_create_umem_in_bits {
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Re: [PATCH mlx5-next 1/7] net/mlx5: Update mlx5_ifc with DEVX UCTX capabilities bits
Quoted 7 lines · Doug Ledford
Quoted 6 lines · Leon Romanovsky
From: Yishai Hadas <[email protected]>
Expose device capabilities for DEVX user context, it includes which caps the device is supported and a matching bit to set as part of user context creation.
Quoted 6 lines
Quoted 3 lines
Signed-off-by Yishai Hadas <[email protected]>Reviewed-by Artemy Kovalyov <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>This looks fine to me. Is it in mlx5-next yet?
9d43faac02e3 net/mlx5: Update mlx5_ifc with DEVX UCTX capabilities bits
Thanks
Quoted 60 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
From Yishai,
-----------------------------------
This series enriches DEVX support in few aspects: it enables interoperability between DEVX and verbs and improves mechanism for controlling privileged DEVX commands.The first patch updates mlx5 ifc file.
Next 3 patches enable modifying and querying verbs objects via the DEVX interface.
To achieve that the core layer introduced the '
UVERBS_IDR_ANY_OBJECT' type to match any IDR object. Once it's used by some driver's method, the infrastructure skips checking for the IDR type and it becomes the driver handler responsibility.The DEVX methods of modify and query were changed to get any object type via the '
UVERBS_IDR_ANY_OBJECT' mechanism. The type checking is done per object as part of the driver code.The next 3 patches introduce more robust mechanism for controlling privileged DEVX commands. The responsibility to block/allow per command was moved to be done in the firmware based on the UID credentials that the driver reports upon user context creation. This enables more granularity per command based on the device security model and the user credentials.
In addition, by introducing a valid range for 'general commands' we prevent the need to touch the driver's code any time that a new future command will be added.
The last patch fixes the XRC verbs flow once a DEVX context is used. This is needed as XRCD is some shared kernel resource and as such a kernel UID (=0) should be used in its related resources.
Thanks
Yishai Hadas (7):
net/mlx5: Updatemlx5_ifcwith DEVX UCTX capabilities bits IB/core: IntroduceUVERBS_IDR_ANY_OBJECT
IB/core: Enable getting an object type from a given uobject IB/mlx5: Enable modify and query verbs objects via DEVX IB/mlx5: Enforce DEVX privilege by firmware IB/mlx5: Update the supported DEVX commands IB/mlx5: Allow XRC usage via verbs in DEVX contextdrivers/infiniband/core/rdma_core.c | 27 +++-- drivers/infiniband/core/rdma_core.h | 21 ++-- drivers/infiniband/core/uverbs_uapi.c | 10 +- drivers/infiniband/hw/mlx5/devx.c | 142 ++++++++++++++++++++++---- drivers/infiniband/hw/mlx5/main.c | 4 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 +- drivers/infiniband/hw/mlx5/qp.c | 12 +-- drivers/infiniband/hw/mlx5/srq.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 26 ++++- include/rdma/uverbs_ioctl.h | 6 ++ include/rdma/uverbs_std_types.h | 12 +++ 11 files changed, 215 insertions(+), 53 deletions(-)
Quoted 3 lines
--
2.19.1
Hi Leon,
I've put this into my wip/dl-for-next branch. Because it pulled in the mlx5-next tree (which was significant because the patch we wanted was at the tip and a whole slew of other patches were before it), the changeset for this patch looks much bigger. And it had the merge conflict you mentioned. You might want to double check my work before it gets moved over to the official for-next branch.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Quoted 66 lines · Doug Ledford
Quoted 60 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
From Yishai,
-----------------------------------
This series enriches DEVX support in few aspects: it enables interoperability between DEVX and verbs and improves mechanism for controlling privileged DEVX commands.The first patch updates mlx5 ifc file.
Next 3 patches enable modifying and querying verbs objects via the DEVX interface.
To achieve that the core layer introduced the '
UVERBS_IDR_ANY_OBJECT' type to match any IDR object. Once it's used by some driver's method, the infrastructure skips checking for the IDR type and it becomes the driver handler responsibility.The DEVX methods of modify and query were changed to get any object type via the '
UVERBS_IDR_ANY_OBJECT' mechanism. The type checking is done per object as part of the driver code.The next 3 patches introduce more robust mechanism for controlling privileged DEVX commands. The responsibility to block/allow per command was moved to be done in the firmware based on the UID credentials that the driver reports upon user context creation. This enables more granularity per command based on the device security model and the user credentials.
In addition, by introducing a valid range for 'general commands' we prevent the need to touch the driver's code any time that a new future command will be added.
The last patch fixes the XRC verbs flow once a DEVX context is used. This is needed as XRCD is some shared kernel resource and as such a kernel UID (=0) should be used in its related resources.
Thanks
Yishai Hadas (7):
net/mlx5: Updatemlx5_ifcwith DEVX UCTX capabilities bits IB/core: IntroduceUVERBS_IDR_ANY_OBJECT
IB/core: Enable getting an object type from a given uobject IB/mlx5: Enable modify and query verbs objects via DEVX IB/mlx5: Enforce DEVX privilege by firmware IB/mlx5: Update the supported DEVX commands IB/mlx5: Allow XRC usage via verbs in DEVX contextdrivers/infiniband/core/rdma_core.c | 27 +++-- drivers/infiniband/core/rdma_core.h | 21 ++-- drivers/infiniband/core/uverbs_uapi.c | 10 +- drivers/infiniband/hw/mlx5/devx.c | 142 ++++++++++++++++++++++---- drivers/infiniband/hw/mlx5/main.c | 4 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 +- drivers/infiniband/hw/mlx5/qp.c | 12 +-- drivers/infiniband/hw/mlx5/srq.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 26 ++++- include/rdma/uverbs_ioctl.h | 6 ++ include/rdma/uverbs_std_types.h | 12 +++ 11 files changed, 215 insertions(+), 53 deletions(-)Quoted 3 lines
--
2.19.1
Quoted 5 lines
Hi Leon,
I've put this into my wip/dl-for-next branch. Because it pulled in the mlx5-next tree (which was significant because the patch we wanted was at the tip and a whole slew of other patches were before it),
Yes, this is how the shared branch works, DaveM merges it, we don't have to unless we have a dependency, so it can accumulate a bit.
Quoted 4 lines
the changeset
for this patch looks much bigger. And it had the merge conflict you mentioned. You might want to double check my work before it gets moved over to the official for-next branch.
It is a bit easier to follow the git log if merges are done with the --log option to summarize what was pulled in.
Jason
Quoted 66 lines · Jason Gunthorpe
Quoted 65 lines · Doug Ledford
Quoted 63 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
From Yishai,
-----------------------------------
This series enriches DEVX support in few aspects: it enables interoperability between DEVX and verbs and improves mechanism for controlling privileged DEVX commands.The first patch updates mlx5 ifc file.
Next 3 patches enable modifying and querying verbs objects via the DEVX interface.
To achieve that the core layer introduced the '
UVERBS_IDR_ANY_OBJECT' type to match any IDR object. Once it's used by some driver's method, the infrastructure skips checking for the IDR type and it becomes the driver handler responsibility.The DEVX methods of modify and query were changed to get any object type via the '
UVERBS_IDR_ANY_OBJECT' mechanism. The type checking is done per object as part of the driver code.The next 3 patches introduce more robust mechanism for controlling privileged DEVX commands. The responsibility to block/allow per command was moved to be done in the firmware based on the UID credentials that the driver reports upon user context creation. This enables more granularity per command based on the device security model and the user credentials.
In addition, by introducing a valid range for 'general commands' we prevent the need to touch the driver's code any time that a new future command will be added.
The last patch fixes the XRC verbs flow once a DEVX context is used. This is needed as XRCD is some shared kernel resource and as such a kernel UID (=0) should be used in its related resources.
Thanks
Yishai Hadas (7):
net/mlx5: Updatemlx5_ifcwith DEVX UCTX capabilities bits IB/core: IntroduceUVERBS_IDR_ANY_OBJECT
IB/core: Enable getting an object type from a given uobject IB/mlx5: Enable modify and query verbs objects via DEVX IB/mlx5: Enforce DEVX privilege by firmware IB/mlx5: Update the supported DEVX commands IB/mlx5: Allow XRC usage via verbs in DEVX contextdrivers/infiniband/core/rdma_core.c | 27 +++-- drivers/infiniband/core/rdma_core.h | 21 ++-- drivers/infiniband/core/uverbs_uapi.c | 10 +- drivers/infiniband/hw/mlx5/devx.c | 142 ++++++++++++++++++++++---- drivers/infiniband/hw/mlx5/main.c | 4 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 +- drivers/infiniband/hw/mlx5/qp.c | 12 +-- drivers/infiniband/hw/mlx5/srq.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 26 ++++- include/rdma/uverbs_ioctl.h | 6 ++ include/rdma/uverbs_std_types.h | 12 +++ 11 files changed, 215 insertions(+), 53 deletions(-)--
2.19.1
Quoted 8 lines
Quoted 5 lines
Hi Leon,
I've put this into my wip/dl-for-next branch. Because it pulled in the mlx5-next tree (which was significant because the patch we wanted was at the tip and a whole slew of other patches were before it),
Yes, this is how the shared branch works, DaveM merges it, we don't have to unless we have a dependency, so it can accumulate a bit.
I get how it works :-P. I was just commenting that it had in fact built up an accumulation.
Quoted 7 lines
Quoted 4 lines
the changeset
for this patch looks much bigger. And it had the merge conflict you mentioned. You might want to double check my work before it gets moved over to the official for-next branch.It is a bit easier to follow the git log if merges are done with the --log option to summarize what was pulled in.
I'll modify my merge alias to add it. As it stands, I'll repush this to my wip branch with the --log option added.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Quoted 84 lines · Doug Ledford
Quoted 66 lines · Jason Gunthorpe
Quoted 65 lines · Doug Ledford
Quoted 63 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
From Yishai,
-----------------------------------
This series enriches DEVX support in few aspects: it enables interoperability between DEVX and verbs and improves mechanism for controlling privileged DEVX commands.The first patch updates mlx5 ifc file.
Next 3 patches enable modifying and querying verbs objects via the DEVX interface.
To achieve that the core layer introduced the '
UVERBS_IDR_ANY_OBJECT' type to match any IDR object. Once it's used by some driver's method, the infrastructure skips checking for the IDR type and it becomes the driver handler responsibility.The DEVX methods of modify and query were changed to get any object type via the '
UVERBS_IDR_ANY_OBJECT' mechanism. The type checking is done per object as part of the driver code.The next 3 patches introduce more robust mechanism for controlling privileged DEVX commands. The responsibility to block/allow per command was moved to be done in the firmware based on the UID credentials that the driver reports upon user context creation. This enables more granularity per command based on the device security model and the user credentials.
In addition, by introducing a valid range for 'general commands' we prevent the need to touch the driver's code any time that a new future command will be added.
The last patch fixes the XRC verbs flow once a DEVX context is used. This is needed as XRCD is some shared kernel resource and as such a kernel UID (=0) should be used in its related resources.
Thanks
Yishai Hadas (7):
net/mlx5: Updatemlx5_ifcwith DEVX UCTX capabilities bits IB/core: IntroduceUVERBS_IDR_ANY_OBJECT
IB/core: Enable getting an object type from a given uobject IB/mlx5: Enable modify and query verbs objects via DEVX IB/mlx5: Enforce DEVX privilege by firmware IB/mlx5: Update the supported DEVX commands IB/mlx5: Allow XRC usage via verbs in DEVX contextdrivers/infiniband/core/rdma_core.c | 27 +++-- drivers/infiniband/core/rdma_core.h | 21 ++-- drivers/infiniband/core/uverbs_uapi.c | 10 +- drivers/infiniband/hw/mlx5/devx.c | 142 ++++++++++++++++++++++---- drivers/infiniband/hw/mlx5/main.c | 4 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 +- drivers/infiniband/hw/mlx5/qp.c | 12 +-- drivers/infiniband/hw/mlx5/srq.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 26 ++++- include/rdma/uverbs_ioctl.h | 6 ++ include/rdma/uverbs_std_types.h | 12 +++ 11 files changed, 215 insertions(+), 53 deletions(-)--
2.19.1Quoted 8 lines
Quoted 5 lines
Hi Leon,
I've put this into my wip/dl-for-next branch. Because it pulled in the mlx5-next tree (which was significant because the patch we wanted was at the tip and a whole slew of other patches were before it),
Yes, this is how the shared branch works, DaveM merges it, we don't have to unless we have a dependency, so it can accumulate a bit.
I get how it works :-P. I was just commenting that it had in fact built up an accumulation.
Quoted 5 lines
Quoted 4 lines
the changeset
for this patch looks much bigger. And it had the merge conflict you mentioned. You might want to double check my work before it gets moved over to the official for-next branch.
Quoted 5 lines
Quoted 2 lines
It is a bit easier to follow the git log if merges are done with the --log option to summarize what was pulled in.
I'll modify my merge alias to add it. As it stands, I'll repush this to my wip branch with the --log option added.
Thanks, I looked on the merge commit 33cb7e760de ("Merge 'mlx5-next' into mlx5-devx") and it looks exactly as I have.
Thanks again.
Quoted 5 lines
--
Doug Ledford <[email protected]>GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD