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

Function ena_stop

dpdk/drivers/net/ena/ena_ethdev.c:1283–1327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1281}
1282
1283static int ena_stop(struct rte_eth_dev *dev)
1284{
1285 struct ena_adapter *adapter = dev->data->dev_private;
1286 struct ena_com_dev *ena_dev = &adapter->ena_dev;
1287 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
1288 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1289 uint16_t i;
1290 int rc;
1291
1292 /* Cannot free memory in secondary process */
1293 if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
1294 PMD_DRV_LOG(WARNING, "dev_stop not supported in secondary.\n");
1295 return -EPERM;
1296 }
1297
1298 rte_timer_stop_sync(&adapter->timer_wd);
1299 ena_queue_stop_all(dev, ENA_RING_TYPE_TX);
1300 ena_queue_stop_all(dev, ENA_RING_TYPE_RX);
1301
1302 if (adapter->trigger_reset) {
1303 rc = ena_com_dev_reset(ena_dev, adapter->reset_reason);
1304 if (rc)
1305 PMD_DRV_LOG(ERR, "Device reset failed, rc: %d\n", rc);
1306 }
1307
1308 rte_intr_disable(intr_handle);
1309
1310 rte_intr_efd_disable(intr_handle);
1311
1312 /* Cleanup vector list */
1313 rte_intr_vec_list_free(intr_handle);
1314
1315 rte_intr_enable(intr_handle);
1316
1317 ++adapter->dev_stats.dev_stop;
1318 adapter->state = ENA_ADAPTER_STATE_STOPPED;
1319 dev->data->dev_started = 0;
1320
1321 for (i = 0; i < dev->data->nb_rx_queues; i++)
1322 dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
1323 for (i = 0; i < dev->data->nb_tx_queues; i++)
1324 dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
1325
1326 return 0;
1327}
1328
1329static int ena_create_io_queue(struct rte_eth_dev *dev, struct ena_ring *ring)
1330{

Callers 1

ena_closeFunction · 0.85

Calls 8

rte_eal_process_typeFunction · 0.85
rte_timer_stop_syncFunction · 0.85
ena_queue_stop_allFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85
ena_com_dev_resetFunction · 0.50
rte_intr_disableFunction · 0.50
rte_intr_efd_disableFunction · 0.50
rte_intr_enableFunction · 0.50

Tested by

no test coverage detected