xref: /dpdk/drivers/net/qede/base/ecore_hsi_init_func.h (revision 7ed1cd53dbb515328f8780aa95aabce85e1ffb2f)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2016 - 2018 Cavium Inc.
3  * All rights reserved.
4  * www.cavium.com
5  */
6 
7 #ifndef __ECORE_HSI_INIT_FUNC__
8 #define __ECORE_HSI_INIT_FUNC__
9 /********************************/
10 /* HSI Init Functions constants */
11 /********************************/
12 
13 /* Number of VLAN priorities */
14 #define NUM_OF_VLAN_PRIORITIES			8
15 
16 /* Size of CRC8 lookup table */
17 #ifndef LINUX_REMOVE
18 #define CRC8_TABLE_SIZE					256
19 #endif
20 
21 /*
22  * BRB RAM init requirements
23  */
24 struct init_brb_ram_req {
25 	u32 guranteed_per_tc /* guaranteed size per TC, in bytes */;
26 	u32 headroom_per_tc /* headroom size per TC, in bytes */;
27 	u32 min_pkt_size /* min packet size, in bytes */;
28 	u32 max_ports_per_engine /* min packet size, in bytes */;
29 	u8 num_active_tcs[MAX_NUM_PORTS] /* number of active TCs per port */;
30 };
31 
32 
33 /*
34  * ETS per-TC init requirements
35  */
36 struct init_ets_tc_req {
37 /* if set, this TC participates in the arbitration with a strict priority
38  * (the priority is equal to the TC ID)
39  */
40 	u8 use_sp;
41 /* if set, this TC participates in the arbitration with a WFQ weight
42  * (indicated by the weight field)
43  */
44 	u8 use_wfq;
45 	u16 weight /* An arbitration weight. Valid only if use_wfq is set. */;
46 };
47 
48 /*
49  * ETS init requirements
50  */
51 struct init_ets_req {
52 	u32 mtu /* Max packet size (in bytes) */;
53 /* ETS initialization requirements per TC. */
54 	struct init_ets_tc_req tc_req[NUM_OF_TCS];
55 };
56 
57 
58 
59 /*
60  * NIG LB RL init requirements
61  */
62 struct init_nig_lb_rl_req {
63 /* Global MAC+LB RL rate (in Mbps). If set to 0, the RL will be disabled. */
64 	u16 lb_mac_rate;
65 /* Global LB RL rate (in Mbps). If set to 0, the RL will be disabled. */
66 	u16 lb_rate;
67 	u32 mtu /* Max packet size (in bytes) */;
68 /* RL rate per physical TC (in Mbps). If set to 0, the RL will be disabled. */
69 	u16 tc_rate[NUM_OF_PHYS_TCS];
70 };
71 
72 
73 /*
74  * NIG TC mapping for each priority
75  */
76 struct init_nig_pri_tc_map_entry {
77 	u8 tc_id /* the mapped TC ID */;
78 	u8 valid /* indicates if the mapping entry is valid */;
79 };
80 
81 
82 /*
83  * NIG priority to TC map init requirements
84  */
85 struct init_nig_pri_tc_map_req {
86 	struct init_nig_pri_tc_map_entry pri[NUM_OF_VLAN_PRIORITIES];
87 };
88 
89 
90 /*
91  * QM per global RL init parameters
92  */
93 struct init_qm_global_rl_params {
94 /* Rate limit in Mb/sec units. If set to zero, the link speed is uwsed
95  * instead.
96  */
97 	u32 rate_limit;
98 };
99 
100 
101 /*
102  * QM per port init parameters
103  */
104 struct init_qm_port_params {
105 	u8 active /* Indicates if this port is active */;
106 /* Vector of valid bits for active TCs used by this port */
107 	u8 active_phys_tcs;
108 /* number of PBF command lines that can be used by this port */
109 	u16 num_pbf_cmd_lines;
110 /* number of BTB blocks that can be used by this port */
111 	u16 num_btb_blocks;
112 	u16 reserved;
113 };
114 
115 
116 /*
117  * QM per-PQ init parameters
118  */
119 struct init_qm_pq_params {
120 	u8 vport_id /* VPORT ID */;
121 	u8 tc_id /* TC ID */;
122 	u8 wrr_group /* WRR group */;
123 /* Indicates if a rate limiter should be allocated for the PQ (0/1) */
124 	u8 rl_valid;
125 	u16 rl_id /* RL ID, valid only if rl_valid is true */;
126 	u8 port_id /* Port ID */;
127 	u8 reserved;
128 };
129 
130 
131 /*
132  * QM per VPORT init parameters
133  */
134 struct init_qm_vport_params {
135 /* WFQ weight. A value of 0 means dont configure. ignored if VPORT WFQ is
136  * globally disabled.
137  */
138 	u16 wfq;
139 /* the first Tx PQ ID associated with this VPORT for each TC. */
140 	u16 first_tx_pq_id[NUM_OF_TCS];
141 };
142 
143 #endif /* __ECORE_HSI_INIT_FUNC__ */
144