2 * Copyright (c) 2017-2018 Cavium, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
31 #ifndef __ECORE_PROTO_IF_H__
32 #define __ECORE_PROTO_IF_H__
35 * PF parameters (according to personality/protocol)
38 #define ECORE_ROCE_PROTOCOL_INDEX (3)
40 struct ecore_eth_pf_params {
41 /* The following parameters are used during HW-init
42 * and these parameters need to be passed as arguments
43 * to update_pf_params routine invoked before slowpath start
47 /* per-VF number of CIDs */
49 #define ETH_PF_PARAMS_VF_CONS_DEFAULT (32)
51 /* To enable arfs, previous to HW-init a positive number needs to be
52 * set [as filters require allocated searcher ILT memory].
53 * This will set the maximal number of configured steering-filters.
58 /* Most of the the parameters below are described in the FW FCoE HSI */
59 struct ecore_fcoe_pf_params {
60 /* The following parameters are used during protocol-init */
61 u64 glbl_q_params_addr;
62 u64 bdq_pbl_base_addr[2];
64 /* The following parameters are used during HW-init
65 * and these parameters need to be passed as arguments
66 * to update_pf_params routine invoked before slowpath start
71 /* The following parameters are used during protocol-init */
76 u16 rq_buffer_log_size;
79 u16 bdq_xoff_threshold[2];
80 u16 bdq_xon_threshold[2];
82 u8 num_cqs; /* num of global CQs */
88 u8 bdq_pbl_num_entries[2];
91 /* Most of the the parameters below are described in the FW iSCSI / TCP HSI */
92 struct ecore_iscsi_pf_params {
94 u64 glbl_q_params_addr;
95 u64 bdq_pbl_base_addr[3];
100 /* The following parameters are used during HW-init
101 * and these parameters need to be passed as arguments
102 * to update_pf_params routine invoked before slowpath start
107 /* The following parameters are used during protocol-init */
108 u16 half_way_close_timeout;
109 u16 bdq_xoff_threshold[3];
110 u16 bdq_xon_threshold[3];
111 u16 cmdq_xoff_threshold;
112 u16 cmdq_xon_threshold;
115 u8 num_sq_pages_in_ring;
116 u8 num_r2tq_pages_in_ring;
117 u8 num_uhq_pages_in_ring;
129 u8 soc_num_of_blocks_log;
130 u8 bdq_pbl_num_entries[3];
131 u8 disable_stats_collection;
134 enum ecore_rdma_protocol {
135 ECORE_RDMA_PROTOCOL_DEFAULT,
136 ECORE_RDMA_PROTOCOL_NONE,
137 ECORE_RDMA_PROTOCOL_ROCE,
138 ECORE_RDMA_PROTOCOL_IWARP,
141 struct ecore_rdma_pf_params {
142 /* Supplied to ECORE during resource allocation (may affect the ILT and
145 u32 min_dpis; /* number of requested DPIs */
146 u32 num_qps; /* number of requested Queue Pairs */
147 u32 num_srqs; /* number of requested SRQs */
148 u32 num_xrc_srqs; /* number of requested XRC SRQs */
149 u8 roce_edpm_mode; /* see QED_ROCE_EDPM_MODE_ENABLE */
150 u8 gl_pi; /* protocol index */
152 /* Will allocate rate limiters to be used with QPs */
155 /* Max number of CNQs - limits number of ECORE_RDMA_CNQ feature,
156 * Allowing an incrementation in ECORE_PF_L2_QUE.
157 * To disable CNQs, use dedicated value instead of `0'.
159 #define ECORE_RDMA_PF_PARAMS_CNQS_NONE (0xffff)
162 /* TCP port number used for the iwarp traffic */
164 enum ecore_rdma_protocol rdma_protocol;
167 struct ecore_pf_params {
168 struct ecore_eth_pf_params eth_pf_params;
169 struct ecore_fcoe_pf_params fcoe_pf_params;
170 struct ecore_iscsi_pf_params iscsi_pf_params;
171 struct ecore_rdma_pf_params rdma_pf_params;