xref: /illumos-gate/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_hsi_init_func.h (revision 14b24e2b79293068c8e016a69ef1d872fb5e2fd5)
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1,  (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 
22 /*
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1,  (the "License").
26 
27 * You may not use this file except in compliance with the License.
28 
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
31 
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
34 */
35 
36 #ifndef __ECORE_HSI_INIT_FUNC__
37 #define __ECORE_HSI_INIT_FUNC__
38 /********************************/
39 /* HSI Init Functions constants */
40 /********************************/
41 
42 /* Number of VLAN priorities */
43 #define NUM_OF_VLAN_PRIORITIES			8
44 
45 /* Size of CRC8 lookup table */
46 #ifndef LINUX_REMOVE
47 #define CRC8_TABLE_SIZE					256
48 #endif
49 
50 /*
51  * BRB RAM init requirements
52  */
53 struct init_brb_ram_req
54 {
55 	__le32 guranteed_per_tc /* guaranteed size per TC, in bytes */;
56 	__le32 headroom_per_tc /* headroom size per TC, in bytes */;
57 	__le32 min_pkt_size /* min packet size, in bytes */;
58 	__le32 max_ports_per_engine /* min packet size, in bytes */;
59 	u8 num_active_tcs[MAX_NUM_PORTS] /* number of active TCs per port */;
60 };
61 
62 
63 /*
64  * ETS per-TC init requirements
65  */
66 struct init_ets_tc_req
67 {
68 	u8 use_sp /* if set, this TC participates in the arbitration with a strict priority (the priority is equal to the TC ID) */;
69 	u8 use_wfq /* if set, this TC participates in the arbitration with a WFQ weight (indicated by the weight field) */;
70 	__le16 weight /* An arbitration weight. Valid only if use_wfq is set. */;
71 };
72 
73 /*
74  * ETS init requirements
75  */
76 struct init_ets_req
77 {
78 	__le32 mtu /* Max packet size (in bytes) */;
79 	struct init_ets_tc_req tc_req[NUM_OF_TCS] /* ETS initialization requirements per TC. */;
80 };
81 
82 
83 
84 /*
85  * NIG LB RL init requirements
86  */
87 struct init_nig_lb_rl_req
88 {
89 	__le16 lb_mac_rate /* Global MAC+LB RL rate (in Mbps). If set to 0, the RL will be disabled. */;
90 	__le16 lb_rate /* Global LB RL rate (in Mbps). If set to 0, the RL will be disabled. */;
91 	__le32 mtu /* Max packet size (in bytes) */;
92 	__le16 tc_rate[NUM_OF_PHYS_TCS] /* RL rate per physical TC (in Mbps). If set to 0, the RL will be disabled. */;
93 };
94 
95 
96 /*
97  * NIG TC mapping for each priority
98  */
99 struct init_nig_pri_tc_map_entry
100 {
101 	u8 tc_id /* the mapped TC ID */;
102 	u8 valid /* indicates if the mapping entry is valid */;
103 };
104 
105 
106 /*
107  * NIG priority to TC map init requirements
108  */
109 struct init_nig_pri_tc_map_req
110 {
111 	struct init_nig_pri_tc_map_entry pri[NUM_OF_VLAN_PRIORITIES];
112 };
113 
114 
115 /*
116  * QM per-port init parameters
117  */
118 struct init_qm_port_params
119 {
120 	u8 active /* Indicates if this port is active */;
121 	u8 active_phys_tcs /* Vector of valid bits for active TCs used by this port */;
122 	__le16 num_pbf_cmd_lines /* number of PBF command lines that can be used by this port */;
123 	__le16 num_btb_blocks /* number of BTB blocks that can be used by this port */;
124 	__le16 reserved;
125 };
126 
127 
128 /*
129  * QM per-PQ init parameters
130  */
131 struct init_qm_pq_params
132 {
133 	u8 vport_id /* VPORT ID */;
134 	u8 tc_id /* TC ID */;
135 	u8 wrr_group /* WRR group */;
136 	u8 rl_valid /* Indicates if a rate limiter should be allocated for the PQ (0/1) */;
137 };
138 
139 
140 /*
141  * QM per-vport init parameters
142  */
143 struct init_qm_vport_params
144 {
145 	__le32 vport_rl /* rate limit in Mb/sec units. a value of 0 means dont configure. ignored if VPORT RL is globally disabled. */;
146 	__le16 vport_wfq /* WFQ weight. A value of 0 means dont configure. ignored if VPORT WFQ is globally disabled. */;
147 	__le16 first_tx_pq_id[NUM_OF_TCS] /* the first Tx PQ ID associated with this VPORT for each TC. */;
148 };
149 
150 #endif /* __ECORE_HSI_INIT_FUNC__ */
151