Skip to content

Commit a7fe738

Browse files
rleondledford
authored andcommitted
IB/ocrdma: Move user vendor structures
This patch moves ocrdma vendor's specific structures to common UAPI folder which will be visible to all consumers. These structures are used by user-space library driver (libmlx4) and currently manually copied to that library. This move will allow cross-compile against these files and simplify introduction of vendor specific data. In addition, it changes types to be __uXX instead of uXX. Signed-off-by: Leon Romanovsky <[email protected]> Acked-By: Devesh Sharma <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 9ce28a2 commit a7fe738

File tree

5 files changed

+74
-70
lines changed

5 files changed

+74
-70
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10601,6 +10601,7 @@ L: [email protected]
1060110601
W: http://www.emulex.com
1060210602
S: Supported
1060310603
F: drivers/infiniband/hw/ocrdma/
10604+
F: include/uapi/rdma/ocrdma-abi.h
1060410605

1060510606
SFC NETWORK DRIVER
1060610607
M: Solarflare linux maintainers <[email protected]>

drivers/infiniband/hw/ocrdma/ocrdma_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include "be_roce.h"
5757
#include "ocrdma_hw.h"
5858
#include "ocrdma_stats.h"
59-
#include "ocrdma_abi.h"
59+
#include <rdma/ocrdma-abi.h>
6060

6161
MODULE_VERSION(OCRDMA_ROCE_DRV_VERSION);
6262
MODULE_DESCRIPTION(OCRDMA_ROCE_DRV_DESC " " OCRDMA_ROCE_DRV_VERSION);

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include "ocrdma.h"
5252
#include "ocrdma_hw.h"
5353
#include "ocrdma_verbs.h"
54-
#include "ocrdma_abi.h"
54+
#include <rdma/ocrdma-abi.h>
5555

