i40e_enable_pf_lb * @pf: pointer to the pf structure * * allow loopback on pf */
| 5596 | * allow loopback on pf |
| 5597 | */ |
| 5598 | static inline void |
| 5599 | i40e_enable_pf_lb(struct i40e_pf *pf) |
| 5600 | { |
| 5601 | struct i40e_hw *hw = I40E_PF_TO_HW(pf); |
| 5602 | struct i40e_vsi_context ctxt; |
| 5603 | int ret; |
| 5604 | |
| 5605 | /* Use the FW API if FW >= v5.0 */ |
| 5606 | if (hw->aq.fw_maj_ver < 5 && hw->mac.type != I40E_MAC_X722) { |
| 5607 | PMD_INIT_LOG(ERR, "FW < v5.0, cannot enable loopback"); |
| 5608 | return; |
| 5609 | } |
| 5610 | |
| 5611 | memset(&ctxt, 0, sizeof(ctxt)); |
| 5612 | ctxt.seid = pf->main_vsi_seid; |
| 5613 | ctxt.pf_num = hw->pf_id; |
| 5614 | ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); |
| 5615 | if (ret) { |
| 5616 | PMD_DRV_LOG(ERR, "cannot get pf vsi config, err %d, aq_err %d", |
| 5617 | ret, hw->aq.asq_last_status); |
| 5618 | return; |
| 5619 | } |
| 5620 | ctxt.flags = I40E_AQ_VSI_TYPE_PF; |
| 5621 | ctxt.info.valid_sections = |
| 5622 | rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); |
| 5623 | ctxt.info.switch_id |= |
| 5624 | rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); |
| 5625 | |
| 5626 | ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); |
| 5627 | if (ret) |
| 5628 | PMD_DRV_LOG(ERR, "update vsi switch failed, aq_err=%d", |
| 5629 | hw->aq.asq_last_status); |
| 5630 | } |
| 5631 | |
| 5632 | /* i40e_pf_set_source_prune |
| 5633 | * @pf: pointer to the pf structure |
no test coverage detected