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

Function ena_create_io_queue

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

Source from the content-addressed store, hash-verified

1327}
1328
1329static int ena_create_io_queue(struct rte_eth_dev *dev, struct ena_ring *ring)
1330{
1331 struct ena_adapter *adapter = ring->adapter;
1332 struct ena_com_dev *ena_dev = &adapter->ena_dev;
1333 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
1334 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1335 struct ena_com_create_io_ctx ctx =
1336 /* policy set to _HOST just to satisfy icc compiler */
1337 { ENA_ADMIN_PLACEMENT_POLICY_HOST,
1338 0, 0, 0, 0, 0 };
1339 uint16_t ena_qid;
1340 unsigned int i;
1341 int rc;
1342
1343 ctx.msix_vector = -1;
1344 if (ring->type == ENA_RING_TYPE_TX) {
1345 ena_qid = ENA_IO_TXQ_IDX(ring->id);
1346 ctx.direction = ENA_COM_IO_QUEUE_DIRECTION_TX;
1347 ctx.mem_queue_type = ena_dev->tx_mem_queue_type;
1348 for (i = 0; i < ring->ring_size; i++)
1349 ring->empty_tx_reqs[i] = i;
1350 } else {
1351 ena_qid = ENA_IO_RXQ_IDX(ring->id);
1352 ctx.direction = ENA_COM_IO_QUEUE_DIRECTION_RX;
1353 if (rte_intr_dp_is_en(intr_handle))
1354 ctx.msix_vector =
1355 rte_intr_vec_list_index_get(intr_handle,
1356 ring->id);
1357
1358 for (i = 0; i < ring->ring_size; i++)
1359 ring->empty_rx_reqs[i] = i;
1360 }
1361 ctx.queue_size = ring->ring_size;
1362 ctx.qid = ena_qid;
1363 ctx.numa_node = ring->numa_socket_id;
1364
1365 rc = ena_com_create_io_queue(ena_dev, &ctx);
1366 if (rc) {
1367 PMD_DRV_LOG(ERR,
1368 "Failed to create IO queue[%d] (qid:%d), rc: %d\n",
1369 ring->id, ena_qid, rc);
1370 return rc;
1371 }
1372
1373 rc = ena_com_get_io_handlers(ena_dev, ena_qid,
1374 &ring->ena_com_io_sq,
1375 &ring->ena_com_io_cq);
1376 if (rc) {
1377 PMD_DRV_LOG(ERR,
1378 "Failed to get IO queue[%d] handlers, rc: %d\n",
1379 ring->id, rc);
1380 ena_com_destroy_io_queue(ena_dev, ena_qid);
1381 return rc;
1382 }
1383
1384 if (ring->type == ENA_RING_TYPE_TX)
1385 ena_com_update_numa_node(ring->ena_com_io_cq, ctx.numa_node);
1386

Callers 1

ena_queue_startFunction · 0.85

Calls 7

rte_intr_dp_is_enFunction · 0.50
ena_com_create_io_queueFunction · 0.50
ena_com_get_io_handlersFunction · 0.50
ena_com_destroy_io_queueFunction · 0.50
ena_com_update_numa_nodeFunction · 0.50

Tested by

no test coverage detected