2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
9 #ifndef __ECORE_HSI_INIT_FUNC__
10 #define __ECORE_HSI_INIT_FUNC__
11 /********************************/
12 /* HSI Init Functions constants */
13 /********************************/
15 /* Number of VLAN priorities */
16 #define NUM_OF_VLAN_PRIORITIES 8
18 /* Size of CRC8 lookup table */
20 #define CRC8_TABLE_SIZE 256
24 * BRB RAM init requirements
26 struct init_brb_ram_req {
27 __le32 guranteed_per_tc /* guaranteed size per TC, in bytes */;
28 __le32 headroom_per_tc /* headroom size per TC, in bytes */;
29 __le32 min_pkt_size /* min packet size, in bytes */;
30 __le32 max_ports_per_engine /* min packet size, in bytes */;
31 u8 num_active_tcs[MAX_NUM_PORTS] /* number of active TCs per port */;
36 * ETS per-TC init requirements
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)
43 /* if set, this TC participates in the arbitration with a WFQ weight
44 * (indicated by the weight field)
47 /* An arbitration weight. Valid only if use_wfq is set. */
52 * ETS init requirements
55 __le32 mtu /* Max packet size (in bytes) */;
56 /* ETS initialization requirements per TC. */
57 struct init_ets_tc_req tc_req[NUM_OF_TCS];
63 * NIG LB RL init requirements
65 struct init_nig_lb_rl_req {
66 /* Global MAC+LB RL rate (in Mbps). If set to 0, the RL will be disabled. */
68 /* Global LB RL rate (in Mbps). If set to 0, the RL will be disabled. */
70 __le32 mtu /* Max packet size (in bytes) */;
71 /* RL rate per physical TC (in Mbps). If set to 0, the RL will be disabled. */
72 __le16 tc_rate[NUM_OF_PHYS_TCS];
77 * NIG TC mapping for each priority
79 struct init_nig_pri_tc_map_entry {
80 u8 tc_id /* the mapped TC ID */;
81 u8 valid /* indicates if the mapping entry is valid */;
86 * NIG priority to TC map init requirements
88 struct init_nig_pri_tc_map_req {
89 struct init_nig_pri_tc_map_entry pri[NUM_OF_VLAN_PRIORITIES];
94 * QM per-port init parameters
96 struct init_qm_port_params {
97 u8 active /* Indicates if this port is active */;
98 /* Vector of valid bits for active TCs used by this port */
100 /* number of PBF command lines that can be used by this port */
101 __le16 num_pbf_cmd_lines;
102 /* number of BTB blocks that can be used by this port */
103 __le16 num_btb_blocks;
109 * QM per-PQ init parameters
111 struct init_qm_pq_params {
112 u8 vport_id /* VPORT ID */;
113 u8 tc_id /* TC ID */;
114 u8 wrr_group /* WRR group */;
115 /* Indicates if a rate limiter should be allocated for the PQ (0/1) */
121 * QM per-vport init parameters
123 struct init_qm_vport_params {
124 /* rate limit in Mb/sec units. a value of 0 means dont configure. ignored if
125 * VPORT RL is globally disabled.
128 /* WFQ weight. A value of 0 means dont configure. ignored if VPORT WFQ is
132 /* the first Tx PQ ID associated with this VPORT for each TC. */
133 __le16 first_tx_pq_id[NUM_OF_TCS];
136 #endif /* __ECORE_HSI_INIT_FUNC__ */