1 /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */ 2 /* 3 * Copyright (c) 2022, Microsoft Corporation. All rights reserved. 4 */ 5 6 #ifndef MANA_ABI_USER_H 7 #define MANA_ABI_USER_H 8 9 #include <linux/types.h> 10 #include <rdma/ib_user_ioctl_verbs.h> 11 12 /* 13 * Increment this value if any changes that break userspace ABI 14 * compatibility are made. 15 */ 16 17 #define MANA_IB_UVERBS_ABI_VERSION 1 18 19 enum mana_ib_create_cq_flags { 20 /* Reserved for backward compatibility. Legacy 21 * kernel versions use it to create CQs in RNIC 22 */ 23 MANA_IB_CREATE_RNIC_CQ = 1 << 0, 24 }; 25 26 struct mana_ib_create_cq { 27 __aligned_u64 buf_addr; 28 __u16 comp_mask; 29 __u16 reserved0; 30 __u32 reserved1; 31 }; 32 33 struct mana_ib_create_cq_resp { 34 __u32 cqid; 35 __u32 reserved; 36 }; 37 38 struct mana_ib_create_qp { 39 __aligned_u64 sq_buf_addr; 40 __u32 sq_buf_size; 41 __u32 port; 42 }; 43 44 struct mana_ib_create_qp_resp { 45 __u32 sqid; 46 __u32 cqid; 47 __u32 tx_vp_offset; 48 __u32 reserved; 49 }; 50 51 struct mana_ib_create_rc_qp { 52 __aligned_u64 queue_buf[4]; 53 __u32 queue_size[4]; 54 }; 55 56 struct mana_ib_create_rc_qp_resp { 57 __u32 queue_id[4]; 58 }; 59 60 struct mana_ib_create_uc_qp { 61 __aligned_u64 queue_buf[3]; 62 __u32 queue_size[3]; 63 __u32 comp_mask; 64 }; 65 66 struct mana_ib_create_uc_qp_resp { 67 __u32 queue_id[3]; 68 __u32 reserved; 69 }; 70 71 struct mana_ib_create_wq { 72 __aligned_u64 wq_buf_addr; 73 __u32 wq_buf_size; 74 __u32 reserved; 75 }; 76 77 /* RX Hash function flags */ 78 enum mana_ib_rx_hash_function_flags { 79 MANA_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0, 80 }; 81 82 struct mana_ib_create_qp_rss { 83 __aligned_u64 rx_hash_fields_mask; 84 __u8 rx_hash_function; 85 __u8 reserved[7]; 86 __u32 rx_hash_key_len; 87 __u8 rx_hash_key[40]; 88 __u32 port; 89 }; 90 91 struct rss_resp_entry { 92 __u32 cqid; 93 __u32 wqid; 94 }; 95 96 struct mana_ib_create_qp_rss_resp { 97 __aligned_u64 num_entries; 98 struct rss_resp_entry entries[64]; 99 }; 100 101 enum mana_ib_ucontext_support { 102 MANA_IB_UCNTX_ALLOC_PDN_SUPPORT = 1 << 0, 103 }; 104 105 struct mana_ib_alloc_ucontext_resp { 106 __aligned_u64 comp_mask; 107 }; 108 109 enum mana_ib_create_pd_flags { 110 MANA_IB_PD_SHORT_PDN = 1 << 0, 111 }; 112 113 struct mana_ib_alloc_pd { 114 __u32 comp_mask; 115 __u32 reserved; 116 }; 117 118 struct mana_ib_alloc_pd_resp { 119 __u32 pdn; 120 __u32 reserved; 121 }; 122 123 #endif 124