#include <sys/stat.h>
#include <sys/mman.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;
}
dpio_dev->epoll_fd = dpio_epoll_fd;
- dpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id, cpu_id);
-
return 0;
}
}
#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 0;
}
+void
+rte_pmd_dpaa2_thread_init(void)
+{
+ int ret;
+
+ if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
+ ret = dpaa2_affine_qbman_swp();
+ if (ret) {
+ DPAA2_PMD_ERR(
+ "Failed to allocate IO portal, tid: %d\n",
+ rte_gettid());
+ return;
+ }
+ }
+}
+
static struct eth_dev_ops dpaa2_ethdev_ops = {
.dev_configure = dpaa2_eth_dev_configure,
.dev_start = dpaa2_dev_start,
uint16_t offset,
uint8_t size);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Do thread specific initialization
+ */
+__rte_experimental
+void
+rte_pmd_dpaa2_thread_init(void);
+
#endif /* _RTE_PMD_DPAA2_H */