2 * Copyright (c) 2017-2018 Cavium, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
29 * File : ecore_sp_commands.c
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
37 #include "ecore_status.h"
38 #include "ecore_chain.h"
39 #include "ecore_spq.h"
40 #include "ecore_init_fw_funcs.h"
41 #include "ecore_cxt.h"
42 #include "ecore_sp_commands.h"
43 #include "ecore_gtt_reg_addr.h"
44 #include "ecore_iro.h"
46 #include "ecore_int.h"
48 #include "ecore_dcbx.h"
49 #include "ecore_sriov.h"
52 enum _ecore_status_t ecore_sp_init_request(struct ecore_hwfn *p_hwfn,
53 struct ecore_spq_entry **pp_ent,
56 struct ecore_sp_init_data *p_data)
58 u32 opaque_cid = p_data->opaque_fid << 16 | p_data->cid;
59 struct ecore_spq_entry *p_ent = OSAL_NULL;
60 enum _ecore_status_t rc;
65 /* Get an SPQ entry */
66 rc = ecore_spq_get_entry(p_hwfn, pp_ent);
67 if (rc != ECORE_SUCCESS)
70 /* Fill the SPQ entry */
72 p_ent->elem.hdr.cid = OSAL_CPU_TO_LE32(opaque_cid);
73 p_ent->elem.hdr.cmd_id = cmd;
74 p_ent->elem.hdr.protocol_id = protocol;
75 p_ent->priority = ECORE_SPQ_PRIORITY_NORMAL;
76 p_ent->comp_mode = p_data->comp_mode;
77 p_ent->comp_done.done = 0;
79 switch (p_ent->comp_mode) {
80 case ECORE_SPQ_MODE_EBLOCK:
81 p_ent->comp_cb.cookie = &p_ent->comp_done;
84 case ECORE_SPQ_MODE_BLOCK:
85 if (!p_data->p_comp_data)
88 p_ent->comp_cb.cookie = p_data->p_comp_data->cookie;
91 case ECORE_SPQ_MODE_CB:
92 if (!p_data->p_comp_data)
93 p_ent->comp_cb.function = OSAL_NULL;
95 p_ent->comp_cb = *p_data->p_comp_data;
99 DP_NOTICE(p_hwfn, true, "Unknown SPQE completion mode %d\n",
104 DP_VERBOSE(p_hwfn, ECORE_MSG_SPQ,
105 "Initialized: CID %08x cmd %02x protocol %02x data_addr %lu comp_mode [%s]\n",
106 opaque_cid, cmd, protocol,
107 (unsigned long)&p_ent->ramrod,
108 D_TRINE(p_ent->comp_mode, ECORE_SPQ_MODE_EBLOCK,
109 ECORE_SPQ_MODE_BLOCK, "MODE_EBLOCK", "MODE_BLOCK",
112 OSAL_MEMSET(&p_ent->ramrod, 0, sizeof(p_ent->ramrod));
114 return ECORE_SUCCESS;
117 static enum tunnel_clss ecore_tunn_clss_to_fw_clss(u8 type)
120 case ECORE_TUNN_CLSS_MAC_VLAN:
121 return TUNNEL_CLSS_MAC_VLAN;
122 case ECORE_TUNN_CLSS_MAC_VNI:
123 return TUNNEL_CLSS_MAC_VNI;
124 case ECORE_TUNN_CLSS_INNER_MAC_VLAN:
125 return TUNNEL_CLSS_INNER_MAC_VLAN;
126 case ECORE_TUNN_CLSS_INNER_MAC_VNI:
127 return TUNNEL_CLSS_INNER_MAC_VNI;
128 case ECORE_TUNN_CLSS_MAC_VLAN_DUAL_STAGE:
129 return TUNNEL_CLSS_MAC_VLAN_DUAL_STAGE;
131 return TUNNEL_CLSS_MAC_VLAN;
136 ecore_set_pf_update_tunn_mode(struct ecore_tunnel_info *p_tun,
137 struct ecore_tunnel_info *p_src,
140 if (p_src->vxlan.b_update_mode || b_pf_start)
141 p_tun->vxlan.b_mode_enabled = p_src->vxlan.b_mode_enabled;
143 if (p_src->l2_gre.b_update_mode || b_pf_start)
144 p_tun->l2_gre.b_mode_enabled = p_src->l2_gre.b_mode_enabled;
146 if (p_src->ip_gre.b_update_mode || b_pf_start)
147 p_tun->ip_gre.b_mode_enabled = p_src->ip_gre.b_mode_enabled;
149 if (p_src->l2_geneve.b_update_mode || b_pf_start)
150 p_tun->l2_geneve.b_mode_enabled =
151 p_src->l2_geneve.b_mode_enabled;
153 if (p_src->ip_geneve.b_update_mode || b_pf_start)
154 p_tun->ip_geneve.b_mode_enabled =
155 p_src->ip_geneve.b_mode_enabled;
158 static void ecore_set_tunn_cls_info(struct ecore_tunnel_info *p_tun,
159 struct ecore_tunnel_info *p_src)
161 enum tunnel_clss type;
163 p_tun->b_update_rx_cls = p_src->b_update_rx_cls;
164 p_tun->b_update_tx_cls = p_src->b_update_tx_cls;
166 type = ecore_tunn_clss_to_fw_clss(p_src->vxlan.tun_cls);
167 p_tun->vxlan.tun_cls = (enum ecore_tunn_clss)type;
168 type = ecore_tunn_clss_to_fw_clss(p_src->l2_gre.tun_cls);
169 p_tun->l2_gre.tun_cls = (enum ecore_tunn_clss)type;
170 type = ecore_tunn_clss_to_fw_clss(p_src->ip_gre.tun_cls);
171 p_tun->ip_gre.tun_cls = (enum ecore_tunn_clss)type;
172 type = ecore_tunn_clss_to_fw_clss(p_src->l2_geneve.tun_cls);
173 p_tun->l2_geneve.tun_cls = (enum ecore_tunn_clss)type;
174 type = ecore_tunn_clss_to_fw_clss(p_src->ip_geneve.tun_cls);
175 p_tun->ip_geneve.tun_cls = (enum ecore_tunn_clss)type;
178 static void ecore_set_tunn_ports(struct ecore_tunnel_info *p_tun,
179 struct ecore_tunnel_info *p_src)
181 p_tun->geneve_port.b_update_port = p_src->geneve_port.b_update_port;
182 p_tun->vxlan_port.b_update_port = p_src->vxlan_port.b_update_port;
184 if (p_src->geneve_port.b_update_port)
185 p_tun->geneve_port.port = p_src->geneve_port.port;
187 if (p_src->vxlan_port.b_update_port)
188 p_tun->vxlan_port.port = p_src->vxlan_port.port;
192 __ecore_set_ramrod_tunnel_param(u8 *p_tunn_cls,
193 struct ecore_tunn_update_type *tun_type)
195 *p_tunn_cls = tun_type->tun_cls;
199 ecore_set_ramrod_tunnel_param(u8 *p_tunn_cls,
200 struct ecore_tunn_update_type *tun_type,
201 u8 *p_update_port, __le16 *p_port,
202 struct ecore_tunn_update_udp_port *p_udp_port)
204 __ecore_set_ramrod_tunnel_param(p_tunn_cls, tun_type);
205 if (p_udp_port->b_update_port) {
207 *p_port = OSAL_CPU_TO_LE16(p_udp_port->port);
212 ecore_tunn_set_pf_update_params(struct ecore_hwfn *p_hwfn,
213 struct ecore_tunnel_info *p_src,
214 struct pf_update_tunnel_config *p_tunn_cfg)
216 struct ecore_tunnel_info *p_tun = &p_hwfn->p_dev->tunnel;
218 ecore_set_pf_update_tunn_mode(p_tun, p_src, false);
219 ecore_set_tunn_cls_info(p_tun, p_src);
220 ecore_set_tunn_ports(p_tun, p_src);
222 ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_vxlan,
224 &p_tunn_cfg->set_vxlan_udp_port_flg,
225 &p_tunn_cfg->vxlan_udp_port,
228 ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_l2geneve,
230 &p_tunn_cfg->set_geneve_udp_port_flg,
231 &p_tunn_cfg->geneve_udp_port,
232 &p_tun->geneve_port);
234 __ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_ipgeneve,
237 __ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_l2gre,
240 __ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_ipgre,
243 p_tunn_cfg->update_rx_pf_clss = p_tun->b_update_rx_cls;
246 static void ecore_set_hw_tunn_mode(struct ecore_hwfn *p_hwfn,
247 struct ecore_ptt *p_ptt,
248 struct ecore_tunnel_info *p_tun)
250 ecore_set_gre_enable(p_hwfn, p_ptt, p_tun->l2_gre.b_mode_enabled,
251 p_tun->ip_gre.b_mode_enabled);
252 ecore_set_vxlan_enable(p_hwfn, p_ptt, p_tun->vxlan.b_mode_enabled);
254 ecore_set_geneve_enable(p_hwfn, p_ptt, p_tun->l2_geneve.b_mode_enabled,
255 p_tun->ip_geneve.b_mode_enabled);
258 static void ecore_set_hw_tunn_mode_port(struct ecore_hwfn *p_hwfn,
259 struct ecore_ptt *p_ptt,
260 struct ecore_tunnel_info *p_tunn)
262 if (ECORE_IS_BB_A0(p_hwfn->p_dev)) {
263 DP_NOTICE(p_hwfn, true,
264 "A0 chip: tunnel hw config is not supported\n");
268 if (p_tunn->vxlan_port.b_update_port)
269 ecore_set_vxlan_dest_port(p_hwfn, p_ptt,
270 p_tunn->vxlan_port.port);
272 if (p_tunn->geneve_port.b_update_port)
273 ecore_set_geneve_dest_port(p_hwfn, p_ptt,
274 p_tunn->geneve_port.port);
276 ecore_set_hw_tunn_mode(p_hwfn, p_ptt, p_tunn);
280 ecore_tunn_set_pf_start_params(struct ecore_hwfn *p_hwfn,
281 struct ecore_tunnel_info *p_src,
282 struct pf_start_tunnel_config *p_tunn_cfg)
284 struct ecore_tunnel_info *p_tun = &p_hwfn->p_dev->tunnel;
286 if (ECORE_IS_BB_A0(p_hwfn->p_dev)) {
287 DP_NOTICE(p_hwfn, true,
288 "A0 chip: tunnel pf start config is not supported\n");
295 ecore_set_pf_update_tunn_mode(p_tun, p_src, true);
296 ecore_set_tunn_cls_info(p_tun, p_src);
297 ecore_set_tunn_ports(p_tun, p_src);
299 ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_vxlan,
301 &p_tunn_cfg->set_vxlan_udp_port_flg,
302 &p_tunn_cfg->vxlan_udp_port,
305 ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_l2geneve,
307 &p_tunn_cfg->set_geneve_udp_port_flg,
308 &p_tunn_cfg->geneve_udp_port,
309 &p_tun->geneve_port);
311 __ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_ipgeneve,
314 __ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_l2gre,
317 __ecore_set_ramrod_tunnel_param(&p_tunn_cfg->tunnel_clss_ipgre,
321 enum _ecore_status_t ecore_sp_pf_start(struct ecore_hwfn *p_hwfn,
322 struct ecore_ptt *p_ptt,
323 struct ecore_tunnel_info *p_tunn,
324 enum ecore_mf_mode mode,
325 bool allow_npar_tx_switch)
327 struct pf_start_ramrod_data *p_ramrod = OSAL_NULL;
328 u16 sb = ecore_int_get_sp_sb_id(p_hwfn);
329 u8 sb_index = p_hwfn->p_eq->eq_sb_index;
330 struct ecore_spq_entry *p_ent = OSAL_NULL;
331 struct ecore_sp_init_data init_data;
332 enum _ecore_status_t rc = ECORE_NOTIMPL;
335 /* update initial eq producer */
336 ecore_eq_prod_update(p_hwfn,
337 ecore_chain_get_prod_idx(&p_hwfn->p_eq->chain));
339 /* Initialize the SPQ entry for the ramrod */
340 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
341 init_data.cid = ecore_spq_get_cid(p_hwfn);
342 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
343 init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK;
345 rc = ecore_sp_init_request(p_hwfn, &p_ent,
346 COMMON_RAMROD_PF_START,
349 if (rc != ECORE_SUCCESS)
352 /* Fill the ramrod data */
353 p_ramrod = &p_ent->ramrod.pf_start;
354 p_ramrod->event_ring_sb_id = OSAL_CPU_TO_LE16(sb);
355 p_ramrod->event_ring_sb_index = sb_index;
356 p_ramrod->path_id = ECORE_PATH_ID(p_hwfn);
358 /* For easier debugging */
359 p_ramrod->dont_log_ramrods = 0;
360 p_ramrod->log_type_mask = OSAL_CPU_TO_LE16(0x8f);
363 case ECORE_MF_DEFAULT:
365 p_ramrod->mf_mode = MF_NPAR;
368 p_ramrod->mf_mode = MF_OVLAN;
371 DP_NOTICE(p_hwfn, true, "Unsupported MF mode, init as DEFAULT\n");
372 p_ramrod->mf_mode = MF_NPAR;
374 p_ramrod->outer_tag = p_hwfn->hw_info.ovlan;
376 /* Place EQ address in RAMROD */
377 DMA_REGPAIR_LE(p_ramrod->event_ring_pbl_addr,
378 p_hwfn->p_eq->chain.pbl_sp.p_phys_table);
379 page_cnt = (u8)ecore_chain_get_page_cnt(&p_hwfn->p_eq->chain);
380 p_ramrod->event_ring_num_pages = page_cnt;
381 DMA_REGPAIR_LE(p_ramrod->consolid_q_pbl_addr,
382 p_hwfn->p_consq->chain.pbl_sp.p_phys_table);
384 ecore_tunn_set_pf_start_params(p_hwfn, p_tunn,
385 &p_ramrod->tunnel_config);
387 if (IS_MF_SI(p_hwfn))
388 p_ramrod->allow_npar_tx_switching = allow_npar_tx_switch;
390 switch (p_hwfn->hw_info.personality) {
392 p_ramrod->personality = PERSONALITY_ETH;
395 p_ramrod->personality = PERSONALITY_FCOE;
397 case ECORE_PCI_ISCSI:
398 p_ramrod->personality = PERSONALITY_ISCSI;
400 case ECORE_PCI_ETH_IWARP:
401 case ECORE_PCI_ETH_ROCE:
402 case ECORE_PCI_ETH_RDMA:
403 p_ramrod->personality = PERSONALITY_RDMA_AND_ETH;
406 DP_NOTICE(p_hwfn, true, "Unknown personality %d\n",
407 p_hwfn->hw_info.personality);
408 p_ramrod->personality = PERSONALITY_ETH;
411 if (p_hwfn->p_dev->p_iov_info) {
412 struct ecore_hw_sriov_info *p_iov = p_hwfn->p_dev->p_iov_info;
414 p_ramrod->base_vf_id = (u8)p_iov->first_vf_in_pf;
415 p_ramrod->num_vfs = (u8)p_iov->total_vfs;
417 /* @@@TBD - update also the "ROCE_VER_KEY" entries when the FW RoCE HSI
418 * version is available.
420 p_ramrod->hsi_fp_ver.major_ver_arr[ETH_VER_KEY] = ETH_HSI_VER_MAJOR;
421 p_ramrod->hsi_fp_ver.minor_ver_arr[ETH_VER_KEY] = ETH_HSI_VER_MINOR;
423 DP_VERBOSE(p_hwfn, ECORE_MSG_SPQ,
424 "Setting event_ring_sb [id %04x index %02x], outer_tag [%d]\n",
425 sb, sb_index, p_ramrod->outer_tag);
427 rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
430 ecore_set_hw_tunn_mode_port(p_hwfn, p_ptt,
431 &p_hwfn->p_dev->tunnel);
436 enum _ecore_status_t ecore_sp_pf_update_dcbx(struct ecore_hwfn *p_hwfn)
438 struct ecore_spq_entry *p_ent = OSAL_NULL;
439 struct ecore_sp_init_data init_data;
440 enum _ecore_status_t rc = ECORE_NOTIMPL;
443 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
444 init_data.cid = ecore_spq_get_cid(p_hwfn);
445 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
446 init_data.comp_mode = ECORE_SPQ_MODE_CB;
448 rc = ecore_sp_init_request(p_hwfn, &p_ent,
449 COMMON_RAMROD_PF_UPDATE, PROTOCOLID_COMMON,
451 if (rc != ECORE_SUCCESS)
454 ecore_dcbx_set_pf_update_params(&p_hwfn->p_dcbx_info->results,
455 &p_ent->ramrod.pf_update);
457 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
460 enum _ecore_status_t ecore_sp_rl_update(struct ecore_hwfn *p_hwfn,
461 struct ecore_rl_update_params *params)
463 struct ecore_spq_entry *p_ent = OSAL_NULL;
464 enum _ecore_status_t rc = ECORE_NOTIMPL;
465 struct rl_update_ramrod_data *rl_update;
466 struct ecore_sp_init_data init_data;
469 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
470 init_data.cid = ecore_spq_get_cid(p_hwfn);
471 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
472 init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK;
474 rc = ecore_sp_init_request(p_hwfn, &p_ent,
475 COMMON_RAMROD_RL_UPDATE, PROTOCOLID_COMMON,
477 if (rc != ECORE_SUCCESS)
480 rl_update = &p_ent->ramrod.rl_update;
482 rl_update->qcn_update_param_flg = params->qcn_update_param_flg;
483 rl_update->dcqcn_update_param_flg = params->dcqcn_update_param_flg;
484 rl_update->rl_init_flg = params->rl_init_flg;
485 rl_update->rl_start_flg = params->rl_start_flg;
486 rl_update->rl_stop_flg = params->rl_stop_flg;
487 rl_update->rl_id_first = params->rl_id_first;
488 rl_update->rl_id_last = params->rl_id_last;
489 rl_update->rl_dc_qcn_flg = params->rl_dc_qcn_flg;
490 rl_update->rl_bc_rate = OSAL_CPU_TO_LE32(params->rl_bc_rate);
491 rl_update->rl_max_rate = OSAL_CPU_TO_LE16(params->rl_max_rate);
492 rl_update->rl_r_ai = OSAL_CPU_TO_LE16(params->rl_r_ai);
493 rl_update->rl_r_hai = OSAL_CPU_TO_LE16(params->rl_r_hai);
494 rl_update->dcqcn_g = OSAL_CPU_TO_LE16(params->dcqcn_g);
495 rl_update->dcqcn_k_us = OSAL_CPU_TO_LE32(params->dcqcn_k_us);
496 rl_update->dcqcn_timeuot_us = OSAL_CPU_TO_LE32(
497 params->dcqcn_timeuot_us);
498 rl_update->qcn_timeuot_us = OSAL_CPU_TO_LE32(params->qcn_timeuot_us);
500 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
503 /* Set pf update ramrod command params */
505 ecore_sp_pf_update_tunn_cfg(struct ecore_hwfn *p_hwfn,
506 struct ecore_ptt *p_ptt,
507 struct ecore_tunnel_info *p_tunn,
508 enum spq_mode comp_mode,
509 struct ecore_spq_comp_cb *p_comp_data)
511 struct ecore_spq_entry *p_ent = OSAL_NULL;
512 struct ecore_sp_init_data init_data;
513 enum _ecore_status_t rc = ECORE_NOTIMPL;
515 if (IS_VF(p_hwfn->p_dev))
516 return ecore_vf_pf_tunnel_param_update(p_hwfn, p_tunn);
518 if (ECORE_IS_BB_A0(p_hwfn->p_dev)) {
519 DP_NOTICE(p_hwfn, true,
520 "A0 chip: tunnel pf update config is not supported\n");
528 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
529 init_data.cid = ecore_spq_get_cid(p_hwfn);
530 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
531 init_data.comp_mode = comp_mode;
532 init_data.p_comp_data = p_comp_data;
534 rc = ecore_sp_init_request(p_hwfn, &p_ent,
535 COMMON_RAMROD_PF_UPDATE, PROTOCOLID_COMMON,
537 if (rc != ECORE_SUCCESS)
540 ecore_tunn_set_pf_update_params(p_hwfn, p_tunn,
541 &p_ent->ramrod.pf_update.tunnel_config);
543 rc = ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
544 if (rc != ECORE_SUCCESS)
547 ecore_set_hw_tunn_mode_port(p_hwfn, p_ptt, &p_hwfn->p_dev->tunnel);
552 enum _ecore_status_t ecore_sp_pf_stop(struct ecore_hwfn *p_hwfn)
554 struct ecore_spq_entry *p_ent = OSAL_NULL;
555 struct ecore_sp_init_data init_data;
556 enum _ecore_status_t rc = ECORE_NOTIMPL;
559 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
560 init_data.cid = ecore_spq_get_cid(p_hwfn);
561 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
562 init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK;
564 rc = ecore_sp_init_request(p_hwfn, &p_ent,
565 COMMON_RAMROD_PF_STOP, PROTOCOLID_COMMON,
567 if (rc != ECORE_SUCCESS)
570 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
573 enum _ecore_status_t ecore_sp_heartbeat_ramrod(struct ecore_hwfn *p_hwfn)
575 struct ecore_spq_entry *p_ent = OSAL_NULL;
576 struct ecore_sp_init_data init_data;
577 enum _ecore_status_t rc;
580 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
581 init_data.cid = ecore_spq_get_cid(p_hwfn);
582 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
583 init_data.comp_mode = ECORE_SPQ_MODE_EBLOCK;
585 rc = ecore_sp_init_request(p_hwfn, &p_ent,
586 COMMON_RAMROD_EMPTY, PROTOCOLID_COMMON,
588 if (rc != ECORE_SUCCESS)
591 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
594 enum _ecore_status_t ecore_sp_pf_update_stag(struct ecore_hwfn *p_hwfn)
596 struct ecore_spq_entry *p_ent = OSAL_NULL;
597 struct ecore_sp_init_data init_data;
598 enum _ecore_status_t rc = ECORE_NOTIMPL;
601 OSAL_MEMSET(&init_data, 0, sizeof(init_data));
602 init_data.cid = ecore_spq_get_cid(p_hwfn);
603 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid;
604 init_data.comp_mode = ECORE_SPQ_MODE_CB;
606 rc = ecore_sp_init_request(p_hwfn, &p_ent,
607 COMMON_RAMROD_PF_UPDATE, PROTOCOLID_COMMON,
609 if (rc != ECORE_SUCCESS)
612 p_ent->ramrod.pf_update.update_mf_vlan_flag = true;
613 p_ent->ramrod.pf_update.mf_vlan = OSAL_CPU_TO_LE16(p_hwfn->hw_info.ovlan);
615 return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);