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
19enum 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
26struct mana_ib_create_cq {
27 __aligned_u64 buf_addr;
28 __u16 flags;
29 __u16 reserved0;
30 __u32 reserved1;
31};
32
33struct mana_ib_create_cq_resp {
34 __u32 cqid;
35 __u32 reserved;
36};
37
38struct mana_ib_create_qp {
39 __aligned_u64 sq_buf_addr;
40 __u32 sq_buf_size;
41 __u32 port;
42};
43
44struct mana_ib_create_qp_resp {
45 __u32 sqid;
46 __u32 cqid;
47 __u32 tx_vp_offset;
48 __u32 reserved;
49};
50
51struct mana_ib_create_rc_qp {
52 __aligned_u64 queue_buf[4];
53 __u32 queue_size[4];
54};
55
56struct mana_ib_create_rc_qp_resp {
57 __u32 queue_id[4];
58};
59
60struct mana_ib_create_wq {
61 __aligned_u64 wq_buf_addr;
62 __u32 wq_buf_size;
63 __u32 reserved;
64};
65
66/* RX Hash function flags */
67enum mana_ib_rx_hash_function_flags {
68 MANA_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
69};
70
71struct mana_ib_create_qp_rss {
72 __aligned_u64 rx_hash_fields_mask;
73 __u8 rx_hash_function;
74 __u8 reserved[7];
75 __u32 rx_hash_key_len;
76 __u8 rx_hash_key[40];
77 __u32 port;
78};
79
80struct rss_resp_entry {
81 __u32 cqid;
82 __u32 wqid;
83};
84
85struct mana_ib_create_qp_rss_resp {
86 __aligned_u64 num_entries;
87 struct rss_resp_entry entries[64];
88};
89
90#endif