Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
0002 /*
0003  * Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
0004  */
0005 
0006 #ifndef EFA_ABI_USER_H
0007 #define EFA_ABI_USER_H
0008 
0009 #include <linux/types.h>
0010 
0011 /*
0012  * Increment this value if any changes that break userspace ABI
0013  * compatibility are made.
0014  */
0015 #define EFA_UVERBS_ABI_VERSION 1
0016 
0017 /*
0018  * Keep structs aligned to 8 bytes.
0019  * Keep reserved fields as arrays of __u8 named reserved_XXX where XXX is the
0020  * hex bit offset of the field.
0021  */
0022 
0023 enum {
0024     EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH  = 1 << 0,
0025     EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1,
0026 };
0027 
0028 struct efa_ibv_alloc_ucontext_cmd {
0029     __u32 comp_mask;
0030     __u8 reserved_20[4];
0031 };
0032 
0033 enum efa_ibv_user_cmds_supp_udata {
0034     EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0,
0035     EFA_USER_CMDS_SUPP_UDATA_CREATE_AH    = 1 << 1,
0036 };
0037 
0038 struct efa_ibv_alloc_ucontext_resp {
0039     __u32 comp_mask;
0040     __u32 cmds_supp_udata_mask;
0041     __u16 sub_cqs_per_cq;
0042     __u16 inline_buf_size;
0043     __u32 max_llq_size; /* bytes */
0044     __u16 max_tx_batch; /* units of 64 bytes */
0045     __u16 min_sq_wr;
0046     __u8 reserved_a0[4];
0047 };
0048 
0049 struct efa_ibv_alloc_pd_resp {
0050     __u32 comp_mask;
0051     __u16 pdn;
0052     __u8 reserved_30[2];
0053 };
0054 
0055 enum {
0056     EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
0057 };
0058 
0059 struct efa_ibv_create_cq {
0060     __u32 comp_mask;
0061     __u32 cq_entry_size;
0062     __u16 num_sub_cqs;
0063     __u8 flags;
0064     __u8 reserved_58[5];
0065 };
0066 
0067 enum {
0068     EFA_CREATE_CQ_RESP_DB_OFF = 1 << 0,
0069 };
0070 
0071 struct efa_ibv_create_cq_resp {
0072     __u32 comp_mask;
0073     __u8 reserved_20[4];
0074     __aligned_u64 q_mmap_key;
0075     __aligned_u64 q_mmap_size;
0076     __u16 cq_idx;
0077     __u8 reserved_d0[2];
0078     __u32 db_off;
0079     __aligned_u64 db_mmap_key;
0080 };
0081 
0082 enum {
0083     EFA_QP_DRIVER_TYPE_SRD = 0,
0084 };
0085 
0086 struct efa_ibv_create_qp {
0087     __u32 comp_mask;
0088     __u32 rq_ring_size; /* bytes */
0089     __u32 sq_ring_size; /* bytes */
0090     __u32 driver_qp_type;
0091 };
0092 
0093 struct efa_ibv_create_qp_resp {
0094     __u32 comp_mask;
0095     /* the offset inside the page of the rq db */
0096     __u32 rq_db_offset;
0097     /* the offset inside the page of the sq db */
0098     __u32 sq_db_offset;
0099     /* the offset inside the page of descriptors buffer */
0100     __u32 llq_desc_offset;
0101     __aligned_u64 rq_mmap_key;
0102     __aligned_u64 rq_mmap_size;
0103     __aligned_u64 rq_db_mmap_key;
0104     __aligned_u64 sq_db_mmap_key;
0105     __aligned_u64 llq_desc_mmap_key;
0106     __u16 send_sub_cq_idx;
0107     __u16 recv_sub_cq_idx;
0108     __u8 reserved_1e0[4];
0109 };
0110 
0111 struct efa_ibv_create_ah_resp {
0112     __u32 comp_mask;
0113     __u16 efa_address_handle;
0114     __u8 reserved_30[2];
0115 };
0116 
0117 enum {
0118     EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
0119     EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
0120     EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
0121 };
0122 
0123 struct efa_ibv_ex_query_device_resp {
0124     __u32 comp_mask;
0125     __u32 max_sq_wr;
0126     __u32 max_rq_wr;
0127     __u16 max_sq_sge;
0128     __u16 max_rq_sge;
0129     __u32 max_rdma_size;
0130     __u32 device_caps;
0131 };
0132 
0133 #endif /* EFA_ABI_USER_H */