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

Function iavf_init_vf

dpdk/drivers/net/iavf/iavf_ethdev.c:2436–2555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2434}
2435
2436static int
2437iavf_init_vf(struct rte_eth_dev *dev)
2438{
2439 int err, bufsz;
2440 struct iavf_adapter *adapter =
2441 IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2442 struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2443 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
2444
2445 vf->eth_dev = dev;
2446
2447 err = iavf_parse_devargs(dev);
2448 if (err) {
2449 PMD_INIT_LOG(ERR, "Failed to parse devargs");
2450 goto err;
2451 }
2452
2453 err = iavf_set_mac_type(hw);
2454 if (err) {
2455 PMD_INIT_LOG(ERR, "set_mac_type failed: %d", err);
2456 goto err;
2457 }
2458
2459 err = iavf_check_vf_reset_done(hw);
2460 if (err) {
2461 PMD_INIT_LOG(ERR, "VF is still resetting");
2462 goto err;
2463 }
2464
2465 iavf_init_adminq_parameter(hw);
2466 err = iavf_init_adminq(hw);
2467 if (err) {
2468 PMD_INIT_LOG(ERR, "init_adminq failed: %d", err);
2469 goto err;
2470 }
2471
2472 vf->aq_resp = rte_zmalloc("vf_aq_resp", IAVF_AQ_BUF_SZ, 0);
2473 if (!vf->aq_resp) {
2474 PMD_INIT_LOG(ERR, "unable to allocate vf_aq_resp memory");
2475 goto err_aq;
2476 }
2477 if (iavf_check_api_version(adapter) != 0) {
2478 PMD_INIT_LOG(ERR, "check_api version failed");
2479 goto err_api;
2480 }
2481
2482 bufsz = sizeof(struct virtchnl_vf_resource) +
2483 (IAVF_MAX_VF_VSI * sizeof(struct virtchnl_vsi_resource));
2484 vf->vf_res = rte_zmalloc("vf_res", bufsz, 0);
2485 if (!vf->vf_res) {
2486 PMD_INIT_LOG(ERR, "unable to allocate vf_res memory");
2487 goto err_api;
2488 }
2489
2490 if (iavf_get_vf_resource(adapter) != 0) {
2491 PMD_INIT_LOG(ERR, "iavf_get_vf_config failed");
2492 goto err_alloc;
2493 }

Callers 1

iavf_dev_initFunction · 0.85

Calls 14

iavf_parse_devargsFunction · 0.85
iavf_set_mac_typeFunction · 0.85
iavf_check_vf_reset_doneFunction · 0.85
iavf_init_adminqFunction · 0.85
rte_zmallocFunction · 0.85
iavf_check_api_versionFunction · 0.85
iavf_get_vf_resourceFunction · 0.85
iavf_get_supported_rxdidFunction · 0.85
iavf_tm_conf_initFunction · 0.85
iavf_init_proto_xtrFunction · 0.85

Tested by

no test coverage detected