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

Function eth_igb_start

dpdk/drivers/net/e1000/igb_ethdev.c:1191–1414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1189}
1190
1191static int
1192eth_igb_start(struct rte_eth_dev *dev)
1193{
1194 struct e1000_hw *hw =
1195 E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1196 struct e1000_adapter *adapter =
1197 E1000_DEV_PRIVATE(dev->data->dev_private);
1198 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
1199 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1200 int ret, mask;
1201 uint32_t intr_vector = 0;
1202 uint32_t ctrl_ext;
1203 uint32_t *speeds;
1204 int num_speeds;
1205 bool autoneg;
1206
1207 PMD_INIT_FUNC_TRACE();
1208
1209 /*
1210 * This function calls into the base driver, which in turn will use
1211 * function pointers, which are not guaranteed to be valid in secondary
1212 * processes, so avoid using this function in secondary processes.
1213 */
1214 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
1215 return -E_RTE_SECONDARY;
1216
1217 /* disable uio/vfio intr/eventfd mapping */
1218 rte_intr_disable(intr_handle);
1219
1220 /* Power up the phy. Needed to make the link go Up */
1221 eth_igb_dev_set_link_up(dev);
1222
1223 /*
1224 * Packet Buffer Allocation (PBA)
1225 * Writing PBA sets the receive portion of the buffer
1226 * the remainder is used for the transmit buffer.
1227 */
1228 if (hw->mac.type == e1000_82575) {
1229 uint32_t pba;
1230
1231 pba = E1000_PBA_32K; /* 32K for Rx, 16K for Tx */
1232 E1000_WRITE_REG(hw, E1000_PBA, pba);
1233 }
1234
1235 /* Put the address into the Receive Address Array */
1236 e1000_rar_set(hw, hw->mac.addr, 0);
1237
1238 /* Initialize the hardware */
1239 if (igb_hardware_init(hw)) {
1240 PMD_INIT_LOG(ERR, "Unable to initialize the hardware");
1241 return -EIO;
1242 }
1243 adapter->stopped = 0;
1244
1245 E1000_WRITE_REG(hw, E1000_VET,
1246 RTE_ETHER_TYPE_VLAN << 16 | RTE_ETHER_TYPE_VLAN);
1247
1248 ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);

Callers

nothing calls this directly

Calls 15

rte_eal_process_typeFunction · 0.85
eth_igb_dev_set_link_upFunction · 0.85
e1000_rar_setFunction · 0.85
igb_hardware_initFunction · 0.85
igb_pf_host_configureFunction · 0.85
rte_intr_vec_list_allocFunction · 0.85
igb_init_manageabilityFunction · 0.85
eth_igb_tx_initFunction · 0.85
eth_igb_rx_initFunction · 0.85
igb_dev_clear_queuesFunction · 0.85

Tested by

no test coverage detected