include/rdma/uverbs_ioctl.h
Source file repositories/reference/linux-study-clean/include/rdma/uverbs_ioctl.h
File Facts
- System
- Linux kernel
- Corpus path
include/rdma/uverbs_ioctl.h- Extension
.h- Size
- 38951 bytes
- Lines
- 1155
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rdma/uverbs_types.hlinux/uaccess.hrdma/rdma_user_ioctl.hrdma/ib_user_ioctl_verbs.hrdma/ib_user_ioctl_cmds.h
Detected Declarations
struct uverbs_attr_specstruct uverbs_attr_defstruct uverbs_method_defstruct uverbs_object_defstruct uapi_definitionstruct uverbs_ptr_attrstruct uverbs_obj_attrstruct uverbs_objs_arr_attrstruct uverbs_attrstruct uverbs_attr_bundleenum uverbs_attr_typeenum uverbs_obj_accessenum uapi_radix_dataenum uapi_definition_kindenum uapi_definition_scopefunction uapi_key_objfunction uapi_key_is_objectfunction uapi_key_ioctl_methodfunction uapi_key_write_methodfunction uapi_key_write_ex_methodfunction uapi_key_attr_to_ioctl_methodfunction uapi_key_is_ioctl_methodfunction uapi_key_is_write_methodfunction uapi_key_is_write_ex_methodfunction uapi_key_attrs_startfunction uapi_key_attrfunction uapi_key_is_attrfunction uapi_key_attrfunction uapi_bkey_to_key_attrfunction offsetoffunction uverbs_attr_is_validfunction rdma_udata_to_uverbs_attr_bundlefunction uverbs_attr_get_enum_idfunction uverbs_attr_get_lenfunction uverbs_attr_ptr_get_array_sizefunction uverbs_attr_get_uobjs_arrfunction uverbs_attr_ptr_is_inlinefunction _uverbs_copy_fromfunction _uverbs_copy_from_or_zerofunction ib_uverbs_get_ucontextfunction uverbs_get_flags64function uverbs_get_flags32function uverbs_copy_tofunction uverbs_get_buffer_descfunction _uverbs_get_constfunction uverbs_copy_to_struct_or_zerofunction _uverbs_get_const_signedfunction _uverbs_get_const_unsigned
Annotated Snippet
struct uverbs_attr_spec {
u8 type;
/*
* Support extending attributes by length. Allow the user to provide
* more bytes than ptr.len, but check that everything after is zero'd
* by the user.
*/
u8 zero_trailing:1;
/*
* Valid only for PTR_IN. Allocate and copy the data inside
* the parser
*/
u8 alloc_and_copy:1;
u8 mandatory:1;
/* True if this is from UVERBS_ATTR_UHW */
u8 is_udata:1;
union {
struct {
/* Current known size to kernel */
u16 len;
/* User isn't allowed to provide something < min_len */
u16 min_len;
} ptr;
struct {
/*
* higher bits mean the namespace and lower bits mean
* the type id within the namespace.
*/
u16 obj_type;
u8 access;
} obj;
struct {
u8 num_elems;
} enum_def;
} u;
/* This weird split lets us remove some padding */
union {
struct {
/*
* The enum attribute can select one of the attributes
* contained in the ids array. Currently only PTR_IN
* attributes are supported in the ids array.
*/
const struct uverbs_attr_spec *ids;
} enum_def;
struct {
/*
* higher bits mean the namespace and lower bits mean
* the type id within the namespace.
*/
u16 obj_type;
u16 min_len;
u16 max_len;
u8 access;
} objs_arr;
} u2;
};
/*
* Information about the API is loaded into a radix tree. For IOCTL we start
* with a tuple of:
* object_id, attr_id, method_id
*
* Which is a 48 bit value, with most of the bits guaranteed to be zero. Based
* on the current kernel support this is compressed into 16 bit key for the
* radix tree. Since this compression is entirely internal to the kernel the
* below limits can be revised if the kernel gains additional data.
*
* With 64 leafs per node this is a 3 level radix tree.
*
* The tree encodes multiple types, and uses a scheme where OBJ_ID,0,0 returns
* the object slot, and OBJ_ID,METH_ID,0 and returns the method slot.
*
* This also encodes the tables for the write() and write() extended commands
* using the coding
* OBJ_ID,UVERBS_API_METHOD_IS_WRITE,command #
* OBJ_ID,UVERBS_API_METHOD_IS_WRITE_EX,command_ex #
* ie the WRITE path is treated as a special method type in the ioctl
* framework.
*/
enum uapi_radix_data {
UVERBS_API_NS_FLAG = 1U << UVERBS_ID_NS_SHIFT,
UVERBS_API_ATTR_KEY_BITS = 6,
Annotation
- Immediate include surface: `rdma/uverbs_types.h`, `linux/uaccess.h`, `rdma/rdma_user_ioctl.h`, `rdma/ib_user_ioctl_verbs.h`, `rdma/ib_user_ioctl_cmds.h`.
- Detected declarations: `struct uverbs_attr_spec`, `struct uverbs_attr_def`, `struct uverbs_method_def`, `struct uverbs_object_def`, `struct uapi_definition`, `struct uverbs_ptr_attr`, `struct uverbs_obj_attr`, `struct uverbs_objs_arr_attr`, `struct uverbs_attr`, `struct uverbs_attr_bundle`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.