MCPcopy Index your code
hub / github.com/F-Stack/f-stack / eth_ark_dev_init

Function eth_ark_dev_init

dpdk/drivers/net/ark/ark_ethdev.c:290–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static int
291eth_ark_dev_init(struct rte_eth_dev *dev)
292{
293 struct ark_adapter *ark = dev->data->dev_private;
294 struct rte_pci_device *pci_dev;
295 int ret;
296 int port_count = 1;
297 int p;
298 uint16_t num_queues;
299
300 ark->eth_dev = dev;
301
302 ARK_PMD_LOG(DEBUG, "\n");
303
304 /* Check to see if there is an extension that we need to load */
305 ret = check_for_ext(ark);
306 if (ret)
307 return ret;
308
309 pci_dev = RTE_ETH_DEV_TO_PCI(dev);
310 rte_eth_copy_pci_info(dev, pci_dev);
311 dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
312
313 p = 0;
314 while (ark_device_caps[p].device_id != 0) {
315 if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
316 ark->isvf = ark_device_caps[p].caps.isvf;
317 break;
318 }
319 p++;
320 }
321
322 /* Use dummy function until setup */
323 dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
324 dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
325
326 ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
327 ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
328
329 ark->sysctrl.v = (void *)&ark->bar0[ARK_SYSCTRL_BASE];
330 ark->mpurx.v = (void *)&ark->bar0[ARK_MPU_RX_BASE];
331 ark->udm.v = (void *)&ark->bar0[ARK_UDM_BASE];
332 ark->mputx.v = (void *)&ark->bar0[ARK_MPU_TX_BASE];
333 ark->ddm.v = (void *)&ark->bar0[ARK_DDM_BASE];
334 ark->cmac.v = (void *)&ark->bar0[ARK_CMAC_BASE];
335 ark->external.v = (void *)&ark->bar0[ARK_EXTERNAL_BASE];
336 ark->pktdir.v = (void *)&ark->bar0[ARK_PKTDIR_BASE];
337 ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE];
338 ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE];
339
340 ark->started = 0;
341 ark->pkt_dir_v = ARK_PKT_DIR_INIT_VAL;
342
343 ARK_PMD_LOG(INFO, "Sys Ctrl Const = 0x%x HW Commit_ID: %08x\n",
344 ark->sysctrl.t32[4],
345 rte_be_to_cpu_32(ark->sysctrl.t32[0x20 / 4]));
346 ARK_PMD_LOG(NOTICE, "Arkville HW Commit_ID: %08x\n",
347 rte_be_to_cpu_32(ark->sysctrl.t32[0x20 / 4]));

Callers 1

eth_ark_pci_probeFunction · 0.85

Calls 14

check_for_extFunction · 0.85
rte_eth_copy_pci_infoFunction · 0.85
ark_config_deviceFunction · 0.85
rte_zmallocFunction · 0.85
memsetFunction · 0.85
eth_ark_check_argsFunction · 0.85
snprintfFunction · 0.85
rte_eth_dev_allocateFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rte_socket_idFunction · 0.85

Tested by

no test coverage detected