File Index
Files and directories
Sign in
FILE

ib_ucaps.h

File preview with syntax highlighting.

linux-6.19.14/include/rdma/ib_ucaps.h C
 1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
 2/*
 3 * Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved
 4 */
 5
 6#ifndef _IB_UCAPS_H_
 7#define _IB_UCAPS_H_
 8
 9#define UCAP_ENABLED(ucaps, type) (!!((ucaps) & (1U << (type))))
10
11enum rdma_user_cap {
12	RDMA_UCAP_MLX5_CTRL_LOCAL,
13	RDMA_UCAP_MLX5_CTRL_OTHER_VHCA,
14	RDMA_UCAP_MAX
15};
16
17void ib_cleanup_ucaps(void);
18int ib_get_ucaps(int *fds, int fd_count, uint64_t *idx_mask);
19#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
20int ib_create_ucap(enum rdma_user_cap type);
21void ib_remove_ucap(enum rdma_user_cap type);
22#else
23static inline int ib_create_ucap(enum rdma_user_cap type)
24{
25	return -EOPNOTSUPP;
26}
27static inline void ib_remove_ucap(enum rdma_user_cap type) {}
28#endif /* CONFIG_INFINIBAND_USER_ACCESS */
29
30#endif /* _IB_UCAPS_H_ */
~/ Read-only file preview.