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

Function i40e_vsi_setup

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

Setup a VSI */

Source from the content-addressed store, hash-verified

5671
5672/* Setup a VSI */
5673struct i40e_vsi *
5674i40e_vsi_setup(struct i40e_pf *pf,
5675 enum i40e_vsi_type type,
5676 struct i40e_vsi *uplink_vsi,
5677 uint16_t user_param)
5678{
5679 struct i40e_hw *hw = I40E_PF_TO_HW(pf);
5680 struct i40e_vsi *vsi;
5681 struct i40e_mac_filter_info filter;
5682 int ret;
5683 struct i40e_vsi_context ctxt;
5684 struct rte_ether_addr broadcast =
5685 {.addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
5686
5687 if (type != I40E_VSI_MAIN && type != I40E_VSI_SRIOV &&
5688 uplink_vsi == NULL) {
5689 PMD_DRV_LOG(ERR,
5690 "VSI setup failed, VSI link shouldn't be NULL");
5691 return NULL;
5692 }
5693
5694 if (type == I40E_VSI_MAIN && uplink_vsi != NULL) {
5695 PMD_DRV_LOG(ERR,
5696 "VSI setup failed, MAIN VSI uplink VSI should be NULL");
5697 return NULL;
5698 }
5699
5700 /* two situations
5701 * 1.type is not MAIN and uplink vsi is not NULL
5702 * If uplink vsi didn't setup VEB, create one first under veb field
5703 * 2.type is SRIOV and the uplink is NULL
5704 * If floating VEB is NULL, create one veb under floating veb field
5705 */
5706
5707 if (type != I40E_VSI_MAIN && uplink_vsi != NULL &&
5708 uplink_vsi->veb == NULL) {
5709 uplink_vsi->veb = i40e_veb_setup(pf, uplink_vsi);
5710
5711 if (uplink_vsi->veb == NULL) {
5712 PMD_DRV_LOG(ERR, "VEB setup failed");
5713 return NULL;
5714 }
5715 /* set ALLOWLOOPBACk on pf, when veb is created */
5716 i40e_enable_pf_lb(pf);
5717 }
5718
5719 if (type == I40E_VSI_SRIOV && uplink_vsi == NULL &&
5720 pf->main_vsi->floating_veb == NULL) {
5721 pf->main_vsi->floating_veb = i40e_veb_setup(pf, uplink_vsi);
5722
5723 if (pf->main_vsi->floating_veb == NULL) {
5724 PMD_DRV_LOG(ERR, "VEB setup failed");
5725 return NULL;
5726 }
5727 }
5728
5729 /* source prune is disabled to support VRRP in default*/
5730 i40e_pf_set_source_prune(pf, 0);

Callers 4

i40e_fdir_setupFunction · 0.85
i40e_pf_host_vf_resetFunction · 0.85
i40e_pf_setupFunction · 0.85
i40e_vmdq_setupFunction · 0.85

Calls 15

i40e_veb_setupFunction · 0.85
i40e_enable_pf_lbFunction · 0.85
i40e_pf_set_source_pruneFunction · 0.85
rte_zmallocFunction · 0.85
i40e_res_pool_allocFunction · 0.85
memsetFunction · 0.85
i40e_aq_get_vsi_paramsFunction · 0.85
i40e_config_qinqFunction · 0.85

Tested by

no test coverage detected