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.
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.
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]
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").
27 * You may not use this file except in compliance with the License.
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
36 #ifndef __ECORE_SP_COMMANDS_H__
37 #define __ECORE_SP_COMMANDS_H__
40 #include "ecore_spq.h"
41 #include "ecore_sp_api.h"
43 #define ECORE_SP_EQ_COMPLETION 0x01
44 #define ECORE_SP_CQE_COMPLETION 0x02
46 struct ecore_sp_init_data
{
47 /* The CID and FID aren't necessarily derived from hwfn,
48 * e.g., in IOV scenarios. CID might defer between SPQ and
54 /* Information regarding operation upon sending & completion */
55 enum spq_mode comp_mode
;
56 struct ecore_spq_comp_cb
*p_comp_data
;
61 * @brief Acquire and initialize and SPQ entry for a given ramrod.
64 * @param pp_ent - will be filled with a pointer to an entry upon success
65 * @param cmd - dependent upon protocol
67 * @param p_data - various configuration required for ramrod
69 * @return ECORE_SUCCESS upon success, otherwise failure.
71 enum _ecore_status_t
ecore_sp_init_request(struct ecore_hwfn
*p_hwfn
,
72 struct ecore_spq_entry
**pp_ent
,
75 struct ecore_sp_init_data
*p_data
);
78 * @brief ecore_sp_pf_start - PF Function Start Ramrod
80 * This ramrod is sent to initialize a physical function (PF). It will
81 * configure the function related parameters and write its completion to the
82 * event ring specified in the parameters.
84 * Ramrods complete on the common event ring for the PF. This ring is
85 * allocated by the driver on host memory and its parameters are written
86 * to the internal RAM of the UStorm by the Function Start Ramrod.
89 * @param p_tunn - pf start tunneling configuration
91 * @param allow_npar_tx_switch - npar tx switching to be used
92 * for vports configured for tx-switching.
94 * @return enum _ecore_status_t
97 enum _ecore_status_t
ecore_sp_pf_start(struct ecore_hwfn
*p_hwfn
,
98 struct ecore_tunnel_info
*p_tunn
,
99 enum ecore_mf_mode mode
,
100 bool allow_npar_tx_switch
);
103 * @brief ecore_sp_pf_update - PF Function Update Ramrod
105 * This ramrod updates function-related parameters. Every parameter can be
106 * updated independently, according to configuration flags.
108 * @note Final phase API.
112 * @return enum _ecore_status_t
115 enum _ecore_status_t
ecore_sp_pf_update_dcbx(struct ecore_hwfn
*p_hwfn
);
118 * @brief ecore_sp_pf_stop - PF Function Stop Ramrod
120 * This ramrod is sent to close a Physical Function (PF). It is the last ramrod
121 * sent and the last completion written to the PFs Event Ring. This ramrod also
122 * deletes the context for the Slowhwfn connection on this PF.
124 * @note Not required for first packet.
128 * @return enum _ecore_status_t
131 enum _ecore_status_t
ecore_sp_pf_stop(struct ecore_hwfn
*p_hwfn
);
134 * @brief ecore_sp_heartbeat_ramrod - Send empty Ramrod
138 * @return enum _ecore_status_t
141 enum _ecore_status_t
ecore_sp_heartbeat_ramrod(struct ecore_hwfn
*p_hwfn
);
143 struct ecore_rl_update_params
{
144 u8 qcn_update_param_flg
;
145 u8 dcqcn_update_param_flg
;
151 u8 rl_dc_qcn_flg
; /* If set, RL will used for DCQCN */
152 u32 rl_bc_rate
; /* Byte Counter Limit */
153 u16 rl_max_rate
; /* Maximum rate in 1.6 Mbps resolution */
154 u16 rl_r_ai
; /* Active increase rate */
155 u16 rl_r_hai
; /* Hyper active increase rate */
156 u16 dcqcn_g
; /* DCQCN Alpha update gain in 1/64K resolution */
157 u32 dcqcn_k_us
; /* DCQCN Alpha update interval */
158 u32 dcqcn_timeuot_us
;
163 * @brief ecore_sp_rl_update - Update rate limiters
168 * @return enum _ecore_status_t
170 enum _ecore_status_t
ecore_sp_rl_update(struct ecore_hwfn
*p_hwfn
,
171 struct ecore_rl_update_params
*params
);
174 * @brief ecore_sp_pf_update_stag - PF STAG value update Ramrod
178 * @return enum _ecore_status_t
181 enum _ecore_status_t
ecore_sp_pf_update_stag(struct ecore_hwfn
*p_hwfn
);
183 #endif /*__ECORE_SP_COMMANDS_H__*/