5656
int ocrdma_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
5757
{

include/uapi/rdma/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ header-y += cxgb3-abi.h
1111
header-y += cxgb4-abi.h
1212
header-y += mlx4-abi.h
1313
header-y += mlx5-abi.h
14+
header-y += ocrdma-abi.h

drivers/infiniband/hw/ocrdma/ocrdma_abi.h renamed to include/uapi/rdma/ocrdma-abi.h

Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -40,110 +40,112 @@
4040
* Costa Mesa, CA 92626
4141
*/
4242

43-
#ifndef __OCRDMA_ABI_H__
44-
#define __OCRDMA_ABI_H__
43+
#ifndef OCRDMA_ABI_USER_H
44+
#define OCRDMA_ABI_USER_H
45+
46+
#include <linux/types.h>
4547

4648
#define OCRDMA_ABI_VERSION 2
4749
#define OCRDMA_BE_ROCE_ABI_VERSION 1
4850
/* user kernel communication data structures. */
4951

5052
struct ocrdma_alloc_ucontext_resp {
51-
u32 dev_id;
52-
u32 wqe_size;
53-
u32 max_inline_data;
54-
u32 dpp_wqe_size;
55-
u64 ah_tbl_page;
56-
u32 ah_tbl_len;
57-
u32 rqe_size;
58-
u8 fw_ver[32];
53+
__u32 dev_id;
54+
__u32 wqe_size;
55+
__u32 max_inline_data;
56+
__u32 dpp_wqe_size;
57+
__u64 ah_tbl_page;
58+
__u32 ah_tbl_len;
59+
__u32 rqe_size;
60+
__u8 fw_ver[32];
5961
/* for future use/new features in progress */
60-
u64 rsvd1;
61-
u64 rsvd2;
62+
__u64 rsvd1;
63+
__u64 rsvd2;
6264
};
6365

6466
struct ocrdma_alloc_pd_ureq {
65-
u64 rsvd1;
67+
__u64 rsvd1;
6668
};
6769

6870
struct ocrdma_alloc_pd_uresp {
69-
u32 id;
70-
u32 dpp_enabled;
71-
u32 dpp_page_addr_hi;
72-
u32 dpp_page_addr_lo;
73-
u64 rsvd1;
71+
__u32 id;
72+
__u32 dpp_enabled;
73+
__u32 dpp_page_addr_hi;
74+
__u32 dpp_page_addr_lo;
75+
__u64 rsvd1;
7476
};
7577

7678
struct ocrdma_create_cq_ureq {
77-
u32 dpp_cq;
78-
u32 rsvd; /* pad */
79+
__u32 dpp_cq;
80+
__u32 rsvd; /* pad */
7981
};
8082

8183
#define MAX_CQ_PAGES 8
8284
struct ocrdma_create_cq_uresp {
83-
u32 cq_id;
84-
u32 page_size;
85-
u32 num_pages;
86-
u32 max_hw_cqe;
87-
u64 page_addr[MAX_CQ_PAGES];
88-
u64 db_page_addr;
89-
u32 db_page_size;
90-
u32 phase_change;
85+
__u32 cq_id;
86+
__u32 page_size;
87+
__u32 num_pages;
88+
__u32 max_hw_cqe;
89+
__u64 page_addr[MAX_CQ_PAGES];
90+
__u64 db_page_addr;
91+
__u32 db_page_size;
92+
__u32 phase_change;
9193
/* for future use/new features in progress */
92-
u64 rsvd1;
93-
u64 rsvd2;
94+
__u64 rsvd1;
95+
__u64 rsvd2;
9496
};
9597

9698
#define MAX_QP_PAGES 8
9799
#define MAX_UD_AV_PAGES 8
98100

99101
struct ocrdma_create_qp_ureq {
100-
u8 enable_dpp_cq;
101-
u8 rsvd;
102-
u16 dpp_cq_id;
103-
u32 rsvd1; /* pad */
102+
__u8 enable_dpp_cq;
103+
__u8 rsvd;
104+
__u16 dpp_cq_id;
105+
__u32 rsvd1; /* pad */
104106
};
105107

106108
struct ocrdma_create_qp_uresp {
107-
u16 qp_id;
108-
u16 sq_dbid;
109-
u16 rq_dbid;
110-
u16 resv0; /* pad */
111-
u32 sq_page_size;
112-
u32 rq_page_size;
113-
u32 num_sq_pages;
114-
u32 num_rq_pages;
115-
u64 sq_page_addr[MAX_QP_PAGES];
116-
u64 rq_page_addr[MAX_QP_PAGES];
117-
u64 db_page_addr;
118-
u32 db_page_size;
119-
u32 dpp_credit;
120-
u32 dpp_offset;
121-
u32 num_wqe_allocated;
122-
u32 num_rqe_allocated;
123-
u32 db_sq_offset;
124-
u32 db_rq_offset;
125-
u32 db_shift;
126-
u64 rsvd[11];
109+
__u16 qp_id;
110+
__u16 sq_dbid;
111+
__u16 rq_dbid;
112+
__u16 resv0; /* pad */
113+
__u32 sq_page_size;
114+
__u32 rq_page_size;
115+
__u32 num_sq_pages;
116+
__u32 num_rq_pages;
117+
__u64 sq_page_addr[MAX_QP_PAGES];
118+
__u64 rq_page_addr[MAX_QP_PAGES];
119+
__u64 db_page_addr;
120+
__u32 db_page_size;
121+
__u32 dpp_credit;
122+
__u32 dpp_offset;
123+
__u32 num_wqe_allocated;
124+
__u32 num_rqe_allocated;
125+
__u32 db_sq_offset;
126+
__u32 db_rq_offset;
127+
__u32 db_shift;
128+
__u64 rsvd[11];
127129
} __packed;
128130

129131
struct ocrdma_create_srq_uresp {
130-
u16 rq_dbid;
131-
u16 resv0; /* pad */
132-
u32 resv1;
132+
__u16 rq_dbid;
133+
__u16 resv0; /* pad */
134+
__u32 resv1;
133135

134-
u32 rq_page_size;
135-
u32 num_rq_pages;
136+
__u32 rq_page_size;
137+
__u32 num_rq_pages;
136138

137-
u64 rq_page_addr[MAX_QP_PAGES];
138-
u64 db_page_addr;
139+
__u64 rq_page_addr[MAX_QP_PAGES];
140+
__u64 db_page_addr;
139141

140-
u32 db_page_size;
141-
u32 num_rqe_allocated;
142-
u32 db_rq_offset;
143-
u32 db_shift;
142+
__u32 db_page_size;
143+
__u32 num_rqe_allocated;
144+
__u32 db_rq_offset;
145+
__u32 db_shift;
144146

145-
u64 rsvd2;
146-
u64 rsvd3;
147+
__u64 rsvd2;
148+
__u64 rsvd3;
147149
};
148150

149-
#endif /* __OCRDMA_ABI_H__ */
151+
#endif /* OCRDMA_ABI_USER_H */

0 commit comments

Comments
 (0)