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

Function bnxt_drv_init

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

Allocate and initialize various fields in bnxt struct that * need to be allocated/destroyed only once in the lifetime of the driver */

Source from the content-addressed store, hash-verified

5878 * need to be allocated/destroyed only once in the lifetime of the driver
5879 */
5880static int bnxt_drv_init(struct rte_eth_dev *eth_dev)
5881{
5882 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
5883 struct bnxt *bp = eth_dev->data->dev_private;
5884 int rc = 0;
5885
5886 bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE;
5887
5888 if (bnxt_vf_pciid(pci_dev->id.device_id))
5889 bp->flags |= BNXT_FLAG_VF;
5890
5891 if (bnxt_p5_device(pci_dev->id.device_id))
5892 bp->flags |= BNXT_FLAG_CHIP_P5;
5893
5894 if (pci_dev->id.device_id == BROADCOM_DEV_ID_58802 ||
5895 pci_dev->id.device_id == BROADCOM_DEV_ID_58804 ||
5896 pci_dev->id.device_id == BROADCOM_DEV_ID_58808 ||
5897 pci_dev->id.device_id == BROADCOM_DEV_ID_58802_VF)
5898 bp->flags |= BNXT_FLAG_STINGRAY;
5899
5900 rc = bnxt_map_pci_bars(eth_dev);
5901 if (rc) {
5902 PMD_DRV_LOG(ERR,
5903 "Failed to initialize board rc: %x\n", rc);
5904 return rc;
5905 }
5906
5907 rc = bnxt_alloc_pf_info(bp);
5908 if (rc)
5909 return rc;
5910
5911 rc = bnxt_alloc_link_info(bp);
5912 if (rc)
5913 return rc;
5914
5915 rc = bnxt_alloc_parent_info(bp);
5916 if (rc)
5917 return rc;
5918
5919 rc = bnxt_alloc_hwrm_resources(bp);
5920 if (rc) {
5921 PMD_DRV_LOG(ERR,
5922 "Failed to allocate response buffer rc: %x\n", rc);
5923 return rc;
5924 }
5925 rc = bnxt_alloc_leds_info(bp);
5926 if (rc)
5927 return rc;
5928
5929 rc = bnxt_alloc_cos_queues(bp);
5930 if (rc)
5931 return rc;
5932
5933 rc = bnxt_init_locks(bp);
5934 if (rc)
5935 return rc;
5936
5937 rc = bnxt_get_config(bp);

Callers 1

bnxt_dev_initFunction · 0.85

Calls 12

bnxt_vf_pciidFunction · 0.85
bnxt_p5_deviceFunction · 0.85
bnxt_map_pci_barsFunction · 0.85
bnxt_alloc_pf_infoFunction · 0.85
bnxt_alloc_link_infoFunction · 0.85
bnxt_alloc_parent_infoFunction · 0.85
bnxt_alloc_leds_infoFunction · 0.85
bnxt_alloc_cos_queuesFunction · 0.85
bnxt_init_locksFunction · 0.85
bnxt_get_configFunction · 0.85

Tested by

no test coverage detected