]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/dev/qlnx/qlnxe/ecore_proto_if.h
MFC r316485
[FreeBSD/stable/10.git] / sys / dev / qlnx / qlnxe / ecore_proto_if.h
1 /*
2  * Copyright (c) 2017-2018 Cavium, Inc. 
3  * All rights reserved.
4  *
5  *  Redistribution and use in source and binary forms, with or without
6  *  modification, are permitted provided that the following conditions
7  *  are met:
8  *
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.
14  *
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.
26  *
27  * $FreeBSD$
28  *
29  */
30
31 #ifndef __ECORE_PROTO_IF_H__
32 #define __ECORE_PROTO_IF_H__
33
34 /*
35  * PF parameters (according to personality/protocol)
36  */
37
38 #define ECORE_ROCE_PROTOCOL_INDEX       (3)
39
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
44          */
45         u16     num_cons;
46
47         /* per-VF number of CIDs */
48         u8      num_vf_cons;
49 #define ETH_PF_PARAMS_VF_CONS_DEFAULT   (32)
50
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.
54          */
55         u32     num_arfs_filters;
56 };
57
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];
63
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
67          */
68         u16             num_cons;
69         u16             num_tasks;
70
71         /* The following parameters are used during protocol-init */
72         u16             sq_num_pbl_pages;
73
74         u16             cq_num_entries;
75         u16             cmdq_num_entries;
76         u16             rq_buffer_log_size;
77         u16             mtu;
78         u16             dummy_icid;
79         u16             bdq_xoff_threshold[2];
80         u16             bdq_xon_threshold[2];
81         u16             rq_buffer_size;
82         u8              num_cqs; /* num of global CQs */
83         u8              log_page_size;
84         u8              gl_rq_pi;
85         u8              gl_cmd_pi;
86         u8              debug_mode;
87         u8              is_target;
88         u8              bdq_pbl_num_entries[2];
89 };
90
91 /* Most of the the parameters below are described in the FW iSCSI / TCP HSI */
92 struct ecore_iscsi_pf_params {
93
94         u64             glbl_q_params_addr;
95         u64             bdq_pbl_base_addr[2];
96         u16             cq_num_entries;
97         u16             cmdq_num_entries;
98         u32             two_msl_timer;
99         u16             tx_sws_timer;
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
103          */
104         u16             num_cons;
105         u16             num_tasks;
106
107         /* The following parameters are used during protocol-init */
108         u16             half_way_close_timeout;
109         u16             bdq_xoff_threshold[2];
110         u16             bdq_xon_threshold[2];
111         u16             cmdq_xoff_threshold;
112         u16             cmdq_xon_threshold;
113         u16             rq_buffer_size;
114
115         u8              num_sq_pages_in_ring;
116         u8              num_r2tq_pages_in_ring;
117         u8              num_uhq_pages_in_ring;
118         u8              num_queues;
119         u8              log_page_size;
120         u8              rqe_log_size;
121         u8              max_fin_rt;
122         u8              gl_rq_pi;
123         u8              gl_cmd_pi;
124         u8              debug_mode;
125         u8              ll2_ooo_queue_id;
126         u8              ooo_enable;
127
128         u8              is_target;
129         u8              bdq_pbl_num_entries[2];
130 };
131
132 enum ecore_rdma_protocol {
133         ECORE_RDMA_PROTOCOL_DEFAULT,
134         ECORE_RDMA_PROTOCOL_NONE,
135         ECORE_RDMA_PROTOCOL_ROCE,
136         ECORE_RDMA_PROTOCOL_IWARP,
137 };
138
139 struct ecore_rdma_pf_params {
140         /* Supplied to ECORE during resource allocation (may affect the ILT and
141          * the doorbell BAR).
142          */
143         u32             min_dpis;       /* number of requested DPIs */
144         u32             num_qps;        /* number of requested Queue Pairs */
145         u32             num_srqs;       /* number of requested SRQ */
146         u8              roce_edpm_mode; /* see QED_ROCE_EDPM_MODE_ENABLE */
147         u8              gl_pi;          /* protocol index */
148
149         /* Will allocate rate limiters to be used with QPs */
150         u8              enable_dcqcn;
151
152         /* Max number of CNQs - limits number of ECORE_RDMA_CNQ feature,
153          * Allowing an incrementation in ECORE_PF_L2_QUE.
154          * To disable CNQs, use dedicated value instead of `0'.
155          */
156 #define ECORE_RDMA_PF_PARAMS_CNQS_NONE  (0xffff)
157         u16             max_cnqs;
158
159         /* TCP port number used for the iwarp traffic */
160         u16             iwarp_port;
161         enum ecore_rdma_protocol rdma_protocol;
162 };
163
164 struct ecore_pf_params {
165         struct ecore_eth_pf_params      eth_pf_params;
166         struct ecore_fcoe_pf_params     fcoe_pf_params;
167         struct ecore_iscsi_pf_params    iscsi_pf_params;
168         struct ecore_rdma_pf_params     rdma_pf_params;
169 };
170
171 #endif
172
173