Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mlx5: Move and decouple user vendor structures

This patch decouples and moves vendors specific structures to
common UAPI folder which will be visible to all consumers.

These structures are used by user-space library driver
(libmlx5) and currently manually copied to that library.

This move will allow cross-compile against these files and
simplify introduction of vendor specific data.

Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Leon Romanovsky and committed by
Doug Ledford
3085e29e bd99fdea

+42 -47
+1
MAINTAINERS
··· 7819 7819 S: Supported 7820 7820 F: drivers/net/ethernet/mellanox/mlx5/core/ 7821 7821 F: include/linux/mlx5/ 7822 + F: include/uapi/rdma/mlx5-abi.h 7822 7823 7823 7824 MELLANOX MLX5 IB driver 7824 7825 M: Matan Barak <matanb@mellanox.com>
-1
drivers/infiniband/hw/mlx5/cq.c
··· 35 35 #include <rdma/ib_user_verbs.h> 36 36 #include <rdma/ib_cache.h> 37 37 #include "mlx5_ib.h" 38 - #include "user.h" 39 38 40 39 static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq) 41 40 {
-1
drivers/infiniband/hw/mlx5/main.c
··· 54 54 #include <linux/in.h> 55 55 #include <linux/etherdevice.h> 56 56 #include <linux/mlx5/fs.h> 57 - #include "user.h" 58 57 #include "mlx5_ib.h" 59 58 60 59 #define DRIVER_NAME "mlx5_ib"
+37
drivers/infiniband/hw/mlx5/mlx5_ib.h
··· 44 44 #include <linux/types.h> 45 45 #include <linux/mlx5/transobj.h> 46 46 #include <rdma/ib_user_verbs.h> 47 + #include <rdma/mlx5-abi.h> 47 48 48 49 #define mlx5_ib_dbg(dev, format, arg...) \ 49 50 pr_debug("%s:%s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ ··· 955 954 } 956 955 957 956 return 0; 957 + } 958 + 959 + static inline int get_qp_user_index(struct mlx5_ib_ucontext *ucontext, 960 + struct mlx5_ib_create_qp *ucmd, 961 + int inlen, 962 + u32 *user_index) 963 + { 964 + u8 cqe_version = ucontext->cqe_version; 965 + 966 + if (field_avail(struct mlx5_ib_create_qp, uidx, inlen) && 967 + !cqe_version && (ucmd->uidx == MLX5_IB_DEFAULT_UIDX)) 968 + return 0; 969 + 970 + if (!!(field_avail(struct mlx5_ib_create_qp, uidx, inlen) != 971 + !!cqe_version)) 972 + return -EINVAL; 973 + 974 + return verify_assign_uidx(cqe_version, ucmd->uidx, user_index); 975 + } 976 + 977 + static inline int get_srq_user_index(struct mlx5_ib_ucontext *ucontext, 978 + struct mlx5_ib_create_srq *ucmd, 979 + int inlen, 980 + u32 *user_index) 981 + { 982 + u8 cqe_version = ucontext->cqe_version; 983 + 984 + if (field_avail(struct mlx5_ib_create_srq, uidx, inlen) && 985 + !cqe_version && (ucmd->uidx == MLX5_IB_DEFAULT_UIDX)) 986 + return 0; 987 + 988 + if (!!(field_avail(struct mlx5_ib_create_srq, uidx, inlen) != 989 + !!cqe_version)) 990 + return -EINVAL; 991 + 992 + return verify_assign_uidx(cqe_version, ucmd->uidx, user_index); 958 993 } 959 994 #endif /* MLX5_IB_H */
-1
drivers/infiniband/hw/mlx5/mr.c
··· 40 40 #include <rdma/ib_umem_odp.h> 41 41 #include <rdma/ib_verbs.h> 42 42 #include "mlx5_ib.h" 43 - #include "user.h" 44 43 45 44 enum { 46 45 MAX_PENDING_REG_MR = 8,
-1
drivers/infiniband/hw/mlx5/qp.c
··· 35 35 #include <rdma/ib_cache.h> 36 36 #include <rdma/ib_user_verbs.h> 37 37 #include "mlx5_ib.h" 38 - #include "user.h" 39 38 40 39 /* not supported currently */ 41 40 static int wq_signature;
-1
drivers/infiniband/hw/mlx5/srq.c
··· 38 38 #include <rdma/ib_user_verbs.h> 39 39 40 40 #include "mlx5_ib.h" 41 - #include "user.h" 42 41 43 42 /* not supported currently */ 44 43 static int srq_signature;
+3 -42
drivers/infiniband/hw/mlx5/user.h include/uapi/rdma/mlx5-abi.h
··· 30 30 * SOFTWARE. 31 31 */ 32 32 33 - #ifndef MLX5_IB_USER_H 34 - #define MLX5_IB_USER_H 33 + #ifndef MLX5_ABI_USER_H 34 + #define MLX5_ABI_USER_H 35 35 36 36 #include <linux/types.h> 37 - 38 - #include "mlx5_ib.h" 39 37 40 38 enum { 41 39 MLX5_QP_FLAG_SIGNATURE = 1 << 0, ··· 47 49 enum { 48 50 MLX5_WQ_FLAG_SIGNATURE = 1 << 0, 49 51 }; 50 - 51 52 52 53 /* Increment this value if any changes that break userspace ABI 53 54 * compatibility are made. ··· 246 249 __u32 comp_mask; 247 250 __u32 reserved; 248 251 }; 249 - 250 - static inline int get_qp_user_index(struct mlx5_ib_ucontext *ucontext, 251 - struct mlx5_ib_create_qp *ucmd, 252 - int inlen, 253 - u32 *user_index) 254 - { 255 - u8 cqe_version = ucontext->cqe_version; 256 - 257 - if (field_avail(struct mlx5_ib_create_qp, uidx, inlen) && 258 - !cqe_version && (ucmd->uidx == MLX5_IB_DEFAULT_UIDX)) 259 - return 0; 260 - 261 - if (!!(field_avail(struct mlx5_ib_create_qp, uidx, inlen) != 262 - !!cqe_version)) 263 - return -EINVAL; 264 - 265 - return verify_assign_uidx(cqe_version, ucmd->uidx, user_index); 266 - } 267 - 268 - static inline int get_srq_user_index(struct mlx5_ib_ucontext *ucontext, 269 - struct mlx5_ib_create_srq *ucmd, 270 - int inlen, 271 - u32 *user_index) 272 - { 273 - u8 cqe_version = ucontext->cqe_version; 274 - 275 - if (field_avail(struct mlx5_ib_create_srq, uidx, inlen) && 276 - !cqe_version && (ucmd->uidx == MLX5_IB_DEFAULT_UIDX)) 277 - return 0; 278 - 279 - if (!!(field_avail(struct mlx5_ib_create_srq, uidx, inlen) != 280 - !!cqe_version)) 281 - return -EINVAL; 282 - 283 - return verify_assign_uidx(cqe_version, ucmd->uidx, user_index); 284 - } 285 - #endif /* MLX5_IB_USER_H */ 252 + #endif /* MLX5_ABI_USER_H */
+1
include/uapi/rdma/Kbuild
··· 7 7 header-y += rdma_user_cm.h 8 8 header-y += hfi/ 9 9 header-y += rdma_user_rxe.h 10 + header-y += mlx5-abi.h