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

Function rte_intr_efd_enable

dpdk/lib/eal/linux/eal_interrupts.c:1513–1558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1511}
1512
1513int
1514rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd)
1515{
1516 uint32_t i;
1517 int fd;
1518 uint32_t n = RTE_MIN(nb_efd, (uint32_t)RTE_MAX_RXTX_INTR_VEC_ID);
1519
1520 assert(nb_efd != 0);
1521
1522 if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_VFIO_MSIX) {
1523 for (i = 0; i < n; i++) {
1524 fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
1525 if (fd < 0) {
1526 RTE_LOG(ERR, EAL,
1527 "can't setup eventfd, error %i (%s)\n",
1528 errno, strerror(errno));
1529 return -errno;
1530 }
1531
1532 if (rte_intr_efds_index_set(intr_handle, i, fd))
1533 return -rte_errno;
1534 }
1535
1536 if (rte_intr_nb_efd_set(intr_handle, n))
1537 return -rte_errno;
1538
1539 if (rte_intr_max_intr_set(intr_handle, NB_OTHER_INTR + n))
1540 return -rte_errno;
1541 } else if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_VDEV) {
1542 /* only check, initialization would be done in vdev driver.*/
1543 if ((uint64_t)rte_intr_efd_counter_size_get(intr_handle) >
1544 sizeof(union rte_intr_read_buffer)) {
1545 RTE_LOG(ERR, EAL, "the efd_counter_size is oversized\n");
1546 return -EINVAL;
1547 }
1548 } else {
1549 if (rte_intr_efds_index_set(intr_handle, 0, rte_intr_fd_get(intr_handle)))
1550 return -rte_errno;
1551 if (rte_intr_nb_efd_set(intr_handle, RTE_MIN(nb_efd, 1U)))
1552 return -rte_errno;
1553 if (rte_intr_max_intr_set(intr_handle, NB_OTHER_INTR))
1554 return -rte_errno;
1555 }
1556
1557 return 0;
1558}
1559
1560void
1561rte_intr_efd_disable(struct rte_intr_handle *intr_handle)

Callers 15

ntb_init_hwFunction · 0.50
ifpga_register_msix_irqFunction · 0.50
atl_dev_startFunction · 0.50
eth_igb_startFunction · 0.50
igbvf_dev_startFunction · 0.50
eth_em_startFunction · 0.50
ena_setup_rx_intrFunction · 0.50
virtio_configure_intrFunction · 0.50
ionic_pci_configure_intrFunction · 0.50
ngbe_dev_startFunction · 0.50
enic_rxq_intr_initFunction · 0.50
nfp_netvf_startFunction · 0.50

Calls 7

rte_intr_type_getFunction · 0.85
eventfdClass · 0.85
rte_intr_efds_index_setFunction · 0.85
rte_intr_nb_efd_setFunction · 0.85
rte_intr_max_intr_setFunction · 0.85
rte_intr_fd_getFunction · 0.85

Tested by

no test coverage detected