i40e_pf_set_source_prune * @pf: pointer to the pf structure * @on: Enable/disable source prune * * set source prune on pf */
| 5636 | * set source prune on pf |
| 5637 | */ |
| 5638 | int |
| 5639 | i40e_pf_set_source_prune(struct i40e_pf *pf, int on) |
| 5640 | { |
| 5641 | struct i40e_hw *hw = I40E_PF_TO_HW(pf); |
| 5642 | struct i40e_vsi_context ctxt; |
| 5643 | int ret; |
| 5644 | |
| 5645 | memset(&ctxt, 0, sizeof(ctxt)); |
| 5646 | ctxt.seid = pf->main_vsi_seid; |
| 5647 | ctxt.pf_num = hw->pf_id; |
| 5648 | ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); |
| 5649 | if (ret) { |
| 5650 | PMD_DRV_LOG(ERR, "cannot get pf vsi config, err %d, aq_err %d", |
| 5651 | ret, hw->aq.asq_last_status); |
| 5652 | return ret; |
| 5653 | } |
| 5654 | ctxt.flags = I40E_AQ_VSI_TYPE_PF; |
| 5655 | ctxt.info.valid_sections = |
| 5656 | rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); |
| 5657 | if (on) |
| 5658 | ctxt.info.switch_id &= |
| 5659 | ~rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB); |
| 5660 | else |
| 5661 | ctxt.info.switch_id |= |
| 5662 | rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB); |
| 5663 | |
| 5664 | ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); |
| 5665 | if (ret) |
| 5666 | PMD_DRV_LOG(ERR, "update vsi switch failed, aq_err=%d", |
| 5667 | hw->aq.asq_last_status); |
| 5668 | |
| 5669 | return ret; |
| 5670 | } |
| 5671 | |
| 5672 | /* Setup a VSI */ |
| 5673 | struct i40e_vsi * |
no test coverage detected