Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/100494/?format=api
https://patches.dpdk.org/api/patches/100494/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211005121502.66964-2-hkalra@marvell.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20211005121502.66964-2-hkalra@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211005121502.66964-2-hkalra@marvell.com", "date": "2021-10-05T12:14:57", "name": "[v2,1/6] eal/interrupts: implement get set APIs", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "97047ffacc907ed241f4b58c497576d20245cccd", "submitter": { "id": 1182, "url": "https://patches.dpdk.org/api/people/1182/?format=api", "name": "Harman Kalra", "email": "hkalra@marvell.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211005121502.66964-2-hkalra@marvell.com/mbox/", "series": [ { "id": 19386, "url": "https://patches.dpdk.org/api/series/19386/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19386", "date": "2021-10-05T12:14:56", "name": "make rte_intr_handle internal", "version": 2, "mbox": "https://patches.dpdk.org/series/19386/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/100494/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/100494/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D851DA0C47;\n\tTue, 5 Oct 2021 14:17:02 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B358E4138A;\n\tTue, 5 Oct 2021 14:16:54 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 4795641344\n for <dev@dpdk.org>; Tue, 5 Oct 2021 14:16:51 +0200 (CEST)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 195CEXg3028469;\n Tue, 5 Oct 2021 05:16:48 -0700", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com with ESMTP id 3bgmv5rara-11\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 05 Oct 2021 05:16:47 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Tue, 5 Oct 2021 05:15:35 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Tue, 5 Oct 2021 05:15:35 -0700", "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id A8F623F7080;\n Tue, 5 Oct 2021 05:15:33 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=DIXmuSMW6YZfKBUJe3oDrO/8rMSwG6C2MdpF9sw0t4g=;\n b=i5xojxtptXA1qErK7TZ0MJgF7mE82n44rA7BUBu8bLYDGKrzQon8PqiCeNB2MPdvqUKM\n tdY9iuJL+6v6dnO4rsTFWBP3SNGA+oVs8Mu9HonS6jMKKq3WpW/Nqr/Q7xTnipcVrmgo\n 4n8w4uS4+ilc7CPlpO7OAOu65UQCvxccXyI8LoZ+fuptBdgzo2MpidAt2Sozy3flrXc5\n 6GTdJlD4GQQHH+xB7SCtTv49iNgS0rBQSTke7O40uF1NB8A6UeJTdD+SZ2fN36vUlFf8\n x7LpTexQNSxS2oNr0sBJTQDJNBzAwip7eRXkXwvn9/+tI2ecnJLFtUfcXgMnesTJFxrb lw==", "From": "Harman Kalra <hkalra@marvell.com>", "To": "<dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>, Harman Kalra\n <hkalra@marvell.com>, Ray Kinsella <mdr@ashroe.eu>", "CC": "<david.marchand@redhat.com>, <dmitry.kozliuk@gmail.com>", "Date": "Tue, 5 Oct 2021 17:44:57 +0530", "Message-ID": "<20211005121502.66964-2-hkalra@marvell.com>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20211005121502.66964-1-hkalra@marvell.com>", "References": "<20210826145726.102081-1-hkalra@marvell.com>\n <20211005121502.66964-1-hkalra@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-GUID": "s9Jg1OvM8qpubIUrsTNW3Pnlsq7-XFKO", "X-Proofpoint-ORIG-GUID": "s9Jg1OvM8qpubIUrsTNW3Pnlsq7-XFKO", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475\n definitions=2021-10-05_01,2021-10-04_01,2020-04-07_01", "Subject": "[dpdk-dev] [PATCH v2 1/6] eal/interrupts: implement get set APIs", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Prototype/Implement get set APIs for interrupt handle fields.\nUser wont be able to access any of the interrupt handle fields\ndirectly while should use these get/set APIs to access/manipulate\nthem.\n\nInternal interrupt header i.e. rte_eal_interrupt.h is rearranged,\nas APIs defined are moved to rte_interrupts.h and epoll specific\ndefinitions are moved to a new header rte_epoll.h.\nLater in the series rte_eal_interrupt.h will be removed.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\nAcked-by: Ray Kinsella <mdr@ashroe.eu>\n---\n MAINTAINERS | 1 +\n lib/eal/common/eal_common_interrupts.c | 470 +++++++++++++++++++\n lib/eal/common/meson.build | 1 +\n lib/eal/include/meson.build | 1 +\n lib/eal/include/rte_eal_interrupts.h | 207 +--------\n lib/eal/include/rte_epoll.h | 118 +++++\n lib/eal/include/rte_interrupts.h | 614 ++++++++++++++++++++++++-\n lib/eal/version.map | 46 +-\n 8 files changed, 1245 insertions(+), 213 deletions(-)\n create mode 100644 lib/eal/common/eal_common_interrupts.c\n create mode 100644 lib/eal/include/rte_epoll.h", "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 278e5b3226..c0e7bba4f7 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -210,6 +210,7 @@ F: app/test/test_memzone.c\n \n Interrupt Subsystem\n M: Harman Kalra <hkalra@marvell.com>\n+F: lib/eal/include/rte_epoll.h\n F: lib/eal/*/*interrupts.*\n F: app/test/test_interrupts.c\n \ndiff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c\nnew file mode 100644\nindex 0000000000..9b572a805f\n--- /dev/null\n+++ b/lib/eal/common/eal_common_interrupts.c\n@@ -0,0 +1,470 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2021 Marvell.\n+ */\n+\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include <rte_errno.h>\n+#include <rte_log.h>\n+#include <rte_malloc.h>\n+\n+#include <rte_interrupts.h>\n+\n+\n+struct rte_intr_handle *rte_intr_instance_alloc(uint32_t flags)\n+{\n+\tstruct rte_intr_handle *intr_handle;\n+\tbool mem_allocator;\n+\n+\tmem_allocator = (flags & RTE_INTR_ALLOC_DPDK_ALLOCATOR) != 0;\n+\tif (mem_allocator)\n+\t\tintr_handle = rte_zmalloc(NULL, sizeof(struct rte_intr_handle),\n+\t\t\t\t\t 0);\n+\telse\n+\t\tintr_handle = calloc(1, sizeof(struct rte_intr_handle));\n+\tif (!intr_handle) {\n+\t\tRTE_LOG(ERR, EAL, \"Fail to allocate intr_handle\\n\");\n+\t\trte_errno = ENOMEM;\n+\t\treturn NULL;\n+\t}\n+\n+\tintr_handle->nb_intr = RTE_MAX_RXTX_INTR_VEC_ID;\n+\tintr_handle->mem_allocator = mem_allocator;\n+\n+\treturn intr_handle;\n+}\n+\n+int rte_intr_instance_copy(struct rte_intr_handle *intr_handle,\n+\t\t\t const struct rte_intr_handle *src)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (src == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Source interrupt instance unallocated\\n\");\n+\t\trte_errno = EINVAL;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->fd = src->fd;\n+\tintr_handle->vfio_dev_fd = src->vfio_dev_fd;\n+\tintr_handle->type = src->type;\n+\tintr_handle->max_intr = src->max_intr;\n+\tintr_handle->nb_efd = src->nb_efd;\n+\tintr_handle->efd_counter_size = src->efd_counter_size;\n+\n+\tmemcpy(intr_handle->efds, src->efds, src->nb_intr);\n+\tmemcpy(intr_handle->elist, src->elist, src->nb_intr);\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_instance_mem_allocator_get(\n+\t\t\t\tconst struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\treturn intr_handle->mem_allocator;\n+}\n+\n+void rte_intr_instance_free(struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t}\n+\n+\tif (intr_handle->mem_allocator)\n+\t\trte_free(intr_handle);\n+\telse\n+\t\tfree(intr_handle);\n+}\n+\n+int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->fd = fd;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_fd_get(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->fd;\n+fail:\n+\treturn -1;\n+}\n+\n+int rte_intr_type_set(struct rte_intr_handle *intr_handle,\n+\t\t enum rte_intr_handle_type type)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->type = type;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+enum rte_intr_handle_type rte_intr_type_get(\n+\t\t\t\tconst struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\treturn RTE_INTR_HANDLE_UNKNOWN;\n+\t}\n+\n+\treturn intr_handle->type;\n+}\n+\n+int rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->vfio_dev_fd = fd;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->vfio_dev_fd;\n+fail:\n+\treturn -1;\n+}\n+\n+int rte_intr_max_intr_set(struct rte_intr_handle *intr_handle,\n+\t\t\t\t int max_intr)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (max_intr > intr_handle->nb_intr) {\n+\t\tRTE_LOG(ERR, EAL, \"Max_intr=%d greater than RTE_MAX_RXTX_INTR_VEC_ID=%d\",\n+\t\t\tmax_intr, intr_handle->nb_intr);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->max_intr = max_intr;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->max_intr;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle,\n+\t\t\t\t int nb_efd)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->nb_efd = nb_efd;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->nb_efd;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->nb_intr;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,\n+\t\t\t\t uint8_t efd_counter_size)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->efd_counter_size = efd_counter_size;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->efd_counter_size;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle,\n+\t\t\t\t int index)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (index >= intr_handle->nb_intr) {\n+\t\tRTE_LOG(ERR, EAL, \"Invalid size %d, max limit %d\\n\", index,\n+\t\t\tintr_handle->nb_intr);\n+\t\trte_errno = EINVAL;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->efds[index];\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_efds_index_set(struct rte_intr_handle *intr_handle,\n+\t\t\t\t int index, int fd)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (index >= intr_handle->nb_intr) {\n+\t\tRTE_LOG(ERR, EAL, \"Invalid size %d, max limit %d\\n\", index,\n+\t\t\tintr_handle->nb_intr);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->efds[index] = fd;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+struct rte_epoll_event *rte_intr_elist_index_get(\n+\t\t\t\tstruct rte_intr_handle *intr_handle, int index)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (index >= intr_handle->nb_intr) {\n+\t\tRTE_LOG(ERR, EAL, \"Invalid size %d, max limit %d\\n\", index,\n+\t\t\tintr_handle->nb_intr);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn &intr_handle->elist[index];\n+fail:\n+\treturn NULL;\n+}\n+\n+int rte_intr_elist_index_set(struct rte_intr_handle *intr_handle,\n+\t\t\t\t int index, struct rte_epoll_event elist)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (index >= intr_handle->nb_intr) {\n+\t\tRTE_LOG(ERR, EAL, \"Invalid size %d, max limit %d\\n\", index,\n+\t\t\tintr_handle->nb_intr);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->elist[index] = elist;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle,\n+\t\t\t\t const char *name, int size)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\t/* Vector list already allocated */\n+\tif (intr_handle->intr_vec)\n+\t\treturn 0;\n+\n+\tif (size > intr_handle->nb_intr) {\n+\t\tRTE_LOG(ERR, EAL, \"Invalid size %d, max limit %d\\n\", size,\n+\t\t intr_handle->nb_intr);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->intr_vec = rte_zmalloc(name, size * sizeof(int), 0);\n+\tif (!intr_handle->intr_vec) {\n+\t\tRTE_LOG(ERR, EAL, \"Failed to allocate %d intr_vec\", size);\n+\t\t\trte_errno = ENOMEM;\n+\t\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->vec_list_size = size;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,\n+\t\t\t\tint index)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (!intr_handle->intr_vec) {\n+\t\tRTE_LOG(ERR, EAL, \"Intr vector list not allocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (index > intr_handle->vec_list_size) {\n+\t\tRTE_LOG(ERR, EAL, \"Index %d greater than vec list size %d\\n\",\n+\t\t\tindex, intr_handle->vec_list_size);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\treturn intr_handle->intr_vec[index];\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+int rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle,\n+\t\t\t\t int index, int vec)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (!intr_handle->intr_vec) {\n+\t\tRTE_LOG(ERR, EAL, \"Intr vector list not allocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (index > intr_handle->vec_list_size) {\n+\t\tRTE_LOG(ERR, EAL, \"Index %d greater than vec list size %d\\n\",\n+\t\t\tindex, intr_handle->vec_list_size);\n+\t\trte_errno = ERANGE;\n+\t\tgoto fail;\n+\t}\n+\n+\tintr_handle->intr_vec[index] = vec;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+void rte_intr_vec_list_free(struct rte_intr_handle *intr_handle)\n+{\n+\tif (intr_handle == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Interrupt instance unallocated\\n\");\n+\t\trte_errno = ENOTSUP;\n+\t}\n+\n+\trte_free(intr_handle->intr_vec);\n+\tintr_handle->intr_vec = NULL;\n+}\ndiff --git a/lib/eal/common/meson.build b/lib/eal/common/meson.build\nindex 6d01b0f072..917758cc65 100644\n--- a/lib/eal/common/meson.build\n+++ b/lib/eal/common/meson.build\n@@ -15,6 +15,7 @@ sources += files(\n 'eal_common_errno.c',\n 'eal_common_fbarray.c',\n 'eal_common_hexdump.c',\n+ 'eal_common_interrupts.c',\n 'eal_common_launch.c',\n 'eal_common_lcore.c',\n 'eal_common_log.c',\ndiff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build\nindex 88a9eba12f..8e258607b8 100644\n--- a/lib/eal/include/meson.build\n+++ b/lib/eal/include/meson.build\n@@ -19,6 +19,7 @@ headers += files(\n 'rte_eal_memconfig.h',\n 'rte_eal_trace.h',\n 'rte_errno.h',\n+ 'rte_epoll.h',\n 'rte_fbarray.h',\n 'rte_hexdump.h',\n 'rte_hypervisor.h',\ndiff --git a/lib/eal/include/rte_eal_interrupts.h b/lib/eal/include/rte_eal_interrupts.h\nindex 00bcc19b6d..b01e987898 100644\n--- a/lib/eal/include/rte_eal_interrupts.h\n+++ b/lib/eal/include/rte_eal_interrupts.h\n@@ -39,32 +39,6 @@ enum rte_intr_handle_type {\n \tRTE_INTR_HANDLE_MAX /**< count of elements */\n };\n \n-#define RTE_INTR_EVENT_ADD 1UL\n-#define RTE_INTR_EVENT_DEL 2UL\n-\n-typedef void (*rte_intr_event_cb_t)(int fd, void *arg);\n-\n-struct rte_epoll_data {\n-\tuint32_t event; /**< event type */\n-\tvoid *data; /**< User data */\n-\trte_intr_event_cb_t cb_fun; /**< IN: callback fun */\n-\tvoid *cb_arg;\t /**< IN: callback arg */\n-};\n-\n-enum {\n-\tRTE_EPOLL_INVALID = 0,\n-\tRTE_EPOLL_VALID,\n-\tRTE_EPOLL_EXEC,\n-};\n-\n-/** interrupt epoll event obj, taken by epoll_event.ptr */\n-struct rte_epoll_event {\n-\tuint32_t status; /**< OUT: event status */\n-\tint fd; /**< OUT: event fd */\n-\tint epfd; /**< OUT: epoll instance the ev associated with */\n-\tstruct rte_epoll_data epdata;\n-};\n-\n /** Handle for interrupts. */\n struct rte_intr_handle {\n \tRTE_STD_C11\n@@ -81,189 +55,18 @@ struct rte_intr_handle {\n \t\t};\n \t\tvoid *handle; /**< device driver handle (Windows) */\n \t};\n+\tbool mem_allocator;\n \tenum rte_intr_handle_type type; /**< handle type */\n \tuint32_t max_intr; /**< max interrupt requested */\n \tuint32_t nb_efd; /**< number of available efd(event fd) */\n \tuint8_t efd_counter_size; /**< size of efd counter, used for vdev */\n+\tuint16_t nb_intr;\n+\t\t/**< Max vector count, default RTE_MAX_RXTX_INTR_VEC_ID */\n \tint efds[RTE_MAX_RXTX_INTR_VEC_ID]; /**< intr vectors/efds mapping */\n \tstruct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID];\n-\t\t\t\t /**< intr vector epoll event */\n+\t\t\t\t\t\t/**< intr vector epoll event */\n+\tuint16_t vec_list_size;\n \tint *intr_vec; /**< intr vector number array */\n };\n \n-#define RTE_EPOLL_PER_THREAD -1 /**< to hint using per thread epfd */\n-\n-/**\n- * It waits for events on the epoll instance.\n- * Retries if signal received.\n- *\n- * @param epfd\n- * Epoll instance fd on which the caller wait for events.\n- * @param events\n- * Memory area contains the events that will be available for the caller.\n- * @param maxevents\n- * Up to maxevents are returned, must greater than zero.\n- * @param timeout\n- * Specifying a timeout of -1 causes a block indefinitely.\n- * Specifying a timeout equal to zero cause to return immediately.\n- * @return\n- * - On success, returns the number of available event.\n- * - On failure, a negative value.\n- */\n-int\n-rte_epoll_wait(int epfd, struct rte_epoll_event *events,\n-\t int maxevents, int timeout);\n-\n-/**\n- * It waits for events on the epoll instance.\n- * Does not retry if signal received.\n- *\n- * @param epfd\n- * Epoll instance fd on which the caller wait for events.\n- * @param events\n- * Memory area contains the events that will be available for the caller.\n- * @param maxevents\n- * Up to maxevents are returned, must greater than zero.\n- * @param timeout\n- * Specifying a timeout of -1 causes a block indefinitely.\n- * Specifying a timeout equal to zero cause to return immediately.\n- * @return\n- * - On success, returns the number of available event.\n- * - On failure, a negative value.\n- */\n-__rte_experimental\n-int\n-rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,\n-\t int maxevents, int timeout);\n-\n-/**\n- * It performs control operations on epoll instance referred by the epfd.\n- * It requests that the operation op be performed for the target fd.\n- *\n- * @param epfd\n- * Epoll instance fd on which the caller perform control operations.\n- * @param op\n- * The operation be performed for the target fd.\n- * @param fd\n- * The target fd on which the control ops perform.\n- * @param event\n- * Describes the object linked to the fd.\n- * Note: The caller must take care the object deletion after CTL_DEL.\n- * @return\n- * - On success, zero.\n- * - On failure, a negative value.\n- */\n-int\n-rte_epoll_ctl(int epfd, int op, int fd,\n-\t struct rte_epoll_event *event);\n-\n-/**\n- * The function returns the per thread epoll instance.\n- *\n- * @return\n- * epfd the epoll instance referred to.\n- */\n-int\n-rte_intr_tls_epfd(void);\n-\n-/**\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- * @param epfd\n- * Epoll instance fd which the intr vector associated to.\n- * @param op\n- * The operation be performed for the vector.\n- * Operation type of {ADD, DEL}.\n- * @param vec\n- * RX intr vector number added to the epoll instance wait list.\n- * @param data\n- * User raw data.\n- * @return\n- * - On success, zero.\n- * - On failure, a negative value.\n- */\n-int\n-rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,\n-\t\tint epfd, int op, unsigned int vec, void *data);\n-\n-/**\n- * It deletes registered eventfds.\n- *\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- */\n-void\n-rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);\n-\n-/**\n- * It enables the packet I/O interrupt event if it's necessary.\n- * It creates event fd for each interrupt vector when MSIX is used,\n- * otherwise it multiplexes a single event fd.\n- *\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- * @param nb_efd\n- * Number of interrupt vector trying to enable.\n- * The value 0 is not allowed.\n- * @return\n- * - On success, zero.\n- * - On failure, a negative value.\n- */\n-int\n-rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);\n-\n-/**\n- * It disables the packet I/O interrupt event.\n- * It deletes registered eventfds and closes the open fds.\n- *\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- */\n-void\n-rte_intr_efd_disable(struct rte_intr_handle *intr_handle);\n-\n-/**\n- * The packet I/O interrupt on datapath is enabled or not.\n- *\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- */\n-int\n-rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);\n-\n-/**\n- * The interrupt handle instance allows other causes or not.\n- * Other causes stand for any none packet I/O interrupts.\n- *\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- */\n-int\n-rte_intr_allow_others(struct rte_intr_handle *intr_handle);\n-\n-/**\n- * The multiple interrupt vector capability of interrupt handle instance.\n- * It returns zero if no multiple interrupt vector support.\n- *\n- * @param intr_handle\n- * Pointer to the interrupt handle.\n- */\n-int\n-rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);\n-\n-/**\n- * @warning\n- * @b EXPERIMENTAL: this API may change without prior notice\n- *\n- * @internal\n- * Check if currently executing in interrupt context\n- *\n- * @return\n- * - non zero in case of interrupt context\n- * - zero in case of process context\n- */\n-__rte_experimental\n-int\n-rte_thread_is_intr(void);\n-\n #endif /* _RTE_EAL_INTERRUPTS_H_ */\ndiff --git a/lib/eal/include/rte_epoll.h b/lib/eal/include/rte_epoll.h\nnew file mode 100644\nindex 0000000000..56b7b6bad6\n--- /dev/null\n+++ b/lib/eal/include/rte_epoll.h\n@@ -0,0 +1,118 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2021 Marvell International Ltd.\n+ */\n+\n+#ifndef __RTE_EPOLL_H__\n+#define __RTE_EPOLL_H__\n+\n+/**\n+ * @file\n+ * The rte_epoll provides interfaces functions to add delete events,\n+ * wait poll for an event.\n+ */\n+\n+#include <stdint.h>\n+\n+#include <rte_compat.h>\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#define RTE_INTR_EVENT_ADD 1UL\n+#define RTE_INTR_EVENT_DEL 2UL\n+\n+typedef void (*rte_intr_event_cb_t)(int fd, void *arg);\n+\n+struct rte_epoll_data {\n+\tuint32_t event; /**< event type */\n+\tvoid *data; /**< User data */\n+\trte_intr_event_cb_t cb_fun; /**< IN: callback fun */\n+\tvoid *cb_arg;\t /**< IN: callback arg */\n+};\n+\n+enum {\n+\tRTE_EPOLL_INVALID = 0,\n+\tRTE_EPOLL_VALID,\n+\tRTE_EPOLL_EXEC,\n+};\n+\n+/** interrupt epoll event obj, taken by epoll_event.ptr */\n+struct rte_epoll_event {\n+\tuint32_t status; /**< OUT: event status */\n+\tint fd; /**< OUT: event fd */\n+\tint epfd; /**< OUT: epoll instance the ev associated with */\n+\tstruct rte_epoll_data epdata;\n+};\n+\n+#define RTE_EPOLL_PER_THREAD -1 /**< to hint using per thread epfd */\n+\n+/**\n+ * It waits for events on the epoll instance.\n+ * Retries if signal received.\n+ *\n+ * @param epfd\n+ * Epoll instance fd on which the caller wait for events.\n+ * @param events\n+ * Memory area contains the events that will be available for the caller.\n+ * @param maxevents\n+ * Up to maxevents are returned, must greater than zero.\n+ * @param timeout\n+ * Specifying a timeout of -1 causes a block indefinitely.\n+ * Specifying a timeout equal to zero cause to return immediately.\n+ * @return\n+ * - On success, returns the number of available event.\n+ * - On failure, a negative value.\n+ */\n+int\n+rte_epoll_wait(int epfd, struct rte_epoll_event *events,\n+\t int maxevents, int timeout);\n+\n+/**\n+ * It waits for events on the epoll instance.\n+ * Does not retry if signal received.\n+ *\n+ * @param epfd\n+ * Epoll instance fd on which the caller wait for events.\n+ * @param events\n+ * Memory area contains the events that will be available for the caller.\n+ * @param maxevents\n+ * Up to maxevents are returned, must greater than zero.\n+ * @param timeout\n+ * Specifying a timeout of -1 causes a block indefinitely.\n+ * Specifying a timeout equal to zero cause to return immediately.\n+ * @return\n+ * - On success, returns the number of available event.\n+ * - On failure, a negative value.\n+ */\n+__rte_experimental\n+int\n+rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,\n+\t int maxevents, int timeout);\n+\n+/**\n+ * It performs control operations on epoll instance referred by the epfd.\n+ * It requests that the operation op be performed for the target fd.\n+ *\n+ * @param epfd\n+ * Epoll instance fd on which the caller perform control operations.\n+ * @param op\n+ * The operation be performed for the target fd.\n+ * @param fd\n+ * The target fd on which the control ops perform.\n+ * @param event\n+ * Describes the object linked to the fd.\n+ * Note: The caller must take care the object deletion after CTL_DEL.\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+int\n+rte_epoll_ctl(int epfd, int op, int fd,\n+\t struct rte_epoll_event *event);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __RTE_EPOLL_H__ */\ndiff --git a/lib/eal/include/rte_interrupts.h b/lib/eal/include/rte_interrupts.h\nindex cc3bf45d8c..db830907fb 100644\n--- a/lib/eal/include/rte_interrupts.h\n+++ b/lib/eal/include/rte_interrupts.h\n@@ -5,8 +5,11 @@\n #ifndef _RTE_INTERRUPTS_H_\n #define _RTE_INTERRUPTS_H_\n \n+#include <stdbool.h>\n+\n #include <rte_common.h>\n #include <rte_compat.h>\n+#include <rte_epoll.h>\n \n /**\n * @file\n@@ -22,6 +25,16 @@ extern \"C\" {\n /** Interrupt handle */\n struct rte_intr_handle;\n \n+/** Interrupt instance allocation flags\n+ * @see rte_intr_instance_alloc\n+ */\n+/** Allocate interrupt instance using DPDK memory management APIs */\n+#define RTE_INTR_ALLOC_DPDK_ALLOCATOR\t0x00000001\n+\n+#define RTE_INTR_HANDLE_DEFAULT_SIZE 1\n+\n+#include \"rte_eal_interrupts.h\"\n+\n /** Function to be registered for the specific interrupt */\n typedef void (*rte_intr_callback_fn)(void *cb_arg);\n \n@@ -32,8 +45,6 @@ typedef void (*rte_intr_callback_fn)(void *cb_arg);\n typedef void (*rte_intr_unregister_callback_fn)(struct rte_intr_handle *intr_handle,\n \t\t\t\t\t\tvoid *cb_arg);\n \n-#include \"rte_eal_interrupts.h\"\n-\n /**\n * It registers the callback for the specific interrupt. Multiple\n * callbacks can be registered at the same time.\n@@ -163,6 +174,605 @@ int rte_intr_disable(const struct rte_intr_handle *intr_handle);\n __rte_experimental\n int rte_intr_ack(const struct rte_intr_handle *intr_handle);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Check if currently executing in interrupt context\n+ *\n+ * @return\n+ * - non zero in case of interrupt context\n+ * - zero in case of process context\n+ */\n+__rte_experimental\n+int\n+rte_thread_is_intr(void);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * It allocates memory for interrupt instance. API takes flag as an argument\n+ * which define from where memory should be allocated i.e. using DPDK memory\n+ * management library APIs or normal heap allocation.\n+ * Default memory allocation for event fds and event list array is done which\n+ * can be realloced later as per the requirement.\n+ *\n+ * This function should be called from application or driver, before calling any\n+ * of the interrupt APIs.\n+ *\n+ * @param flags\n+ * Memory allocation from DPDK allocator or normal allocation\n+ *\n+ * @return\n+ * - On success, address of first interrupt handle.\n+ * - On failure, NULL.\n+ */\n+__rte_experimental\n+struct rte_intr_handle *\n+rte_intr_instance_alloc(uint32_t flags);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * This API is used to free the memory allocated for event fds. event lists\n+ * and interrupt handle array.\n+ *\n+ * @param intr_handle\n+ * Base address of interrupt handle array.\n+ *\n+ */\n+__rte_experimental\n+void\n+rte_intr_instance_free(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * This API is used to set the fd field of interrupt handle with user provided\n+ * file descriptor.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param fd\n+ * file descriptor value provided by user.\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_experimental\n+int\n+rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Returns the fd field of the given interrupt handle instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, fd field.\n+ * - On failure, a negative value.\n+ */\n+__rte_experimental\n+int\n+rte_intr_fd_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * This API is used to set the type field of interrupt handle with user provided\n+ * interrupt type.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param type\n+ * interrupt type\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_experimental\n+int\n+rte_intr_type_set(struct rte_intr_handle *intr_handle,\n+\t\t enum rte_intr_handle_type type);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Returns the type field of the given interrupt handle instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, interrupt type\n+ * - On failure, RTE_INTR_HANDLE_UNKNOWN.\n+ */\n+__rte_experimental\n+enum rte_intr_handle_type\n+rte_intr_type_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * The function returns the per thread epoll instance.\n+ *\n+ * @return\n+ * epfd the epoll instance referred to.\n+ */\n+__rte_internal\n+int\n+rte_intr_tls_epfd(void);\n+\n+/**\n+ * @internal\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ * @param epfd\n+ * Epoll instance fd which the intr vector associated to.\n+ * @param op\n+ * The operation be performed for the vector.\n+ * Operation type of {ADD, DEL}.\n+ * @param vec\n+ * RX intr vector number added to the epoll instance wait list.\n+ * @param data\n+ * User raw data.\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_rx_ctl(struct rte_intr_handle *intr_handle,\n+\t\tint epfd, int op, unsigned int vec, void *data);\n+\n+/**\n+ * @internal\n+ * It deletes registered eventfds.\n+ *\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ */\n+__rte_internal\n+void\n+rte_intr_free_epoll_fd(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * It enables the packet I/O interrupt event if it's necessary.\n+ * It creates event fd for each interrupt vector when MSIX is used,\n+ * otherwise it multiplexes a single event fd.\n+ *\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ * @param nb_efd\n+ * Number of interrupt vector trying to enable.\n+ * The value 0 is not allowed.\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd);\n+\n+/**\n+ * @internal\n+ * It disables the packet I/O interrupt event.\n+ * It deletes registered eventfds and closes the open fds.\n+ *\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ */\n+__rte_internal\n+void\n+rte_intr_efd_disable(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * The packet I/O interrupt on datapath is enabled or not.\n+ *\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ */\n+__rte_internal\n+int\n+rte_intr_dp_is_en(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * The interrupt handle instance allows other causes or not.\n+ * Other causes stand for any none packet I/O interrupts.\n+ *\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ */\n+__rte_internal\n+int\n+rte_intr_allow_others(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * The multiple interrupt vector capability of interrupt handle instance.\n+ * It returns zero if no multiple interrupt vector support.\n+ *\n+ * @param intr_handle\n+ * Pointer to the interrupt handle.\n+ */\n+__rte_internal\n+int\n+rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * This API is used to populate interrupt handle, with src handler fields.\n+ *\n+ * @param intr_handle\n+ * Start address of interrupt handles\n+ * @param src\n+ * Source interrupt handle to be cloned.\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_instance_copy(struct rte_intr_handle *intr_handle,\n+\t\t const struct rte_intr_handle *src);\n+\n+/**\n+ * @internal\n+ * This API is used to set the device fd field of interrupt handle with user\n+ * provided dev fd. Device fd corresponds to VFIO device fd or UIO config fd.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param fd\n+ * interrupt type\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd);\n+\n+/**\n+ * @internal\n+ * Returns the device fd field of the given interrupt handle instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, dev fd.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * This API is used to set the max intr field of interrupt handle with user\n+ * provided max intr value.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param max_intr\n+ * interrupt type\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_max_intr_set(struct rte_intr_handle *intr_handle, int max_intr);\n+\n+/**\n+ * @internal\n+ * Returns the max intr field of the given interrupt handle instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, max intr.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * This API is used to set the no of event fd field of interrupt handle with\n+ * user provided available event file descriptor value.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param nb_efd\n+ * Available event fd\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_nb_efd_set(struct rte_intr_handle *intr_handle, int nb_efd);\n+\n+/**\n+ * @internal\n+ * Returns the no of available event fd field of the given interrupt handle\n+ * instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, nb_efd\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_nb_efd_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * Returns the no of interrupt vector field of the given interrupt handle\n+ * instance. This field is to configured on device probe time, and based on\n+ * this value efds and elist arrays are dynamically allocated. By default\n+ * this value is set to RTE_MAX_RXTX_INTR_VEC_ID.\n+ * For eg. in case of PCI device, its msix size is queried and efds/elist\n+ * arrays are allocated accordingly.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, nb_intr\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_nb_intr_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * This API is used to set the event fd counter size field of interrupt handle\n+ * with user provided efd counter size.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param efd_counter_size\n+ * size of efd counter, used for vdev\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_efd_counter_size_set(struct rte_intr_handle *intr_handle,\n+\t\t\t uint8_t efd_counter_size);\n+\n+/**\n+ * @internal\n+ * Returns the event fd counter size field of the given interrupt handle\n+ * instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, efd_counter_size\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_efd_counter_size_get(const struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * This API is used to set the event fd array index with the given fd.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param index\n+ * efds array index to be set\n+ * @param fd\n+ * event fd\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, int index, int fd);\n+\n+/**\n+ * @internal\n+ * Returns the fd value of event fds array at a given index.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param index\n+ * efds array index to be returned\n+ *\n+ * @return\n+ * - On success, fd\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, int index);\n+\n+/**\n+ * @internal\n+ * This API is used to set the event list array index with the given elist\n+ * instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param index\n+ * elist array index to be set\n+ * @param elist\n+ * event list instance of struct rte_epoll_event\n+ *\n+ * @return\n+ * - On success, zero.\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, int index,\n+\t\t\t struct rte_epoll_event elist);\n+\n+/**\n+ * @internal\n+ * Returns the address of elist instance of event list array at a given index.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param index\n+ * elist array index to be returned\n+ *\n+ * @return\n+ * - On success, elist\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+struct rte_epoll_event *\n+rte_intr_elist_index_get(struct rte_intr_handle *intr_handle, int index);\n+\n+/**\n+ * @internal\n+ * Allocates the memory of interrupt vector list array, with size defining the\n+ * no of elements required in the array.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param name\n+ * Name assigned to the allocation, or NULL.\n+ * @param size\n+ * No of element required in the array.\n+ *\n+ * @return\n+ * - On success, zero\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, const char *name,\n+\t\t\tint size);\n+\n+/**\n+ * @internal\n+ * Sets the vector value at given index of interrupt vector list field of given\n+ * interrupt handle.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param index\n+ * intr_vec array index to be set\n+ * @param vec\n+ * Interrupt vector value.\n+ *\n+ * @return\n+ * - On success, zero\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_vec_list_index_set(struct rte_intr_handle *intr_handle, int index,\n+\t\t\t int vec);\n+\n+/**\n+ * @internal\n+ * Returns the vector value at the given index of interrupt vector list array.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param index\n+ * intr_vec array index to be returned\n+ *\n+ * @return\n+ * - On success, interrupt vector\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_vec_list_index_get(const struct rte_intr_handle *intr_handle,\n+\t\t\t int index);\n+\n+/**\n+ * @internal\n+ * Freeing the memory allocated for interrupt vector list array.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, zero\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+void\n+rte_intr_vec_list_free(struct rte_intr_handle *intr_handle);\n+\n+/**\n+ * @internal\n+ * Reallocates the size efds and elist array based on size provided by user.\n+ * By default efds and elist array are allocated with default size\n+ * RTE_MAX_RXTX_INTR_VEC_ID on interrupt handle array creation. Later on device\n+ * probe, device may have capability of more interrupts than\n+ * RTE_MAX_RXTX_INTR_VEC_ID. Hence using this API, PMDs can reallocate the\n+ * arrays as per the max interrupts capability of device.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ * @param size\n+ * efds and elist array size.\n+ *\n+ * @return\n+ * - On success, zero\n+ * - On failure, a negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size);\n+\n+/**\n+ * @internal\n+ * This API returns the sources from where memory is allocated for interrupt\n+ * instance.\n+ *\n+ * @param intr_handle\n+ * pointer to the interrupt handle.\n+ *\n+ * @return\n+ * - On success, 1 corresponds to memory allocated via DPDK allocator APIs\n+ * - On success, 0 corresponds to memory allocated from traditional heap.\n+ * - On failure, negative value.\n+ */\n+__rte_internal\n+int\n+rte_intr_instance_mem_allocator_get(const struct rte_intr_handle *intr_handle);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex 38f7de83e1..4c11202faf 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -109,18 +109,10 @@ DPDK_22 {\n \trte_hexdump;\n \trte_hypervisor_get;\n \trte_hypervisor_get_name; # WINDOWS_NO_EXPORT\n-\trte_intr_allow_others;\n \trte_intr_callback_register;\n \trte_intr_callback_unregister;\n-\trte_intr_cap_multiple;\n-\trte_intr_disable;\n-\trte_intr_dp_is_en;\n-\trte_intr_efd_disable;\n-\trte_intr_efd_enable;\n \trte_intr_enable;\n-\trte_intr_free_epoll_fd;\n-\trte_intr_rx_ctl;\n-\trte_intr_tls_epfd;\n+\trte_intr_disable;\n \trte_keepalive_create; # WINDOWS_NO_EXPORT\n \trte_keepalive_dispatch_pings; # WINDOWS_NO_EXPORT\n \trte_keepalive_mark_alive; # WINDOWS_NO_EXPORT\n@@ -420,6 +412,14 @@ EXPERIMENTAL {\n \n \t# added in 21.08\n \trte_power_monitor_multi; # WINDOWS_NO_EXPORT\n+\n+\t# added in 21.11\n+\trte_intr_fd_set;\n+\trte_intr_fd_get;\n+\trte_intr_type_set;\n+\trte_intr_type_get;\n+\trte_intr_instance_alloc;\n+\trte_intr_instance_free;\n };\n \n INTERNAL {\n@@ -430,4 +430,32 @@ INTERNAL {\n \trte_mem_map;\n \trte_mem_page_size;\n \trte_mem_unmap;\n+\trte_intr_cap_multiple;\n+\trte_intr_dp_is_en;\n+\trte_intr_efd_disable;\n+\trte_intr_efd_enable;\n+\trte_intr_free_epoll_fd;\n+\trte_intr_rx_ctl;\n+\trte_intr_allow_others;\n+\trte_intr_tls_epfd;\n+\trte_intr_dev_fd_set;\n+\trte_intr_dev_fd_get;\n+\trte_intr_instance_copy;\n+\trte_intr_event_list_update;\n+\trte_intr_max_intr_set;\n+\trte_intr_max_intr_get;\n+\trte_intr_nb_efd_set;\n+\trte_intr_nb_efd_get;\n+\trte_intr_nb_intr_get;\n+\trte_intr_efds_index_set;\n+\trte_intr_efds_index_get;\n+\trte_intr_elist_index_set;\n+\trte_intr_elist_index_get;\n+\trte_intr_efd_counter_size_set;\n+\trte_intr_efd_counter_size_get;\n+\trte_intr_vec_list_alloc;\n+\trte_intr_vec_list_index_set;\n+\trte_intr_vec_list_index_get;\n+\trte_intr_vec_list_free;\n+\trte_intr_instance_mem_allocator_get;\n };\n", "prefixes": [ "v2", "1/6" ] }{ "id": 100494, "url": "