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

Function eth_atl_dev_init

dpdk/drivers/net/atlantic/atl_ethdev.c:357–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357static int
358eth_atl_dev_init(struct rte_eth_dev *eth_dev)
359{
360 struct atl_adapter *adapter = eth_dev->data->dev_private;
361 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
362 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
363 struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
364 int err = 0;
365
366 PMD_INIT_FUNC_TRACE();
367
368 eth_dev->dev_ops = &atl_eth_dev_ops;
369
370 eth_dev->rx_queue_count = atl_rx_queue_count;
371 eth_dev->rx_descriptor_status = atl_dev_rx_descriptor_status;
372 eth_dev->tx_descriptor_status = atl_dev_tx_descriptor_status;
373
374 eth_dev->rx_pkt_burst = &atl_recv_pkts;
375 eth_dev->tx_pkt_burst = &atl_xmit_pkts;
376 eth_dev->tx_pkt_prepare = &atl_prep_pkts;
377
378 /* For secondary processes, the primary process has done all the work */
379 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
380 return 0;
381
382 eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
383
384 /* Vendor and Device ID need to be set before init of shared code */
385 hw->device_id = pci_dev->id.device_id;
386 hw->vendor_id = pci_dev->id.vendor_id;
387 hw->mmio = (void *)pci_dev->mem_resource[0].addr;
388
389 /* Hardware configuration - hardcode */
390 adapter->hw_cfg.is_lro = false;
391 adapter->hw_cfg.wol = false;
392 adapter->hw_cfg.is_rss = false;
393 adapter->hw_cfg.num_rss_queues = HW_ATL_B0_RSS_MAX;
394
395 adapter->hw_cfg.link_speed_msk = AQ_NIC_RATE_10G |
396 AQ_NIC_RATE_5G |
397 AQ_NIC_RATE_2G5 |
398 AQ_NIC_RATE_1G |
399 AQ_NIC_RATE_100M;
400
401 adapter->hw_cfg.flow_control = (AQ_NIC_FC_RX | AQ_NIC_FC_TX);
402 adapter->hw_cfg.aq_rss.indirection_table_size =
403 HW_ATL_B0_RSS_REDIRECTION_MAX;
404
405 hw->aq_nic_cfg = &adapter->hw_cfg;
406
407 pthread_mutex_init(&hw->mbox_mutex, NULL);
408
409 /* disable interrupt */
410 atl_disable_intr(hw);
411
412 /* Allocate memory for storing MAC addresses */
413 eth_dev->data->mac_addrs = rte_zmalloc("atlantic",
414 RTE_ETHER_ADDR_LEN, 0);

Callers 1

atl_dev_resetFunction · 0.85

Calls 9

rte_eal_process_typeFunction · 0.85
pthread_mutex_initFunction · 0.85
atl_disable_intrFunction · 0.85
rte_zmallocFunction · 0.85
hw_atl_utils_initfwFunction · 0.85
atl_dev_stats_resetFunction · 0.85
atl_enable_intrFunction · 0.85
rte_intr_enableFunction · 0.50

Tested by

no test coverage detected