xref: /freebsd/sys/dev/qlnx/qlnxe/ecore_iro.h (revision 43a5ec4eb41567cc92586503212743d89686d78f)
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 __IRO_H__
32 #define __IRO_H__
33 
34 /* Ystorm flow control mode. Use enum fw_flow_ctrl_mode */
35 #define YSTORM_FLOW_CONTROL_MODE_OFFSET                             (IRO[0].base)
36 #define YSTORM_FLOW_CONTROL_MODE_SIZE                               (IRO[0].size)
37 /* Tstorm port statistics */
38 #define TSTORM_PORT_STAT_OFFSET(port_id)                            (IRO[1].base + ((port_id) * IRO[1].m1))
39 #define TSTORM_PORT_STAT_SIZE                                       (IRO[1].size)
40 /* Tstorm ll2 port statistics */
41 #define TSTORM_LL2_PORT_STAT_OFFSET(port_id)                        (IRO[2].base + ((port_id) * IRO[2].m1))
42 #define TSTORM_LL2_PORT_STAT_SIZE                                   (IRO[2].size)
43 /* Ustorm VF-PF Channel ready flag */
44 #define USTORM_VF_PF_CHANNEL_READY_OFFSET(vf_id)                    (IRO[3].base + ((vf_id) * IRO[3].m1))
45 #define USTORM_VF_PF_CHANNEL_READY_SIZE                             (IRO[3].size)
46 /* Ustorm Final flr cleanup ack */
47 #define USTORM_FLR_FINAL_ACK_OFFSET(pf_id)                          (IRO[4].base + ((pf_id) * IRO[4].m1))
48 #define USTORM_FLR_FINAL_ACK_SIZE                                   (IRO[4].size)
49 /* Ustorm Event ring consumer */
50 #define USTORM_EQE_CONS_OFFSET(pf_id)                               (IRO[5].base + ((pf_id) * IRO[5].m1))
51 #define USTORM_EQE_CONS_SIZE                                        (IRO[5].size)
52 /* Ustorm eth queue zone */
53 #define USTORM_ETH_QUEUE_ZONE_OFFSET(queue_zone_id)                 (IRO[6].base + ((queue_zone_id) * IRO[6].m1))
54 #define USTORM_ETH_QUEUE_ZONE_SIZE                                  (IRO[6].size)
55 /* Ustorm Common Queue ring consumer */
56 #define USTORM_COMMON_QUEUE_CONS_OFFSET(queue_zone_id)              (IRO[7].base + ((queue_zone_id) * IRO[7].m1))
57 #define USTORM_COMMON_QUEUE_CONS_SIZE                               (IRO[7].size)
58 /* Xstorm Integration Test Data */
59 #define XSTORM_INTEG_TEST_DATA_OFFSET                               (IRO[8].base)
60 #define XSTORM_INTEG_TEST_DATA_SIZE                                 (IRO[8].size)
61 /* Ystorm Integration Test Data */
62 #define YSTORM_INTEG_TEST_DATA_OFFSET                               (IRO[9].base)
63 #define YSTORM_INTEG_TEST_DATA_SIZE                                 (IRO[9].size)
64 /* Pstorm Integration Test Data */
65 #define PSTORM_INTEG_TEST_DATA_OFFSET                               (IRO[10].base)
66 #define PSTORM_INTEG_TEST_DATA_SIZE                                 (IRO[10].size)
67 /* Tstorm Integration Test Data */
68 #define TSTORM_INTEG_TEST_DATA_OFFSET                               (IRO[11].base)
69 #define TSTORM_INTEG_TEST_DATA_SIZE                                 (IRO[11].size)
70 /* Mstorm Integration Test Data */
71 #define MSTORM_INTEG_TEST_DATA_OFFSET                               (IRO[12].base)
72 #define MSTORM_INTEG_TEST_DATA_SIZE                                 (IRO[12].size)
73 /* Ustorm Integration Test Data */
74 #define USTORM_INTEG_TEST_DATA_OFFSET                               (IRO[13].base)
75 #define USTORM_INTEG_TEST_DATA_SIZE                                 (IRO[13].size)
76 /* Tstorm producers */
77 #define TSTORM_LL2_RX_PRODS_OFFSET(core_rx_queue_id)                (IRO[14].base + ((core_rx_queue_id) * IRO[14].m1))
78 #define TSTORM_LL2_RX_PRODS_SIZE                                    (IRO[14].size)
79 /* Tstorm LightL2 queue statistics */
80 #define CORE_LL2_TSTORM_PER_QUEUE_STAT_OFFSET(core_rx_queue_id)     (IRO[15].base + ((core_rx_queue_id) * IRO[15].m1))
81 #define CORE_LL2_TSTORM_PER_QUEUE_STAT_SIZE                         (IRO[15].size)
82 /* Ustorm LiteL2 queue statistics */
83 #define CORE_LL2_USTORM_PER_QUEUE_STAT_OFFSET(core_rx_queue_id)     (IRO[16].base + ((core_rx_queue_id) * IRO[16].m1))
84 #define CORE_LL2_USTORM_PER_QUEUE_STAT_SIZE                         (IRO[16].size)
85 /* Pstorm LiteL2 queue statistics */
86 #define CORE_LL2_PSTORM_PER_QUEUE_STAT_OFFSET(core_tx_stats_id)     (IRO[17].base + ((core_tx_stats_id) * IRO[17].m1))
87 #define CORE_LL2_PSTORM_PER_QUEUE_STAT_SIZE                         (IRO[17].size)
88 /* Mstorm queue statistics */
89 #define MSTORM_QUEUE_STAT_OFFSET(stat_counter_id)                   (IRO[18].base + ((stat_counter_id) * IRO[18].m1))
90 #define MSTORM_QUEUE_STAT_SIZE                                      (IRO[18].size)
91 /* Mstorm ETH PF queues producers */
92 #define MSTORM_ETH_PF_PRODS_OFFSET(queue_id)                        (IRO[19].base + ((queue_id) * IRO[19].m1))
93 #define MSTORM_ETH_PF_PRODS_SIZE                                    (IRO[19].size)
94 /* Mstorm ETH VF queues producers offset in RAM. Used in default VF zone size mode. */
95 #define MSTORM_ETH_VF_PRODS_OFFSET(vf_id,vf_queue_id)               (IRO[20].base + ((vf_id) * IRO[20].m1) + ((vf_queue_id) * IRO[20].m2))
96 #define MSTORM_ETH_VF_PRODS_SIZE                                    (IRO[20].size)
97 /* TPA agregation timeout in us resolution (on ASIC) */
98 #define MSTORM_TPA_TIMEOUT_US_OFFSET                                (IRO[21].base)
99 #define MSTORM_TPA_TIMEOUT_US_SIZE                                  (IRO[21].size)
100 /* Mstorm pf statistics */
101 #define MSTORM_ETH_PF_STAT_OFFSET(pf_id)                            (IRO[22].base + ((pf_id) * IRO[22].m1))
102 #define MSTORM_ETH_PF_STAT_SIZE                                     (IRO[22].size)
103 /* Ustorm queue statistics */
104 #define USTORM_QUEUE_STAT_OFFSET(stat_counter_id)                   (IRO[23].base + ((stat_counter_id) * IRO[23].m1))
105 #define USTORM_QUEUE_STAT_SIZE                                      (IRO[23].size)
106 /* Ustorm pf statistics */
107 #define USTORM_ETH_PF_STAT_OFFSET(pf_id)                            (IRO[24].base + ((pf_id) * IRO[24].m1))
108 #define USTORM_ETH_PF_STAT_SIZE                                     (IRO[24].size)
109 /* Pstorm queue statistics */
110 #define PSTORM_QUEUE_STAT_OFFSET(stat_counter_id)                   (IRO[25].base + ((stat_counter_id) * IRO[25].m1))
111 #define PSTORM_QUEUE_STAT_SIZE                                      (IRO[25].size)
112 /* Pstorm pf statistics */
113 #define PSTORM_ETH_PF_STAT_OFFSET(pf_id)                            (IRO[26].base + ((pf_id) * IRO[26].m1))
114 #define PSTORM_ETH_PF_STAT_SIZE                                     (IRO[26].size)
115 /* Control frame's EthType configuration for TX control frame security */
116 #define PSTORM_CTL_FRAME_ETHTYPE_OFFSET(ethType_id)                 (IRO[27].base + ((ethType_id) * IRO[27].m1))
117 #define PSTORM_CTL_FRAME_ETHTYPE_SIZE                               (IRO[27].size)
118 /* Tstorm last parser message */
119 #define TSTORM_ETH_PRS_INPUT_OFFSET                                 (IRO[28].base)
120 #define TSTORM_ETH_PRS_INPUT_SIZE                                   (IRO[28].size)
121 /* Tstorm Eth limit Rx rate */
122 #define ETH_RX_RATE_LIMIT_OFFSET(pf_id)                             (IRO[29].base + ((pf_id) * IRO[29].m1))
123 #define ETH_RX_RATE_LIMIT_SIZE                                      (IRO[29].size)
124 /* Xstorm queue zone */
125 #define XSTORM_ETH_QUEUE_ZONE_OFFSET(queue_id)                      (IRO[30].base + ((queue_id) * IRO[30].m1))
126 #define XSTORM_ETH_QUEUE_ZONE_SIZE                                  (IRO[30].size)
127 /* Ystorm cqe producer */
128 #define YSTORM_TOE_CQ_PROD_OFFSET(rss_id)                           (IRO[31].base + ((rss_id) * IRO[31].m1))
129 #define YSTORM_TOE_CQ_PROD_SIZE                                     (IRO[31].size)
130 /* Ustorm cqe producer */
131 #define USTORM_TOE_CQ_PROD_OFFSET(rss_id)                           (IRO[32].base + ((rss_id) * IRO[32].m1))
132 #define USTORM_TOE_CQ_PROD_SIZE                                     (IRO[32].size)
133 /* Ustorm grq producer */
134 #define USTORM_TOE_GRQ_PROD_OFFSET(pf_id)                           (IRO[33].base + ((pf_id) * IRO[33].m1))
135 #define USTORM_TOE_GRQ_PROD_SIZE                                    (IRO[33].size)
136 /* Tstorm cmdq-cons of given command queue-id */
137 #define TSTORM_SCSI_CMDQ_CONS_OFFSET(cmdq_queue_id)                 (IRO[34].base + ((cmdq_queue_id) * IRO[34].m1))
138 #define TSTORM_SCSI_CMDQ_CONS_SIZE                                  (IRO[34].size)
139 /* Tstorm (reflects M-Storm) bdq-external-producer of given function ID, BDqueue-id */
140 #define TSTORM_SCSI_BDQ_EXT_PROD_OFFSET(func_id,bdq_id)             (IRO[35].base + ((func_id) * IRO[35].m1) + ((bdq_id) * IRO[35].m2))
141 #define TSTORM_SCSI_BDQ_EXT_PROD_SIZE                               (IRO[35].size)
142 /* Mstorm bdq-external-producer of given BDQ resource ID, BDqueue-id */
143 #define MSTORM_SCSI_BDQ_EXT_PROD_OFFSET(func_id,bdq_id)             (IRO[36].base + ((func_id) * IRO[36].m1) + ((bdq_id) * IRO[36].m2))
144 #define MSTORM_SCSI_BDQ_EXT_PROD_SIZE                               (IRO[36].size)
145 /* Tstorm iSCSI RX stats */
146 #define TSTORM_ISCSI_RX_STATS_OFFSET(pf_id)                         (IRO[37].base + ((pf_id) * IRO[37].m1))
147 #define TSTORM_ISCSI_RX_STATS_SIZE                                  (IRO[37].size)
148 /* Mstorm iSCSI RX stats */
149 #define MSTORM_ISCSI_RX_STATS_OFFSET(pf_id)                         (IRO[38].base + ((pf_id) * IRO[38].m1))
150 #define MSTORM_ISCSI_RX_STATS_SIZE                                  (IRO[38].size)
151 /* Ustorm iSCSI RX stats */
152 #define USTORM_ISCSI_RX_STATS_OFFSET(pf_id)                         (IRO[39].base + ((pf_id) * IRO[39].m1))
153 #define USTORM_ISCSI_RX_STATS_SIZE                                  (IRO[39].size)
154 /* Xstorm iSCSI TX stats */
155 #define XSTORM_ISCSI_TX_STATS_OFFSET(pf_id)                         (IRO[40].base + ((pf_id) * IRO[40].m1))
156 #define XSTORM_ISCSI_TX_STATS_SIZE                                  (IRO[40].size)
157 /* Ystorm iSCSI TX stats */
158 #define YSTORM_ISCSI_TX_STATS_OFFSET(pf_id)                         (IRO[41].base + ((pf_id) * IRO[41].m1))
159 #define YSTORM_ISCSI_TX_STATS_SIZE                                  (IRO[41].size)
160 /* Pstorm iSCSI TX stats */
161 #define PSTORM_ISCSI_TX_STATS_OFFSET(pf_id)                         (IRO[42].base + ((pf_id) * IRO[42].m1))
162 #define PSTORM_ISCSI_TX_STATS_SIZE                                  (IRO[42].size)
163 /* Tstorm FCoE RX stats */
164 #define TSTORM_FCOE_RX_STATS_OFFSET(pf_id)                          (IRO[43].base + ((pf_id) * IRO[43].m1))
165 #define TSTORM_FCOE_RX_STATS_SIZE                                   (IRO[43].size)
166 /* Pstorm FCoE TX stats */
167 #define PSTORM_FCOE_TX_STATS_OFFSET(pf_id)                          (IRO[44].base + ((pf_id) * IRO[44].m1))
168 #define PSTORM_FCOE_TX_STATS_SIZE                                   (IRO[44].size)
169 /* Pstorm RDMA queue statistics */
170 #define PSTORM_RDMA_QUEUE_STAT_OFFSET(rdma_stat_counter_id)         (IRO[45].base + ((rdma_stat_counter_id) * IRO[45].m1))
171 #define PSTORM_RDMA_QUEUE_STAT_SIZE                                 (IRO[45].size)
172 /* Tstorm RDMA queue statistics */
173 #define TSTORM_RDMA_QUEUE_STAT_OFFSET(rdma_stat_counter_id)         (IRO[46].base + ((rdma_stat_counter_id) * IRO[46].m1))
174 #define TSTORM_RDMA_QUEUE_STAT_SIZE                                 (IRO[46].size)
175 /* Xstorm iWARP rxmit stats */
176 #define XSTORM_IWARP_RXMIT_STATS_OFFSET(pf_id)                      (IRO[47].base + ((pf_id) * IRO[47].m1))
177 #define XSTORM_IWARP_RXMIT_STATS_SIZE                               (IRO[47].size)
178 /* Tstorm RoCE Event Statistics */
179 #define TSTORM_ROCE_EVENTS_STAT_OFFSET(roce_pf_id)                  (IRO[48].base + ((roce_pf_id) * IRO[48].m1))
180 #define TSTORM_ROCE_EVENTS_STAT_SIZE                                (IRO[48].size)
181 /* DCQCN Received Statistics */
182 #define YSTORM_ROCE_DCQCN_RECEIVED_STATS_OFFSET(roce_pf_id)         (IRO[49].base + ((roce_pf_id) * IRO[49].m1))
183 #define YSTORM_ROCE_DCQCN_RECEIVED_STATS_SIZE                       (IRO[49].size)
184 /* DCQCN Sent Statistics */
185 #define PSTORM_ROCE_DCQCN_SENT_STATS_OFFSET(roce_pf_id)             (IRO[50].base + ((roce_pf_id) * IRO[50].m1))
186 #define PSTORM_ROCE_DCQCN_SENT_STATS_SIZE                           (IRO[50].size)
187 
188 #endif /* __IRO_H__ */
189