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