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

Function bnxt_dev_init

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

Source from the content-addressed store, hash-verified

5958}
5959
5960static int
5961bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
5962{
5963 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
5964 static int version_printed;
5965 struct bnxt *bp;
5966 int rc;
5967
5968 if (version_printed++ == 0)
5969 PMD_DRV_LOG(INFO, "%s\n", bnxt_version);
5970
5971 eth_dev->dev_ops = &bnxt_dev_ops;
5972 eth_dev->rx_queue_count = bnxt_rx_queue_count_op;
5973 eth_dev->rx_descriptor_status = bnxt_rx_descriptor_status_op;
5974 eth_dev->tx_descriptor_status = bnxt_tx_descriptor_status_op;
5975 eth_dev->rx_pkt_burst = &bnxt_recv_pkts;
5976 eth_dev->tx_pkt_burst = &bnxt_xmit_pkts;
5977
5978 /*
5979 * For secondary processes, we don't initialise any further
5980 * as primary has already done this work.
5981 */
5982 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
5983 return 0;
5984
5985 rte_eth_copy_pci_info(eth_dev, pci_dev);
5986 eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
5987 eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
5988
5989 bp = eth_dev->data->dev_private;
5990
5991 /* set the default app id */
5992 bp->app_id = bnxt_ulp_default_app_id_get();
5993
5994 /* Parse dev arguments passed on when starting the DPDK application. */
5995 rc = bnxt_parse_dev_args(bp, pci_dev->device.devargs);
5996 if (rc)
5997 goto error_free;
5998
5999 rc = bnxt_drv_init(eth_dev);
6000 if (rc)
6001 goto error_free;
6002
6003 rc = bnxt_init_resources(bp, false);
6004 if (rc)
6005 goto error_free;
6006
6007 rc = bnxt_alloc_stats_mem(bp);
6008 if (rc)
6009 goto error_free;
6010
6011 PMD_DRV_LOG(INFO,
6012 "Found %s device at mem %" PRIX64 ", node addr %pM\n",
6013 DRV_MODULE_NAME,
6014 pci_dev->mem_resource[0].phys_addr,
6015 pci_dev->mem_resource[0].addr);
6016
6017 return 0;

Callers

nothing calls this directly

Calls 8

rte_eal_process_typeFunction · 0.85
rte_eth_copy_pci_infoFunction · 0.85
bnxt_parse_dev_argsFunction · 0.85
bnxt_drv_initFunction · 0.85
bnxt_init_resourcesFunction · 0.85
bnxt_alloc_stats_memFunction · 0.85
bnxt_dev_uninitFunction · 0.85

Tested by

no test coverage detected