#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/mman.h>
-#include <sys/syscall.h>
#include <sys/epoll.h>
-#include<sys/eventfd.h>
+#include <sys/eventfd.h>
+#include <sys/syscall.h>
#include <rte_mbuf.h>
#include <ethdev_driver.h>
fclose(file);
}
-static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev, int cpu_id)
+static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev)
{
struct epoll_event epoll_ev;
int eventfd, dpio_epoll_fd, ret;
int threshold = 0x3, timeout = 0xFF;
dpio_epoll_fd = epoll_create(1);
- ret = rte_dpaa2_intr_enable(&dpio_dev->intr_handle, 0);
+ ret = rte_dpaa2_intr_enable(dpio_dev->intr_handle, 0);
if (ret) {
DPAA2_BUS_ERR("Interrupt registeration failed");
return -1;
qbman_swp_dqrr_thrshld_write(dpio_dev->sw_portal, threshold);
qbman_swp_intr_timeout_write(dpio_dev->sw_portal, timeout);
- eventfd = dpio_dev->intr_handle.fd;
+ eventfd = rte_intr_fd_get(dpio_dev->intr_handle);
epoll_ev.events = EPOLLIN | EPOLLPRI | EPOLLET;
epoll_ev.data.fd = eventfd;
}
dpio_dev->epoll_fd = dpio_epoll_fd;
- dpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id, cpu_id);
-
return 0;
}
{
int ret;
- ret = rte_dpaa2_intr_disable(&dpio_dev->intr_handle, 0);
+ ret = rte_dpaa2_intr_disable(dpio_dev->intr_handle, 0);
if (ret)
DPAA2_BUS_ERR("DPIO interrupt disable failed");
}
#ifdef RTE_EVENT_DPAA2
- if (dpaa2_dpio_intr_init(dpio_dev, cpu_id)) {
+ if (dpaa2_dpio_intr_init(dpio_dev)) {
DPAA2_BUS_ERR("Interrupt registration failed for dpio");
return -1;
}
+ dpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id, cpu_id);
#endif
return 0;
return NULL;
}
- DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %lu",
- dpio_dev, dpio_dev->index, syscall(SYS_gettid));
+ DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %u",
+ dpio_dev, dpio_dev->index, rte_gettid());
/* Set the Stashing Destination */
cpu_id = dpaa2_get_core_id();
dpaa2_affine_qbman_swp(void)
{
struct dpaa2_dpio_dev *dpio_dev;
- uint64_t tid = syscall(SYS_gettid);
+ uint64_t tid = rte_gettid();
/* Populate the dpaa2_io_portal structure */
if (!RTE_PER_LCORE(_dpaa2_io).dpio_dev) {
dpaa2_affine_qbman_ethrx_swp(void)
{
struct dpaa2_dpio_dev *dpio_dev;
- uint64_t tid = syscall(SYS_gettid);
+ uint64_t tid = rte_gettid();
/* Populate the dpaa2_io_portal structure */
if (!RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev) {
/* Using single portal for all devices */
dpio_dev->mc_portal = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);
+ /* Allocate interrupt instance */
+ dpio_dev->intr_handle =
+ rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
+ if (!dpio_dev->intr_handle) {
+ DPAA2_BUS_ERR("Failed to allocate intr handle");
+ goto err;
+ }
+
dpio_dev->dpio = rte_zmalloc(NULL, sizeof(struct fsl_mc_io),
RTE_CACHE_LINE_SIZE);
if (!dpio_dev->dpio) {
io_space_count++;
dpio_dev->index = io_space_count;
- if (rte_dpaa2_vfio_setup_intr(&dpio_dev->intr_handle, vdev_fd, 1)) {
+ if (rte_dpaa2_vfio_setup_intr(dpio_dev->intr_handle, vdev_fd, 1)) {
DPAA2_BUS_ERR("Fail to setup interrupt for %d",
dpio_dev->hw_id);
goto err;
rte_free(dpio_dev->dpio);
}
+ rte_intr_instance_free(dpio_dev->intr_handle);
rte_free(dpio_dev);
/* For each element in the list, cleanup */
dpio_dev->token);
rte_free(dpio_dev->dpio);
}
+ rte_intr_instance_free(dpio_dev->intr_handle);
rte_free(dpio_dev);
}