MCPcopy Create free account
hub / github.com/F-Stack/f-stack / i40e_pf_set_source_prune

Function i40e_pf_set_source_prune

dpdk/drivers/net/i40e/i40e_ethdev.c:5638–5670  ·  view source on GitHub ↗

i40e_pf_set_source_prune * @pf: pointer to the pf structure * @on: Enable/disable source prune * * set source prune on pf */

Source from the content-addressed store, hash-verified

5636 * set source prune on pf
5637 */
5638int
5639i40e_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 */
5673struct i40e_vsi *

Callers 2

i40e_vsi_setupFunction · 0.85

Calls 3

memsetFunction · 0.85
i40e_aq_get_vsi_paramsFunction · 0.85

Tested by

no test coverage detected