]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - drivers/infiniband/hw/bnxt_re/qplib_sp.h
2 * Broadcom NetXtreme-E RoCE driver.
4 * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term
5 * Broadcom refers to Broadcom Limited and/or its subsidiaries.
7 * This software is available to you under a choice of one of two
8 * licenses. You may choose to be licensed under the terms of the GNU
9 * General Public License (GPL) Version 2, available from the file
10 * COPYING in the main directory of this source tree, or the
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in
21 * the documentation and/or other materials provided with the
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Description: Slow Path Operators (header)
40 #ifndef __BNXT_QPLIB_SP_H__
41 #define __BNXT_QPLIB_SP_H__
43 #define BNXT_QPLIB_RESERVED_QP_WRS 128
45 #define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040
47 struct bnxt_qplib_dev_attr
{
52 #define BNXT_QPLIB_MAX_OUT_RD_ATOM 126
54 u32 max_qp_init_rd_atom
;
74 u8 tqm_alloc_reqs
[MAX_TQM_ALLOC_REQ
];
78 struct bnxt_qplib_pd
{
82 struct bnxt_qplib_gid
{
86 struct bnxt_qplib_ah
{
87 struct bnxt_qplib_gid dgid
;
88 struct bnxt_qplib_pd
*pd
;
91 /* For Query AH if the hw table and SW table are differnt */
102 struct bnxt_qplib_mrw
{
103 struct bnxt_qplib_pd
*pd
;
106 #define BNXT_QPLIB_FR_PMR 0x80000000
109 #define BNXT_QPLIB_RSVD_LKEY 0xFFFFFFFF
114 struct bnxt_qplib_hwq hwq
;
117 struct bnxt_qplib_frpl
{
119 struct bnxt_qplib_hwq hwq
;
122 #define BNXT_QPLIB_ACCESS_LOCAL_WRITE BIT(0)
123 #define BNXT_QPLIB_ACCESS_REMOTE_READ BIT(1)
124 #define BNXT_QPLIB_ACCESS_REMOTE_WRITE BIT(2)
125 #define BNXT_QPLIB_ACCESS_REMOTE_ATOMIC BIT(3)
126 #define BNXT_QPLIB_ACCESS_MW_BIND BIT(4)
127 #define BNXT_QPLIB_ACCESS_ZERO_BASED BIT(5)
128 #define BNXT_QPLIB_ACCESS_ON_DEMAND BIT(6)
130 int bnxt_qplib_get_sgid(struct bnxt_qplib_res
*res
,
131 struct bnxt_qplib_sgid_tbl
*sgid_tbl
, int index
,
132 struct bnxt_qplib_gid
*gid
);
133 int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl
*sgid_tbl
,
134 struct bnxt_qplib_gid
*gid
, bool update
);
135 int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl
*sgid_tbl
,
136 struct bnxt_qplib_gid
*gid
, u8
*mac
, u16 vlan_id
,
137 bool update
, u32
*index
);
138 int bnxt_qplib_get_pkey(struct bnxt_qplib_res
*res
,
139 struct bnxt_qplib_pkey_tbl
*pkey_tbl
, u16 index
,
141 int bnxt_qplib_del_pkey(struct bnxt_qplib_res
*res
,
142 struct bnxt_qplib_pkey_tbl
*pkey_tbl
, u16
*pkey
,
144 int bnxt_qplib_add_pkey(struct bnxt_qplib_res
*res
,
145 struct bnxt_qplib_pkey_tbl
*pkey_tbl
, u16
*pkey
,
147 int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw
*rcfw
,
148 struct bnxt_qplib_dev_attr
*attr
);
149 int bnxt_qplib_create_ah(struct bnxt_qplib_res
*res
, struct bnxt_qplib_ah
*ah
);
150 int bnxt_qplib_destroy_ah(struct bnxt_qplib_res
*res
, struct bnxt_qplib_ah
*ah
);
151 int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res
*res
,
152 struct bnxt_qplib_mrw
*mrw
);
153 int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res
*res
, struct bnxt_qplib_mrw
*mrw
,
155 int bnxt_qplib_reg_mr(struct bnxt_qplib_res
*res
, struct bnxt_qplib_mrw
*mr
,
156 u64
*pbl_tbl
, int num_pbls
, bool block
);
157 int bnxt_qplib_free_mrw(struct bnxt_qplib_res
*res
, struct bnxt_qplib_mrw
*mr
);
158 int bnxt_qplib_alloc_fast_reg_mr(struct bnxt_qplib_res
*res
,
159 struct bnxt_qplib_mrw
*mr
, int max
);
160 int bnxt_qplib_alloc_fast_reg_page_list(struct bnxt_qplib_res
*res
,
161 struct bnxt_qplib_frpl
*frpl
, int max
);
162 int bnxt_qplib_free_fast_reg_page_list(struct bnxt_qplib_res
*res
,
163 struct bnxt_qplib_frpl
*frpl
);
164 int bnxt_qplib_map_tc2cos(struct bnxt_qplib_res
*res
, u16
*cids
);
165 #endif /* __BNXT_QPLIB_SP_H__*/