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