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

Function eth_txgbe_dev_init

dpdk/drivers/net/txgbe/txgbe_ethdev.c:548–813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548static int
549eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
550{
551 struct txgbe_adapter *ad = eth_dev->data->dev_private;
552 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
553 struct txgbe_hw *hw = TXGBE_DEV_HW(eth_dev);
554 struct txgbe_vfta *shadow_vfta = TXGBE_DEV_VFTA(eth_dev);
555 struct txgbe_hwstrip *hwstrip = TXGBE_DEV_HWSTRIP(eth_dev);
556 struct txgbe_dcb_config *dcb_config = TXGBE_DEV_DCB_CONFIG(eth_dev);
557 struct txgbe_filter_info *filter_info = TXGBE_DEV_FILTER(eth_dev);
558 struct txgbe_bw_conf *bw_conf = TXGBE_DEV_BW_CONF(eth_dev);
559 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
560 const struct rte_memzone *mz;
561 uint32_t ctrl_ext;
562 uint16_t csum;
563 int err, i, ret;
564
565 PMD_INIT_FUNC_TRACE();
566
567 eth_dev->dev_ops = &txgbe_eth_dev_ops;
568 eth_dev->rx_queue_count = txgbe_dev_rx_queue_count;
569 eth_dev->rx_descriptor_status = txgbe_dev_rx_descriptor_status;
570 eth_dev->tx_descriptor_status = txgbe_dev_tx_descriptor_status;
571 eth_dev->rx_pkt_burst = &txgbe_recv_pkts;
572 eth_dev->tx_pkt_burst = &txgbe_xmit_pkts;
573 eth_dev->tx_pkt_prepare = &txgbe_prep_pkts;
574
575 /*
576 * For secondary processes, we don't initialise any further as primary
577 * has already done this work. Only check we don't need a different
578 * RX and TX function.
579 */
580 if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
581 struct txgbe_tx_queue *txq;
582 /* TX queue function in primary, set by last queue initialized
583 * Tx queue may not initialized by primary process
584 */
585 if (eth_dev->data->tx_queues) {
586 uint16_t nb_tx_queues = eth_dev->data->nb_tx_queues;
587 txq = eth_dev->data->tx_queues[nb_tx_queues - 1];
588 txgbe_set_tx_function(eth_dev, txq);
589 } else {
590 /* Use default TX function if we get here */
591 PMD_INIT_LOG(NOTICE, "No TX queues configured yet. "
592 "Using default TX function.");
593 }
594
595 txgbe_set_rx_function(eth_dev);
596
597 return 0;
598 }
599
600 __atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
601 rte_eth_copy_pci_info(eth_dev, pci_dev);
602
603 hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
604
605 /* Vendor and Device ID need to be set before init of shared code */

Callers 1

txgbe_dev_resetFunction · 0.85

Calls 15

rte_eal_process_typeFunction · 0.85
txgbe_set_rx_functionFunction · 0.85
rte_eth_copy_pci_infoFunction · 0.85
txgbe_flash_read_dwordFunction · 0.85
rte_eth_dma_zone_reserveFunction · 0.85
txgbe_parse_devargsFunction · 0.85
txgbe_init_shared_codeFunction · 0.85
txgbe_swfw_lock_resetFunction · 0.85
txgbe_ipsec_ctx_createFunction · 0.85
memsetFunction · 0.85
txgbe_dcb_initFunction · 0.85
rte_delay_msFunction · 0.85

Tested by

no test coverage detected