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

Function eth_ixgbe_dev_init

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:1073–1357  ·  view source on GitHub ↗

* This function is based on code in ixgbe_attach() in base/ixgbe.c. * It returns 0 on success. */

Source from the content-addressed store, hash-verified

1071 * It returns 0 on success.
1072 */
1073static int
1074eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
1075{
1076 struct ixgbe_adapter *ad = eth_dev->data->dev_private;
1077 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
1078 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1079 struct ixgbe_hw *hw =
1080 IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
1081 struct ixgbe_vfta *shadow_vfta =
1082 IXGBE_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private);
1083 struct ixgbe_hwstrip *hwstrip =
1084 IXGBE_DEV_PRIVATE_TO_HWSTRIP_BITMAP(eth_dev->data->dev_private);
1085 struct ixgbe_dcb_config *dcb_config =
1086 IXGBE_DEV_PRIVATE_TO_DCB_CFG(eth_dev->data->dev_private);
1087 struct ixgbe_filter_info *filter_info =
1088 IXGBE_DEV_PRIVATE_TO_FILTER_INFO(eth_dev->data->dev_private);
1089 struct ixgbe_bw_conf *bw_conf =
1090 IXGBE_DEV_PRIVATE_TO_BW_CONF(eth_dev->data->dev_private);
1091 uint32_t ctrl_ext;
1092 uint16_t csum;
1093 int diag, i, ret;
1094
1095 PMD_INIT_FUNC_TRACE();
1096
1097 ixgbe_dev_macsec_setting_reset(eth_dev);
1098
1099 eth_dev->dev_ops = &ixgbe_eth_dev_ops;
1100 eth_dev->rx_queue_count = ixgbe_dev_rx_queue_count;
1101 eth_dev->rx_descriptor_status = ixgbe_dev_rx_descriptor_status;
1102 eth_dev->tx_descriptor_status = ixgbe_dev_tx_descriptor_status;
1103 eth_dev->rx_pkt_burst = &ixgbe_recv_pkts;
1104 eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts;
1105 eth_dev->tx_pkt_prepare = &ixgbe_prep_pkts;
1106
1107 /*
1108 * For secondary processes, we don't initialise any further as primary
1109 * has already done this work. Only check we don't need a different
1110 * RX and TX function.
1111 */
1112 if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
1113 struct ixgbe_tx_queue *txq;
1114 /* TX queue function in primary, set by last queue initialized
1115 * Tx queue may not initialized by primary process
1116 */
1117 if (eth_dev->data->tx_queues) {
1118 txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];
1119 ixgbe_set_tx_function(eth_dev, txq);
1120 } else {
1121 /* Use default TX function if we get here */
1122 PMD_INIT_LOG(NOTICE, "No TX queues configured yet. "
1123 "Using default TX function.");
1124 }
1125
1126 ixgbe_set_rx_function(eth_dev);
1127
1128 return 0;
1129 }
1130

Callers 1

ixgbe_dev_resetFunction · 0.85

Calls 15

rte_eal_process_typeFunction · 0.85
ixgbe_set_rx_functionFunction · 0.85
ixgbe_parse_devargsFunction · 0.85
rte_eth_copy_pci_infoFunction · 0.85
ixgbe_init_shared_codeFunction · 0.85
ixgbe_get_bus_infoFunction · 0.85
ixgbe_swfw_lock_resetFunction · 0.85
ixgbe_ipsec_ctx_createFunction · 0.85
memsetFunction · 0.85
ixgbe_dcb_initFunction · 0.85

Tested by

no test coverage detected