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

Function ice_dev_init

dpdk/drivers/net/ice/ice_ethdev.c:2274–2490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2272}
2273
2274static int
2275ice_dev_init(struct rte_eth_dev *dev)
2276{
2277 struct rte_pci_device *pci_dev;
2278 struct rte_intr_handle *intr_handle;
2279 struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2280 struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
2281 struct ice_adapter *ad =
2282 ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2283 struct ice_vsi *vsi;
2284 int ret;
2285#ifndef RTE_EXEC_ENV_WINDOWS
2286 off_t pos;
2287 uint32_t dsn_low, dsn_high;
2288 uint64_t dsn;
2289 bool use_dsn;
2290#endif
2291
2292 dev->dev_ops = &ice_eth_dev_ops;
2293 dev->rx_queue_count = ice_rx_queue_count;
2294 dev->rx_descriptor_status = ice_rx_descriptor_status;
2295 dev->tx_descriptor_status = ice_tx_descriptor_status;
2296 dev->rx_pkt_burst = ice_recv_pkts;
2297 dev->tx_pkt_burst = ice_xmit_pkts;
2298 dev->tx_pkt_prepare = ice_prep_pkts;
2299
2300 /* for secondary processes, we don't initialise any further as primary
2301 * has already done this work.
2302 */
2303 if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
2304 ice_set_rx_function(dev);
2305 ice_set_tx_function(dev);
2306 return 0;
2307 }
2308
2309 dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
2310
2311 ice_set_default_ptype_table(dev);
2312 pci_dev = RTE_DEV_TO_PCI(dev->device);
2313 intr_handle = pci_dev->intr_handle;
2314
2315 pf->adapter = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2316 pf->dev_data = dev->data;
2317 hw->back = pf->adapter;
2318 hw->hw_addr = (uint8_t *)pci_dev->mem_resource[0].addr;
2319 hw->vendor_id = pci_dev->id.vendor_id;
2320 hw->device_id = pci_dev->id.device_id;
2321 hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
2322 hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
2323 hw->bus.device = pci_dev->addr.devid;
2324 hw->bus.func = pci_dev->addr.function;
2325
2326 ret = ice_parse_devargs(dev);
2327 if (ret) {
2328 PMD_INIT_LOG(ERR, "Failed to parse devargs");
2329 return -EINVAL;
2330 }
2331

Callers 1

ice_dev_resetFunction · 0.85

Calls 15

rte_eal_process_typeFunction · 0.85
ice_set_rx_functionFunction · 0.85
ice_set_tx_functionFunction · 0.85
ice_parse_devargsFunction · 0.85
ice_init_hwFunction · 0.85
ice_load_pkgFunction · 0.85
ice_init_hw_tblsFunction · 0.85
rte_freeFunction · 0.85
ice_pf_sw_initFunction · 0.85

Tested by

no test coverage detected