xref: /freebsd/sys/dev/irdma/irdma_main.h (revision 35105900c65bb5adcde05d37ae34ad006970d4f9)
1cdcd52d4SBartosz Sobczak /*-
2cdcd52d4SBartosz Sobczak  * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB
3cdcd52d4SBartosz Sobczak  *
4cdcd52d4SBartosz Sobczak  * Copyright (c) 2015 - 2022 Intel Corporation
5cdcd52d4SBartosz Sobczak  *
6cdcd52d4SBartosz Sobczak  * This software is available to you under a choice of one of two
7cdcd52d4SBartosz Sobczak  * licenses.  You may choose to be licensed under the terms of the GNU
8cdcd52d4SBartosz Sobczak  * General Public License (GPL) Version 2, available from the file
9cdcd52d4SBartosz Sobczak  * COPYING in the main directory of this source tree, or the
10cdcd52d4SBartosz Sobczak  * OpenFabrics.org BSD license below:
11cdcd52d4SBartosz Sobczak  *
12cdcd52d4SBartosz Sobczak  *   Redistribution and use in source and binary forms, with or
13cdcd52d4SBartosz Sobczak  *   without modification, are permitted provided that the following
14cdcd52d4SBartosz Sobczak  *   conditions are met:
15cdcd52d4SBartosz Sobczak  *
16cdcd52d4SBartosz Sobczak  *    - Redistributions of source code must retain the above
17cdcd52d4SBartosz Sobczak  *	copyright notice, this list of conditions and the following
18cdcd52d4SBartosz Sobczak  *	disclaimer.
19cdcd52d4SBartosz Sobczak  *
20cdcd52d4SBartosz Sobczak  *    - Redistributions in binary form must reproduce the above
21cdcd52d4SBartosz Sobczak  *	copyright notice, this list of conditions and the following
22cdcd52d4SBartosz Sobczak  *	disclaimer in the documentation and/or other materials
23cdcd52d4SBartosz Sobczak  *	provided with the distribution.
24cdcd52d4SBartosz Sobczak  *
25cdcd52d4SBartosz Sobczak  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26cdcd52d4SBartosz Sobczak  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27cdcd52d4SBartosz Sobczak  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28cdcd52d4SBartosz Sobczak  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29cdcd52d4SBartosz Sobczak  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30cdcd52d4SBartosz Sobczak  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31cdcd52d4SBartosz Sobczak  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32cdcd52d4SBartosz Sobczak  * SOFTWARE.
33cdcd52d4SBartosz Sobczak  */
34cdcd52d4SBartosz Sobczak /*$FreeBSD$*/
35cdcd52d4SBartosz Sobczak 
36cdcd52d4SBartosz Sobczak #ifndef IRDMA_MAIN_H
37cdcd52d4SBartosz Sobczak #define IRDMA_MAIN_H
38cdcd52d4SBartosz Sobczak 
39cdcd52d4SBartosz Sobczak #include <linux/in.h>
40cdcd52d4SBartosz Sobczak #include <netinet/ip6.h>
41cdcd52d4SBartosz Sobczak #include <netinet/udp.h>
42cdcd52d4SBartosz Sobczak #include <netinet/tcp.h>
43cdcd52d4SBartosz Sobczak #include <sys/socket.h>
44cdcd52d4SBartosz Sobczak #include <netinet/if_ether.h>
45cdcd52d4SBartosz Sobczak #include <linux/slab.h>
46cdcd52d4SBartosz Sobczak #include <linux/rculist.h>
47a527c18cSBartosz Sobczak #if __FreeBSD_version >= 1400000
48777e472cSBartosz Sobczak #include <rdma/uverbs_ioctl.h>
49a527c18cSBartosz Sobczak #endif
50cdcd52d4SBartosz Sobczak #include <rdma/ib_smi.h>
51cdcd52d4SBartosz Sobczak #include <rdma/ib_verbs.h>
52cdcd52d4SBartosz Sobczak #include <rdma/ib_pack.h>
53cdcd52d4SBartosz Sobczak #include <rdma/rdma_cm.h>
54cdcd52d4SBartosz Sobczak #include <rdma/iw_cm.h>
55cdcd52d4SBartosz Sobczak #include <rdma/ib_user_verbs.h>
56cdcd52d4SBartosz Sobczak #include <rdma/ib_umem.h>
57cdcd52d4SBartosz Sobczak #include <rdma/ib_cache.h>
58cdcd52d4SBartosz Sobczak #include "osdep.h"
59cdcd52d4SBartosz Sobczak #include "irdma_defs.h"
60cdcd52d4SBartosz Sobczak #include "irdma_hmc.h"
61cdcd52d4SBartosz Sobczak #include "irdma_type.h"
62cdcd52d4SBartosz Sobczak #include "irdma_ws.h"
63cdcd52d4SBartosz Sobczak #include "irdma_protos.h"
64cdcd52d4SBartosz Sobczak #include "irdma_pble.h"
65cdcd52d4SBartosz Sobczak #include "irdma_cm.h"
66cdcd52d4SBartosz Sobczak #include "fbsd_kcompat.h"
67cdcd52d4SBartosz Sobczak #include "irdma-abi.h"
68cdcd52d4SBartosz Sobczak #include "irdma_verbs.h"
69cdcd52d4SBartosz Sobczak #include "irdma_user.h"
70cdcd52d4SBartosz Sobczak #include "irdma_puda.h"
71cdcd52d4SBartosz Sobczak 
72cdcd52d4SBartosz Sobczak extern struct list_head irdma_handlers;
73cdcd52d4SBartosz Sobczak extern spinlock_t irdma_handler_lock;
74cdcd52d4SBartosz Sobczak extern bool irdma_upload_context;
75cdcd52d4SBartosz Sobczak 
76cdcd52d4SBartosz Sobczak #define IRDMA_FW_VER_DEFAULT	2
77cdcd52d4SBartosz Sobczak #define IRDMA_HW_VER	        2
78cdcd52d4SBartosz Sobczak 
79cdcd52d4SBartosz Sobczak #define IRDMA_ARP_ADD		1
80cdcd52d4SBartosz Sobczak #define IRDMA_ARP_DELETE	2
81cdcd52d4SBartosz Sobczak #define IRDMA_ARP_RESOLVE	3
82cdcd52d4SBartosz Sobczak 
83cdcd52d4SBartosz Sobczak #define IRDMA_MACIP_ADD		1
84cdcd52d4SBartosz Sobczak #define IRDMA_MACIP_DELETE	2
85cdcd52d4SBartosz Sobczak 
86cdcd52d4SBartosz Sobczak #define IW_CCQ_SIZE	(IRDMA_CQP_SW_SQSIZE_2048 + 1)
87cdcd52d4SBartosz Sobczak #define IW_CEQ_SIZE	2048
88cdcd52d4SBartosz Sobczak #define IW_AEQ_SIZE	2048
89cdcd52d4SBartosz Sobczak 
90cdcd52d4SBartosz Sobczak #define RX_BUF_SIZE	(1536 + 8)
91cdcd52d4SBartosz Sobczak #define IW_REG0_SIZE	(4 * 1024)
92cdcd52d4SBartosz Sobczak #define IW_TX_TIMEOUT	(6 * HZ)
93cdcd52d4SBartosz Sobczak #define IW_FIRST_QPN	1
94cdcd52d4SBartosz Sobczak 
95cdcd52d4SBartosz Sobczak #define IW_SW_CONTEXT_ALIGN	1024
96cdcd52d4SBartosz Sobczak 
97cdcd52d4SBartosz Sobczak #define MAX_DPC_ITERATIONS	128
98cdcd52d4SBartosz Sobczak 
99cdcd52d4SBartosz Sobczak #define IRDMA_EVENT_TIMEOUT_MS		5000
100cdcd52d4SBartosz Sobczak #define IRDMA_VCHNL_EVENT_TIMEOUT_MS	10000
101cdcd52d4SBartosz Sobczak #define IRDMA_RST_TIMEOUT_HZ		4
102cdcd52d4SBartosz Sobczak 
103cdcd52d4SBartosz Sobczak #define	IRDMA_NO_QSET	0xffff
104cdcd52d4SBartosz Sobczak 
105cdcd52d4SBartosz Sobczak #define IW_CFG_FPM_QP_COUNT		32768
106777e472cSBartosz Sobczak #define IRDMA_MAX_PAGES_PER_FMR		262144
107cdcd52d4SBartosz Sobczak #define IRDMA_MIN_PAGES_PER_FMR		1
108cdcd52d4SBartosz Sobczak #define IRDMA_CQP_COMPL_RQ_WQE_FLUSHED	2
109cdcd52d4SBartosz Sobczak #define IRDMA_CQP_COMPL_SQ_WQE_FLUSHED	3
110cdcd52d4SBartosz Sobczak 
111cdcd52d4SBartosz Sobczak #define IRDMA_Q_TYPE_PE_AEQ	0x80
112cdcd52d4SBartosz Sobczak #define IRDMA_Q_INVALID_IDX	0xffff
113cdcd52d4SBartosz Sobczak #define IRDMA_REM_ENDPOINT_TRK_QPID	3
114cdcd52d4SBartosz Sobczak 
115cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_ENA_MPA_VER_0		0x00000001
116cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_MPA_CRC		0x00000002
117cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_FIRST_WRITE	0x00000004
118cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_INTF		0x00000008
119cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_ENA_MSI			0x00000010
120cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DUAL_LOGICAL_PORT		0x00000020
121cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_NO_INLINE_DATA		0x00000080
122cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_INT_MOD		0x00000100
123cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_VIRT_WQ		0x00000200
124cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_ENA_PAU			0x00000400
125cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_MCAST_LOGPORT_MAP		0x00000800
126cdcd52d4SBartosz Sobczak 
127cdcd52d4SBartosz Sobczak #define IW_HMC_OBJ_TYPE_NUM	ARRAY_SIZE(iw_hmc_obj_types)
128cdcd52d4SBartosz Sobczak #define IRDMA_ROCE_CWND_DEFAULT			0x400
129cdcd52d4SBartosz Sobczak #define IRDMA_ROCE_ACKCREDS_DEFAULT		0x1E
130cdcd52d4SBartosz Sobczak 
131cdcd52d4SBartosz Sobczak #define IRDMA_FLUSH_SQ		BIT(0)
132cdcd52d4SBartosz Sobczak #define IRDMA_FLUSH_RQ		BIT(1)
133cdcd52d4SBartosz Sobczak #define IRDMA_REFLUSH		BIT(2)
134cdcd52d4SBartosz Sobczak #define IRDMA_FLUSH_WAIT	BIT(3)
135cdcd52d4SBartosz Sobczak 
136*35105900SBartosz Sobczak #define IRDMA_IRQ_NAME_STR_LEN 64
137*35105900SBartosz Sobczak 
138cdcd52d4SBartosz Sobczak enum init_completion_state {
139cdcd52d4SBartosz Sobczak 	INVALID_STATE = 0,
140cdcd52d4SBartosz Sobczak 	INITIAL_STATE,
141cdcd52d4SBartosz Sobczak 	CQP_CREATED,
142cdcd52d4SBartosz Sobczak 	HMC_OBJS_CREATED,
143cdcd52d4SBartosz Sobczak 	HW_RSRC_INITIALIZED,
144cdcd52d4SBartosz Sobczak 	CCQ_CREATED,
145cdcd52d4SBartosz Sobczak 	CEQ0_CREATED, /* Last state of probe */
146cdcd52d4SBartosz Sobczak 	ILQ_CREATED,
147cdcd52d4SBartosz Sobczak 	IEQ_CREATED,
148cdcd52d4SBartosz Sobczak 	REM_ENDPOINT_TRK_CREATED,
149cdcd52d4SBartosz Sobczak 	CEQS_CREATED,
150cdcd52d4SBartosz Sobczak 	PBLE_CHUNK_MEM,
151cdcd52d4SBartosz Sobczak 	AEQ_CREATED,
152cdcd52d4SBartosz Sobczak 	IP_ADDR_REGISTERED,  /* Last state of open */
153cdcd52d4SBartosz Sobczak };
154cdcd52d4SBartosz Sobczak 
155cdcd52d4SBartosz Sobczak struct irdma_rsrc_limits {
156cdcd52d4SBartosz Sobczak 	u32 qplimit;
157cdcd52d4SBartosz Sobczak 	u32 mrlimit;
158cdcd52d4SBartosz Sobczak 	u32 cqlimit;
159cdcd52d4SBartosz Sobczak };
160cdcd52d4SBartosz Sobczak 
161cdcd52d4SBartosz Sobczak struct irdma_cqp_err_info {
162cdcd52d4SBartosz Sobczak 	u16 maj;
163cdcd52d4SBartosz Sobczak 	u16 min;
164cdcd52d4SBartosz Sobczak 	const char *desc;
165cdcd52d4SBartosz Sobczak };
166cdcd52d4SBartosz Sobczak 
167cdcd52d4SBartosz Sobczak struct irdma_cqp_compl_info {
168cdcd52d4SBartosz Sobczak 	u32 op_ret_val;
169cdcd52d4SBartosz Sobczak 	u16 maj_err_code;
170cdcd52d4SBartosz Sobczak 	u16 min_err_code;
171cdcd52d4SBartosz Sobczak 	bool error;
172cdcd52d4SBartosz Sobczak 	u8 op_code;
173cdcd52d4SBartosz Sobczak };
174cdcd52d4SBartosz Sobczak 
175cdcd52d4SBartosz Sobczak struct irdma_cqp_request {
176cdcd52d4SBartosz Sobczak 	struct cqp_cmds_info info;
177cdcd52d4SBartosz Sobczak 	wait_queue_head_t waitq;
178cdcd52d4SBartosz Sobczak 	struct list_head list;
179cdcd52d4SBartosz Sobczak 	atomic_t refcnt;
180cdcd52d4SBartosz Sobczak 	void (*callback_fcn)(struct irdma_cqp_request *cqp_request);
181cdcd52d4SBartosz Sobczak 	void *param;
182cdcd52d4SBartosz Sobczak 	struct irdma_cqp_compl_info compl_info;
183cdcd52d4SBartosz Sobczak 	bool waiting:1;
184cdcd52d4SBartosz Sobczak 	bool request_done:1;
185cdcd52d4SBartosz Sobczak 	bool dynamic:1;
186cdcd52d4SBartosz Sobczak };
187cdcd52d4SBartosz Sobczak 
188cdcd52d4SBartosz Sobczak struct irdma_cqp {
189cdcd52d4SBartosz Sobczak 	struct irdma_sc_cqp sc_cqp;
190cdcd52d4SBartosz Sobczak 	spinlock_t req_lock; /* protect CQP request list */
191cdcd52d4SBartosz Sobczak 	spinlock_t compl_lock; /* protect CQP completion processing */
192cdcd52d4SBartosz Sobczak 	wait_queue_head_t waitq;
193cdcd52d4SBartosz Sobczak 	wait_queue_head_t remove_wq;
194cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem sq;
195cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem host_ctx;
196cdcd52d4SBartosz Sobczak 	u64 *scratch_array;
197cdcd52d4SBartosz Sobczak 	struct irdma_cqp_request *cqp_requests;
198cdcd52d4SBartosz Sobczak 	struct list_head cqp_avail_reqs;
199cdcd52d4SBartosz Sobczak 	struct list_head cqp_pending_reqs;
200cdcd52d4SBartosz Sobczak };
201cdcd52d4SBartosz Sobczak 
202cdcd52d4SBartosz Sobczak struct irdma_ccq {
203cdcd52d4SBartosz Sobczak 	struct irdma_sc_cq sc_cq;
204cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem mem_cq;
205cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem shadow_area;
206cdcd52d4SBartosz Sobczak };
207cdcd52d4SBartosz Sobczak 
208cdcd52d4SBartosz Sobczak struct irdma_ceq {
209cdcd52d4SBartosz Sobczak 	struct irdma_sc_ceq sc_ceq;
210cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem mem;
211cdcd52d4SBartosz Sobczak 	u32 irq;
212cdcd52d4SBartosz Sobczak 	u32 msix_idx;
213cdcd52d4SBartosz Sobczak 	struct irdma_pci_f *rf;
214cdcd52d4SBartosz Sobczak 	struct tasklet_struct dpc_tasklet;
215cdcd52d4SBartosz Sobczak 	spinlock_t ce_lock; /* sync cq destroy with cq completion event notification */
216cdcd52d4SBartosz Sobczak };
217cdcd52d4SBartosz Sobczak 
218cdcd52d4SBartosz Sobczak struct irdma_aeq {
219cdcd52d4SBartosz Sobczak 	struct irdma_sc_aeq sc_aeq;
220cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem mem;
221cdcd52d4SBartosz Sobczak 	struct irdma_pble_alloc palloc;
222cdcd52d4SBartosz Sobczak 	bool virtual_map;
223cdcd52d4SBartosz Sobczak };
224cdcd52d4SBartosz Sobczak 
225cdcd52d4SBartosz Sobczak struct irdma_arp_entry {
226cdcd52d4SBartosz Sobczak 	u32 ip_addr[4];
227cdcd52d4SBartosz Sobczak 	u8 mac_addr[ETH_ALEN];
228cdcd52d4SBartosz Sobczak };
229cdcd52d4SBartosz Sobczak 
230cdcd52d4SBartosz Sobczak struct irdma_msix_vector {
231cdcd52d4SBartosz Sobczak 	u32 idx;
232cdcd52d4SBartosz Sobczak 	u32 irq;
233cdcd52d4SBartosz Sobczak 	u32 cpu_affinity;
234cdcd52d4SBartosz Sobczak 	u32 ceq_id;
235*35105900SBartosz Sobczak 	char name[IRDMA_IRQ_NAME_STR_LEN];
236cdcd52d4SBartosz Sobczak 	struct resource *res;
237cdcd52d4SBartosz Sobczak 	void  *tag;
238cdcd52d4SBartosz Sobczak };
239cdcd52d4SBartosz Sobczak 
240cdcd52d4SBartosz Sobczak struct irdma_mc_table_info {
241cdcd52d4SBartosz Sobczak 	u32 mgn;
242cdcd52d4SBartosz Sobczak 	u32 dest_ip[4];
243cdcd52d4SBartosz Sobczak 	bool lan_fwd:1;
244cdcd52d4SBartosz Sobczak 	bool ipv4_valid:1;
245cdcd52d4SBartosz Sobczak };
246cdcd52d4SBartosz Sobczak 
247cdcd52d4SBartosz Sobczak struct mc_table_list {
248cdcd52d4SBartosz Sobczak 	struct list_head list;
249cdcd52d4SBartosz Sobczak 	struct irdma_mc_table_info mc_info;
250cdcd52d4SBartosz Sobczak 	struct irdma_mcast_grp_info mc_grp_ctx;
251cdcd52d4SBartosz Sobczak };
252cdcd52d4SBartosz Sobczak 
253cdcd52d4SBartosz Sobczak struct irdma_qv_info {
254cdcd52d4SBartosz Sobczak 	u32 v_idx; /* msix_vector */
255cdcd52d4SBartosz Sobczak 	u16 ceq_idx;
256cdcd52d4SBartosz Sobczak 	u16 aeq_idx;
257cdcd52d4SBartosz Sobczak 	u8 itr_idx;
258cdcd52d4SBartosz Sobczak };
259cdcd52d4SBartosz Sobczak 
260cdcd52d4SBartosz Sobczak struct irdma_qvlist_info {
261cdcd52d4SBartosz Sobczak 	u32 num_vectors;
262cdcd52d4SBartosz Sobczak 	struct irdma_qv_info qv_info[1];
263cdcd52d4SBartosz Sobczak };
264cdcd52d4SBartosz Sobczak 
265cdcd52d4SBartosz Sobczak struct irdma_gen_ops {
266cdcd52d4SBartosz Sobczak 	void (*request_reset)(struct irdma_pci_f *rf);
267cdcd52d4SBartosz Sobczak 	int (*register_qset)(struct irdma_sc_vsi *vsi,
268cdcd52d4SBartosz Sobczak 			     struct irdma_ws_node *tc_node);
269cdcd52d4SBartosz Sobczak 	void (*unregister_qset)(struct irdma_sc_vsi *vsi,
270cdcd52d4SBartosz Sobczak 				struct irdma_ws_node *tc_node);
271cdcd52d4SBartosz Sobczak };
272cdcd52d4SBartosz Sobczak 
273cdcd52d4SBartosz Sobczak struct irdma_pci_f {
274cdcd52d4SBartosz Sobczak 	bool reset:1;
275cdcd52d4SBartosz Sobczak 	bool rsrc_created:1;
276cdcd52d4SBartosz Sobczak 	bool msix_shared:1;
277cdcd52d4SBartosz Sobczak 	bool ftype:1;
278cdcd52d4SBartosz Sobczak 	u8 rsrc_profile;
279cdcd52d4SBartosz Sobczak 	u8 *hmc_info_mem;
280cdcd52d4SBartosz Sobczak 	u8 *mem_rsrc;
281cdcd52d4SBartosz Sobczak 	u8 rdma_ver;
282cdcd52d4SBartosz Sobczak 	u8 rst_to;
283777e472cSBartosz Sobczak 	/* Not used in SRIOV VF mode */
284777e472cSBartosz Sobczak 	u8 pf_id;
285cdcd52d4SBartosz Sobczak 	enum irdma_protocol_used protocol_used;
286cdcd52d4SBartosz Sobczak 	bool en_rem_endpoint_trk:1;
287cdcd52d4SBartosz Sobczak 	bool dcqcn_ena:1;
288cdcd52d4SBartosz Sobczak 	u32 sd_type;
289cdcd52d4SBartosz Sobczak 	u32 msix_count;
290cdcd52d4SBartosz Sobczak 	u32 max_mr;
291cdcd52d4SBartosz Sobczak 	u32 max_qp;
292cdcd52d4SBartosz Sobczak 	u32 max_cq;
293cdcd52d4SBartosz Sobczak 	u32 max_ah;
294cdcd52d4SBartosz Sobczak 	u32 next_ah;
295cdcd52d4SBartosz Sobczak 	u32 max_mcg;
296cdcd52d4SBartosz Sobczak 	u32 next_mcg;
297cdcd52d4SBartosz Sobczak 	u32 max_pd;
298cdcd52d4SBartosz Sobczak 	u32 next_qp;
299cdcd52d4SBartosz Sobczak 	u32 next_cq;
300cdcd52d4SBartosz Sobczak 	u32 next_pd;
301cdcd52d4SBartosz Sobczak 	u32 max_mr_size;
302cdcd52d4SBartosz Sobczak 	u32 max_cqe;
303cdcd52d4SBartosz Sobczak 	u32 mr_stagmask;
304cdcd52d4SBartosz Sobczak 	u32 used_pds;
305cdcd52d4SBartosz Sobczak 	u32 used_cqs;
306cdcd52d4SBartosz Sobczak 	u32 used_mrs;
307cdcd52d4SBartosz Sobczak 	u32 used_qps;
308cdcd52d4SBartosz Sobczak 	u32 arp_table_size;
309cdcd52d4SBartosz Sobczak 	u32 next_arp_index;
310cdcd52d4SBartosz Sobczak 	u32 ceqs_count;
311cdcd52d4SBartosz Sobczak 	u32 next_ws_node_id;
312cdcd52d4SBartosz Sobczak 	u32 max_ws_node_id;
313cdcd52d4SBartosz Sobczak 	u32 limits_sel;
314cdcd52d4SBartosz Sobczak 	unsigned long *allocated_ws_nodes;
315cdcd52d4SBartosz Sobczak 	unsigned long *allocated_qps;
316cdcd52d4SBartosz Sobczak 	unsigned long *allocated_cqs;
317cdcd52d4SBartosz Sobczak 	unsigned long *allocated_mrs;
318cdcd52d4SBartosz Sobczak 	unsigned long *allocated_pds;
319cdcd52d4SBartosz Sobczak 	unsigned long *allocated_mcgs;
320cdcd52d4SBartosz Sobczak 	unsigned long *allocated_ahs;
321cdcd52d4SBartosz Sobczak 	unsigned long *allocated_arps;
322cdcd52d4SBartosz Sobczak 	enum init_completion_state init_state;
323cdcd52d4SBartosz Sobczak 	struct irdma_sc_dev sc_dev;
324cdcd52d4SBartosz Sobczak 	struct irdma_dev_ctx dev_ctx;
325cdcd52d4SBartosz Sobczak 	struct irdma_tunable_info tun_info;
326cdcd52d4SBartosz Sobczak 	eventhandler_tag irdma_ifaddr_event;
327cdcd52d4SBartosz Sobczak 	struct irdma_handler *hdl;
328cdcd52d4SBartosz Sobczak 	struct pci_dev *pcidev;
329cdcd52d4SBartosz Sobczak 	struct ice_rdma_peer *peer_info;
330cdcd52d4SBartosz Sobczak 	struct irdma_hw hw;
331cdcd52d4SBartosz Sobczak 	struct irdma_cqp cqp;
332cdcd52d4SBartosz Sobczak 	struct irdma_ccq ccq;
333cdcd52d4SBartosz Sobczak 	struct irdma_aeq aeq;
334cdcd52d4SBartosz Sobczak 	struct irdma_ceq *ceqlist;
335cdcd52d4SBartosz Sobczak 	struct irdma_hmc_pble_rsrc *pble_rsrc;
336cdcd52d4SBartosz Sobczak 	struct irdma_arp_entry *arp_table;
337cdcd52d4SBartosz Sobczak 	spinlock_t arp_lock; /*protect ARP table access*/
338cdcd52d4SBartosz Sobczak 	spinlock_t rsrc_lock; /* protect HW resource array access */
339cdcd52d4SBartosz Sobczak 	spinlock_t qptable_lock; /*protect QP table access*/
340cdcd52d4SBartosz Sobczak 	spinlock_t cqtable_lock; /*protect CQ table access*/
341cdcd52d4SBartosz Sobczak 	struct irdma_qp **qp_table;
342cdcd52d4SBartosz Sobczak 	struct irdma_cq **cq_table;
343cdcd52d4SBartosz Sobczak 	spinlock_t qh_list_lock; /* protect mc_qht_list */
344cdcd52d4SBartosz Sobczak 	struct mc_table_list mc_qht_list;
345cdcd52d4SBartosz Sobczak 	struct irdma_msix_vector *iw_msixtbl;
346cdcd52d4SBartosz Sobczak 	struct irdma_qvlist_info *iw_qvlist;
347cdcd52d4SBartosz Sobczak 	struct tasklet_struct dpc_tasklet;
348cdcd52d4SBartosz Sobczak 	struct msix_entry msix_info;
349cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem obj_mem;
350cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem obj_next;
351cdcd52d4SBartosz Sobczak 	atomic_t vchnl_msgs;
352cdcd52d4SBartosz Sobczak 	wait_queue_head_t vchnl_waitq;
353cdcd52d4SBartosz Sobczak 	struct workqueue_struct *cqp_cmpl_wq;
354cdcd52d4SBartosz Sobczak 	struct work_struct cqp_cmpl_work;
355cdcd52d4SBartosz Sobczak 	struct irdma_sc_vsi default_vsi;
356cdcd52d4SBartosz Sobczak 	void *back_fcn;
357cdcd52d4SBartosz Sobczak 	struct irdma_gen_ops gen_ops;
358cdcd52d4SBartosz Sobczak 	void (*check_fc)(struct irdma_sc_vsi *vsi, struct irdma_sc_qp *sc_qp);
359cdcd52d4SBartosz Sobczak 	struct irdma_dcqcn_cc_params dcqcn_params;
360cdcd52d4SBartosz Sobczak 	struct irdma_device *iwdev;
361cdcd52d4SBartosz Sobczak };
362cdcd52d4SBartosz Sobczak 
363cdcd52d4SBartosz Sobczak struct irdma_device {
364cdcd52d4SBartosz Sobczak 	struct ib_device ibdev;
365cdcd52d4SBartosz Sobczak 	struct irdma_pci_f *rf;
366cdcd52d4SBartosz Sobczak 	struct ifnet *netdev;
367777e472cSBartosz Sobczak 	struct notifier_block nb_netdevice_event;
368cdcd52d4SBartosz Sobczak 	struct irdma_handler *hdl;
369cdcd52d4SBartosz Sobczak 	struct workqueue_struct *cleanup_wq;
370cdcd52d4SBartosz Sobczak 	struct irdma_sc_vsi vsi;
371cdcd52d4SBartosz Sobczak 	struct irdma_cm_core cm_core;
372cdcd52d4SBartosz Sobczak 	u32 roce_cwnd;
373cdcd52d4SBartosz Sobczak 	u32 roce_ackcreds;
374cdcd52d4SBartosz Sobczak 	u32 vendor_id;
375cdcd52d4SBartosz Sobczak 	u32 vendor_part_id;
376cdcd52d4SBartosz Sobczak 	u32 push_mode;
377cdcd52d4SBartosz Sobczak 	u32 rcv_wnd;
378cdcd52d4SBartosz Sobczak 	u16 mac_ip_table_idx;
379cdcd52d4SBartosz Sobczak 	u16 vsi_num;
380cdcd52d4SBartosz Sobczak 	u8 rcv_wscale;
381cdcd52d4SBartosz Sobczak 	u8 iw_status;
382*35105900SBartosz Sobczak 	u8 roce_rtomin;
383cdcd52d4SBartosz Sobczak 	u8 rd_fence_rate;
384777e472cSBartosz Sobczak 	bool override_rcv_wnd:1;
385777e472cSBartosz Sobczak 	bool override_cwnd:1;
386777e472cSBartosz Sobczak 	bool override_ackcreds:1;
387777e472cSBartosz Sobczak 	bool override_ooo:1;
388777e472cSBartosz Sobczak 	bool override_rd_fence_rate:1;
389777e472cSBartosz Sobczak 	bool override_rtomin:1;
390cdcd52d4SBartosz Sobczak 	bool roce_mode:1;
391cdcd52d4SBartosz Sobczak 	bool roce_dcqcn_en:1;
392cdcd52d4SBartosz Sobczak 	bool dcb_vlan_mode:1;
393cdcd52d4SBartosz Sobczak 	bool iw_ooo:1;
394cdcd52d4SBartosz Sobczak 	enum init_completion_state init_state;
395cdcd52d4SBartosz Sobczak 
396cdcd52d4SBartosz Sobczak 	wait_queue_head_t suspend_wq;
397cdcd52d4SBartosz Sobczak };
398cdcd52d4SBartosz Sobczak 
399cdcd52d4SBartosz Sobczak struct irdma_handler {
400cdcd52d4SBartosz Sobczak 	struct list_head list;
401cdcd52d4SBartosz Sobczak 	struct irdma_device *iwdev;
402cdcd52d4SBartosz Sobczak 	struct task deferred_task;
403cdcd52d4SBartosz Sobczak 	struct taskqueue *deferred_tq;
404cdcd52d4SBartosz Sobczak 	bool shared_res_created;
405cdcd52d4SBartosz Sobczak };
406cdcd52d4SBartosz Sobczak 
407cdcd52d4SBartosz Sobczak static inline struct irdma_device *to_iwdev(struct ib_device *ibdev)
408cdcd52d4SBartosz Sobczak {
409cdcd52d4SBartosz Sobczak 	return container_of(ibdev, struct irdma_device, ibdev);
410cdcd52d4SBartosz Sobczak }
411cdcd52d4SBartosz Sobczak 
412cdcd52d4SBartosz Sobczak static inline struct irdma_ucontext *to_ucontext(struct ib_ucontext *ibucontext)
413cdcd52d4SBartosz Sobczak {
414cdcd52d4SBartosz Sobczak 	return container_of(ibucontext, struct irdma_ucontext, ibucontext);
415cdcd52d4SBartosz Sobczak }
416cdcd52d4SBartosz Sobczak 
417a527c18cSBartosz Sobczak #if __FreeBSD_version >= 1400026
418cdcd52d4SBartosz Sobczak static inline struct irdma_user_mmap_entry *
419cdcd52d4SBartosz Sobczak to_irdma_mmap_entry(struct rdma_user_mmap_entry *rdma_entry)
420cdcd52d4SBartosz Sobczak {
421cdcd52d4SBartosz Sobczak 	return container_of(rdma_entry, struct irdma_user_mmap_entry,
422cdcd52d4SBartosz Sobczak 			    rdma_entry);
423cdcd52d4SBartosz Sobczak }
424cdcd52d4SBartosz Sobczak 
425a527c18cSBartosz Sobczak #endif
426cdcd52d4SBartosz Sobczak static inline struct irdma_pd *to_iwpd(struct ib_pd *ibpd)
427cdcd52d4SBartosz Sobczak {
428cdcd52d4SBartosz Sobczak 	return container_of(ibpd, struct irdma_pd, ibpd);
429cdcd52d4SBartosz Sobczak }
430cdcd52d4SBartosz Sobczak 
431cdcd52d4SBartosz Sobczak static inline struct irdma_ah *to_iwah(struct ib_ah *ibah)
432cdcd52d4SBartosz Sobczak {
433cdcd52d4SBartosz Sobczak 	return container_of(ibah, struct irdma_ah, ibah);
434cdcd52d4SBartosz Sobczak }
435cdcd52d4SBartosz Sobczak 
436cdcd52d4SBartosz Sobczak static inline struct irdma_mr *to_iwmr(struct ib_mr *ibmr)
437cdcd52d4SBartosz Sobczak {
438cdcd52d4SBartosz Sobczak 	return container_of(ibmr, struct irdma_mr, ibmr);
439cdcd52d4SBartosz Sobczak }
440cdcd52d4SBartosz Sobczak 
441cdcd52d4SBartosz Sobczak static inline struct irdma_mr *to_iwmw(struct ib_mw *ibmw)
442cdcd52d4SBartosz Sobczak {
443cdcd52d4SBartosz Sobczak 	return container_of(ibmw, struct irdma_mr, ibmw);
444cdcd52d4SBartosz Sobczak }
445cdcd52d4SBartosz Sobczak 
446cdcd52d4SBartosz Sobczak static inline struct irdma_cq *to_iwcq(struct ib_cq *ibcq)
447cdcd52d4SBartosz Sobczak {
448cdcd52d4SBartosz Sobczak 	return container_of(ibcq, struct irdma_cq, ibcq);
449cdcd52d4SBartosz Sobczak }
450cdcd52d4SBartosz Sobczak 
451cdcd52d4SBartosz Sobczak static inline struct irdma_qp *to_iwqp(struct ib_qp *ibqp)
452cdcd52d4SBartosz Sobczak {
453cdcd52d4SBartosz Sobczak 	return container_of(ibqp, struct irdma_qp, ibqp);
454cdcd52d4SBartosz Sobczak }
455cdcd52d4SBartosz Sobczak 
456cdcd52d4SBartosz Sobczak static inline struct irdma_pci_f *dev_to_rf(struct irdma_sc_dev *dev)
457cdcd52d4SBartosz Sobczak {
458cdcd52d4SBartosz Sobczak 	return container_of(dev, struct irdma_pci_f, sc_dev);
459cdcd52d4SBartosz Sobczak }
460cdcd52d4SBartosz Sobczak 
461cdcd52d4SBartosz Sobczak /**
462cdcd52d4SBartosz Sobczak  * irdma_alloc_resource - allocate a resource
463cdcd52d4SBartosz Sobczak  * @iwdev: device pointer
464cdcd52d4SBartosz Sobczak  * @resource_array: resource bit array:
465cdcd52d4SBartosz Sobczak  * @max_resources: maximum resource number
466cdcd52d4SBartosz Sobczak  * @req_resources_num: Allocated resource number
467cdcd52d4SBartosz Sobczak  * @next: next free id
468cdcd52d4SBartosz Sobczak  **/
469cdcd52d4SBartosz Sobczak static inline int irdma_alloc_rsrc(struct irdma_pci_f *rf,
470cdcd52d4SBartosz Sobczak 				   unsigned long *rsrc_array, u32 max_rsrc,
471cdcd52d4SBartosz Sobczak 				   u32 *req_rsrc_num, u32 *next)
472cdcd52d4SBartosz Sobczak {
473cdcd52d4SBartosz Sobczak 	u32 rsrc_num;
474cdcd52d4SBartosz Sobczak 	unsigned long flags;
475cdcd52d4SBartosz Sobczak 
476cdcd52d4SBartosz Sobczak 	spin_lock_irqsave(&rf->rsrc_lock, flags);
477cdcd52d4SBartosz Sobczak 	rsrc_num = find_next_zero_bit(rsrc_array, max_rsrc, *next);
478cdcd52d4SBartosz Sobczak 	if (rsrc_num >= max_rsrc) {
479cdcd52d4SBartosz Sobczak 		rsrc_num = find_first_zero_bit(rsrc_array, max_rsrc);
480cdcd52d4SBartosz Sobczak 		if (rsrc_num >= max_rsrc) {
481cdcd52d4SBartosz Sobczak 			spin_unlock_irqrestore(&rf->rsrc_lock, flags);
482cdcd52d4SBartosz Sobczak 			irdma_debug(&rf->sc_dev, IRDMA_DEBUG_ERR,
483cdcd52d4SBartosz Sobczak 				    "resource [%d] allocation failed\n",
484cdcd52d4SBartosz Sobczak 				    rsrc_num);
485cdcd52d4SBartosz Sobczak 			return -EOVERFLOW;
486cdcd52d4SBartosz Sobczak 		}
487cdcd52d4SBartosz Sobczak 	}
488cdcd52d4SBartosz Sobczak 	__set_bit(rsrc_num, rsrc_array);
489cdcd52d4SBartosz Sobczak 	*next = rsrc_num + 1;
490cdcd52d4SBartosz Sobczak 	if (*next == max_rsrc)
491cdcd52d4SBartosz Sobczak 		*next = 0;
492cdcd52d4SBartosz Sobczak 	*req_rsrc_num = rsrc_num;
493cdcd52d4SBartosz Sobczak 	spin_unlock_irqrestore(&rf->rsrc_lock, flags);
494cdcd52d4SBartosz Sobczak 
495cdcd52d4SBartosz Sobczak 	return 0;
496cdcd52d4SBartosz Sobczak }
497cdcd52d4SBartosz Sobczak 
498cdcd52d4SBartosz Sobczak /**
499cdcd52d4SBartosz Sobczak  * irdma_free_resource - free a resource
500cdcd52d4SBartosz Sobczak  * @iwdev: device pointer
501cdcd52d4SBartosz Sobczak  * @resource_array: resource array for the resource_num
502cdcd52d4SBartosz Sobczak  * @resource_num: resource number to free
503cdcd52d4SBartosz Sobczak  **/
504cdcd52d4SBartosz Sobczak static inline void irdma_free_rsrc(struct irdma_pci_f *rf,
505cdcd52d4SBartosz Sobczak 				   unsigned long *rsrc_array, u32 rsrc_num)
506cdcd52d4SBartosz Sobczak {
507cdcd52d4SBartosz Sobczak 	unsigned long flags;
508cdcd52d4SBartosz Sobczak 
509cdcd52d4SBartosz Sobczak 	spin_lock_irqsave(&rf->rsrc_lock, flags);
510cdcd52d4SBartosz Sobczak 	__clear_bit(rsrc_num, rsrc_array);
511cdcd52d4SBartosz Sobczak 	spin_unlock_irqrestore(&rf->rsrc_lock, flags);
512cdcd52d4SBartosz Sobczak }
513cdcd52d4SBartosz Sobczak 
514cdcd52d4SBartosz Sobczak int irdma_ctrl_init_hw(struct irdma_pci_f *rf);
515cdcd52d4SBartosz Sobczak void irdma_ctrl_deinit_hw(struct irdma_pci_f *rf);
516cdcd52d4SBartosz Sobczak int irdma_rt_init_hw(struct irdma_device *iwdev,
517cdcd52d4SBartosz Sobczak 		     struct irdma_l2params *l2params);
518cdcd52d4SBartosz Sobczak void irdma_rt_deinit_hw(struct irdma_device *iwdev);
519cdcd52d4SBartosz Sobczak void irdma_qp_add_ref(struct ib_qp *ibqp);
520cdcd52d4SBartosz Sobczak void irdma_qp_rem_ref(struct ib_qp *ibqp);
521cdcd52d4SBartosz Sobczak void irdma_free_lsmm_rsrc(struct irdma_qp *iwqp);
522cdcd52d4SBartosz Sobczak struct ib_qp *irdma_get_qp(struct ib_device *ibdev, int qpn);
523cdcd52d4SBartosz Sobczak void irdma_flush_wqes(struct irdma_qp *iwqp, u32 flush_mask);
524777e472cSBartosz Sobczak void irdma_manage_arp_cache(struct irdma_pci_f *rf, const unsigned char *mac_addr,
525cdcd52d4SBartosz Sobczak 			    u32 *ip_addr, u32 action);
526cdcd52d4SBartosz Sobczak struct irdma_apbvt_entry *irdma_add_apbvt(struct irdma_device *iwdev, u16 port);
527cdcd52d4SBartosz Sobczak void irdma_del_apbvt(struct irdma_device *iwdev,
528cdcd52d4SBartosz Sobczak 		     struct irdma_apbvt_entry *entry);
529cdcd52d4SBartosz Sobczak struct irdma_cqp_request *irdma_alloc_and_get_cqp_request(struct irdma_cqp *cqp,
530cdcd52d4SBartosz Sobczak 							  bool wait);
531cdcd52d4SBartosz Sobczak void irdma_free_cqp_request(struct irdma_cqp *cqp,
532cdcd52d4SBartosz Sobczak 			    struct irdma_cqp_request *cqp_request);
533cdcd52d4SBartosz Sobczak void irdma_put_cqp_request(struct irdma_cqp *cqp,
534cdcd52d4SBartosz Sobczak 			   struct irdma_cqp_request *cqp_request);
535cdcd52d4SBartosz Sobczak int irdma_alloc_local_mac_entry(struct irdma_pci_f *rf, u16 *mac_tbl_idx);
536*35105900SBartosz Sobczak int irdma_add_local_mac_entry(struct irdma_pci_f *rf, const u8 *mac_addr, u16 idx);
537cdcd52d4SBartosz Sobczak void irdma_del_local_mac_entry(struct irdma_pci_f *rf, u16 idx);
538cdcd52d4SBartosz Sobczak 
539cdcd52d4SBartosz Sobczak u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf);
540cdcd52d4SBartosz Sobczak void irdma_port_ibevent(struct irdma_device *iwdev);
541cdcd52d4SBartosz Sobczak void irdma_cm_disconn(struct irdma_qp *qp);
542cdcd52d4SBartosz Sobczak 
543cdcd52d4SBartosz Sobczak bool irdma_cqp_crit_err(struct irdma_sc_dev *dev, u8 cqp_cmd,
544cdcd52d4SBartosz Sobczak 			u16 maj_err_code, u16 min_err_code);
545cdcd52d4SBartosz Sobczak int irdma_handle_cqp_op(struct irdma_pci_f *rf,
546cdcd52d4SBartosz Sobczak 			struct irdma_cqp_request *cqp_request);
547cdcd52d4SBartosz Sobczak 
548cdcd52d4SBartosz Sobczak int irdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
549cdcd52d4SBartosz Sobczak 		    struct ib_udata *udata);
550cdcd52d4SBartosz Sobczak int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
551cdcd52d4SBartosz Sobczak 			 int attr_mask, struct ib_udata *udata);
552cdcd52d4SBartosz Sobczak void irdma_cq_add_ref(struct ib_cq *ibcq);
553cdcd52d4SBartosz Sobczak void irdma_cq_rem_ref(struct ib_cq *ibcq);
554cdcd52d4SBartosz Sobczak void irdma_cq_wq_destroy(struct irdma_pci_f *rf, struct irdma_sc_cq *cq);
555cdcd52d4SBartosz Sobczak 
556cdcd52d4SBartosz Sobczak void irdma_cleanup_pending_cqp_op(struct irdma_pci_f *rf);
557cdcd52d4SBartosz Sobczak int irdma_hw_modify_qp(struct irdma_device *iwdev, struct irdma_qp *iwqp,
558cdcd52d4SBartosz Sobczak 		       struct irdma_modify_qp_info *info, bool wait);
559cdcd52d4SBartosz Sobczak int irdma_qp_suspend_resume(struct irdma_sc_qp *qp, bool suspend);
560cdcd52d4SBartosz Sobczak int irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo,
561cdcd52d4SBartosz Sobczak 		       enum irdma_quad_entry_type etype,
562cdcd52d4SBartosz Sobczak 		       enum irdma_quad_hash_manage_type mtype, void *cmnode,
563cdcd52d4SBartosz Sobczak 		       bool wait);
564cdcd52d4SBartosz Sobczak void irdma_receive_ilq(struct irdma_sc_vsi *vsi, struct irdma_puda_buf *rbuf);
565cdcd52d4SBartosz Sobczak void irdma_free_sqbuf(struct irdma_sc_vsi *vsi, void *bufp);
566cdcd52d4SBartosz Sobczak void irdma_free_qp_rsrc(struct irdma_qp *iwqp);
567cdcd52d4SBartosz Sobczak int irdma_setup_cm_core(struct irdma_device *iwdev, u8 ver);
568cdcd52d4SBartosz Sobczak void irdma_cleanup_cm_core(struct irdma_cm_core *cm_core);
569cdcd52d4SBartosz Sobczak void irdma_next_iw_state(struct irdma_qp *iwqp, u8 state, u8 del_hash, u8 term,
570cdcd52d4SBartosz Sobczak 			 u8 term_len);
571cdcd52d4SBartosz Sobczak int irdma_send_syn(struct irdma_cm_node *cm_node, u32 sendack);
572cdcd52d4SBartosz Sobczak int irdma_send_reset(struct irdma_cm_node *cm_node);
573cdcd52d4SBartosz Sobczak struct irdma_cm_node *irdma_find_node(struct irdma_cm_core *cm_core,
574cdcd52d4SBartosz Sobczak 				      u16 rem_port, u32 *rem_addr, u16 loc_port,
575cdcd52d4SBartosz Sobczak 				      u32 *loc_addr, u16 vlan_id);
576cdcd52d4SBartosz Sobczak int irdma_hw_flush_wqes(struct irdma_pci_f *rf, struct irdma_sc_qp *qp,
577cdcd52d4SBartosz Sobczak 			struct irdma_qp_flush_info *info, bool wait);
578cdcd52d4SBartosz Sobczak void irdma_gen_ae(struct irdma_pci_f *rf, struct irdma_sc_qp *qp,
579cdcd52d4SBartosz Sobczak 		  struct irdma_gen_ae_info *info, bool wait);
580cdcd52d4SBartosz Sobczak void irdma_copy_ip_ntohl(u32 *dst, __be32 *src);
581cdcd52d4SBartosz Sobczak void irdma_copy_ip_htonl(__be32 *dst, u32 *src);
582cdcd52d4SBartosz Sobczak u16 irdma_get_vlan_ipv4(u32 *addr);
583cdcd52d4SBartosz Sobczak struct ifnet *irdma_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *mac);
584cdcd52d4SBartosz Sobczak struct ib_mr *irdma_reg_phys_mr(struct ib_pd *ib_pd, u64 addr, u64 size,
585cdcd52d4SBartosz Sobczak 				int acc, u64 *iova_start);
586cdcd52d4SBartosz Sobczak int irdma_upload_qp_context(struct irdma_qp *iwqp, bool freeze, bool raw);
587cdcd52d4SBartosz Sobczak void irdma_del_hmc_objects(struct irdma_sc_dev *dev,
588cdcd52d4SBartosz Sobczak 			   struct irdma_hmc_info *hmc_info, bool privileged,
589cdcd52d4SBartosz Sobczak 			   bool reset, enum irdma_vers vers);
590cdcd52d4SBartosz Sobczak void irdma_cqp_ce_handler(struct irdma_pci_f *rf, struct irdma_sc_cq *cq);
591cdcd52d4SBartosz Sobczak int irdma_ah_cqp_op(struct irdma_pci_f *rf, struct irdma_sc_ah *sc_ah, u8 cmd,
592cdcd52d4SBartosz Sobczak 		    bool wait,
593cdcd52d4SBartosz Sobczak 		    void (*callback_fcn)(struct irdma_cqp_request *cqp_request),
594cdcd52d4SBartosz Sobczak 		    void *cb_param);
595cdcd52d4SBartosz Sobczak void irdma_gsi_ud_qp_ah_cb(struct irdma_cqp_request *cqp_request);
596*35105900SBartosz Sobczak void irdma_udqp_qs_worker(struct work_struct *work);
597cdcd52d4SBartosz Sobczak bool irdma_cq_empty(struct irdma_cq *iwcq);
598777e472cSBartosz Sobczak int irdma_netdevice_event(struct notifier_block *notifier, unsigned long event,
599777e472cSBartosz Sobczak 			  void *ptr);
600777e472cSBartosz Sobczak void irdma_unregister_notifiers(struct irdma_device *iwdev);
601777e472cSBartosz Sobczak int irdma_register_notifiers(struct irdma_device *iwdev);
602cdcd52d4SBartosz Sobczak void irdma_set_rf_user_cfg_params(struct irdma_pci_f *rf);
603cdcd52d4SBartosz Sobczak void irdma_add_ip(struct irdma_device *iwdev);
604cdcd52d4SBartosz Sobczak void irdma_add_handler(struct irdma_handler *hdl);
605cdcd52d4SBartosz Sobczak void irdma_del_handler(struct irdma_handler *hdl);
606cdcd52d4SBartosz Sobczak void cqp_compl_worker(struct work_struct *work);
607*35105900SBartosz Sobczak void irdma_cleanup_dead_qps(struct irdma_sc_vsi *vsi);
608cdcd52d4SBartosz Sobczak #endif /* IRDMA_MAIN_H */
609