Allocate and initialize various fields in bnxt struct that * need to be allocated/destroyed only once in the lifetime of the driver */
| 5878 | * need to be allocated/destroyed only once in the lifetime of the driver |
| 5879 | */ |
| 5880 | static 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); |
no test coverage detected