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

Function bnxt_init_resources

dpdk/drivers/net/bnxt/bnxt_ethdev.c:5381–5459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5379}
5380
5381static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)
5382{
5383 int rc = 0;
5384
5385 if (reconfig_dev) {
5386 rc = bnxt_get_config(bp);
5387 if (rc)
5388 return rc;
5389 }
5390
5391 rc = bnxt_alloc_switch_domain(bp);
5392 if (rc)
5393 return rc;
5394
5395 if (!reconfig_dev) {
5396 rc = bnxt_setup_mac_addr(bp->eth_dev);
5397 if (rc)
5398 return rc;
5399 } else {
5400 rc = bnxt_restore_dflt_mac(bp);
5401 if (rc)
5402 return rc;
5403 }
5404
5405 bnxt_config_vf_req_fwd(bp);
5406
5407 rc = bnxt_hwrm_func_driver_register(bp);
5408 if (rc) {
5409 PMD_DRV_LOG(ERR, "Failed to register driver");
5410 return -EBUSY;
5411 }
5412
5413 if (BNXT_PF(bp)) {
5414 if (bp->pdev->max_vfs) {
5415 rc = bnxt_hwrm_allocate_vfs(bp, bp->pdev->max_vfs);
5416 if (rc) {
5417 PMD_DRV_LOG(ERR, "Failed to allocate VFs\n");
5418 return rc;
5419 }
5420 } else {
5421 rc = bnxt_hwrm_allocate_pf_only(bp);
5422 if (rc) {
5423 PMD_DRV_LOG(ERR,
5424 "Failed to allocate PF resources");
5425 return rc;
5426 }
5427 }
5428 }
5429
5430 if (!reconfig_dev) {
5431 bp->rss_conf.rss_key = rte_zmalloc("bnxt_rss_key",
5432 HW_HASH_KEY_SIZE, 0);
5433 if (bp->rss_conf.rss_key == NULL) {
5434 PMD_DRV_LOG(ERR, "port %u cannot allocate RSS hash key memory",
5435 bp->eth_dev->data->port_id);
5436 return -ENOMEM;
5437 }
5438 }

Callers 3

bnxt_dev_recoverFunction · 0.85
bnxt_dev_initFunction · 0.85

Calls 13

bnxt_get_configFunction · 0.85
bnxt_alloc_switch_domainFunction · 0.85
bnxt_setup_mac_addrFunction · 0.85
bnxt_restore_dflt_macFunction · 0.85
bnxt_config_vf_req_fwdFunction · 0.85
bnxt_hwrm_allocate_vfsFunction · 0.85
rte_zmallocFunction · 0.85
bnxt_alloc_memFunction · 0.85
bnxt_setup_intFunction · 0.85
bnxt_request_intFunction · 0.85

Tested by

no test coverage detected