get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/102718/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 102718,
    "url": "http://patches.dpdk.org/api/patches/102718/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211024200449.12024-10-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20211024200449.12024-10-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211024200449.12024-10-david.marchand@redhat.com",
    "date": "2021-10-24T20:04:49",
    "name": "[v6,9/9] interrupts: extend event list",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8eef2e90f3740e733c120f4610b97cce1afbc05f",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211024200449.12024-10-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 19934,
            "url": "http://patches.dpdk.org/api/series/19934/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19934",
            "date": "2021-10-24T20:04:40",
            "name": "make rte_intr_handle internal",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/19934/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/102718/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/102718/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 F1D45A0C41;\n\tSun, 24 Oct 2021 22:08:00 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DB56B40E5A;\n\tSun, 24 Oct 2021 22:08:00 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 9448840141\n for <dev@dpdk.org>; Sun, 24 Oct 2021 22:07:59 +0200 (CEST)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-270-eoGNKp4rO4SpEkG6gvZTYA-1; Sun, 24 Oct 2021 16:07:53 -0400",
            "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com\n [10.5.11.14])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA11A802B78;\n Sun, 24 Oct 2021 20:07:51 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.192.64])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 76FD15D9D5;\n Sun, 24 Oct 2021 20:07:48 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1635106079;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=C9E29sh+gVeLJYlzSxb/YeK1eID1Y2jiM4LH1js/ASE=;\n b=M7zWY6CxB8+vgUg+r8kgbmwcerAAzybRBTiASlj+COaD7WL97+hpGQeNH/S39qBElAdptA\n UA8Seh6UK1yISHs2Q2TDtRbT9bXe1QjmcKOBGs/i5u+0hwkyIyxhtOufFDikIVGwGNCNac\n w0wnkcDKmoaiaWdzZgrjEsUxixcDbs0=",
        "X-MC-Unique": "eoGNKp4rO4SpEkG6gvZTYA-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "hkalra@marvell.com,\n\tdev@dpdk.org",
        "Cc": "dmitry.kozliuk@gmail.com, Anatoly Burakov <anatoly.burakov@intel.com>,\n Nithin Dabilpuram <ndabilpuram@marvell.com>,\n Kiran Kumar K <kirankumark@marvell.com>,\n Sunil Kumar Kori <skori@marvell.com>, Satha Rao <skoteshwar@marvell.com>",
        "Date": "Sun, 24 Oct 2021 22:04:49 +0200",
        "Message-Id": "<20211024200449.12024-10-david.marchand@redhat.com>",
        "In-Reply-To": "<20211024200449.12024-1-david.marchand@redhat.com>",
        "References": "<20211022204934.132186-1-hkalra@marvell.com>\n <20211024200449.12024-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [PATCH v6 9/9] interrupts: extend event list",
        "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": "From: Harman Kalra <hkalra@marvell.com>\n\nDynamically allocating the efds and elist array os intr_handle\nstructure, based on size provided by user. Eg size can be\nMSIX interrupts supported by a PCI device.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nChanges since v5:\n- split from patch5,\n\n---\n drivers/bus/pci/linux/pci_vfio.c       |   6 ++\n drivers/common/cnxk/roc_platform.h     |   1 +\n lib/eal/common/eal_common_interrupts.c | 119 ++++++++++++++++++++++++-\n lib/eal/common/eal_interrupts.h        |   5 +-\n 4 files changed, 126 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c\nindex 7b2f8296c5..f622e7f8e6 100644\n--- a/drivers/bus/pci/linux/pci_vfio.c\n+++ b/drivers/bus/pci/linux/pci_vfio.c\n@@ -266,6 +266,12 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)\n \t\t\treturn -1;\n \t\t}\n \n+\t\t/* Reallocate the efds and elist fields of intr_handle based\n+\t\t * on PCI device MSIX size.\n+\t\t */\n+\t\tif (rte_intr_event_list_update(dev->intr_handle, irq.count))\n+\t\t\treturn -1;\n+\n \t\t/* if this vector cannot be used with eventfd, fail if we explicitly\n \t\t * specified interrupt type, otherwise continue */\n \t\tif ((irq.flags & VFIO_IRQ_INFO_EVENTFD) == 0) {\ndiff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h\nindex 60227b72d0..5da23fe5f8 100644\n--- a/drivers/common/cnxk/roc_platform.h\n+++ b/drivers/common/cnxk/roc_platform.h\n@@ -121,6 +121,7 @@\n #define plt_intr_instance_alloc\t\trte_intr_instance_alloc\n #define plt_intr_instance_dup\t\trte_intr_instance_dup\n #define plt_intr_instance_free\t\trte_intr_instance_free\n+#define plt_intr_event_list_update\trte_intr_event_list_update\n #define plt_intr_max_intr_get\t\trte_intr_max_intr_get\n #define plt_intr_max_intr_set\t\trte_intr_max_intr_set\n #define plt_intr_nb_efd_get\t\trte_intr_nb_efd_get\ndiff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c\nindex 3285c4335f..7feb9da8fa 100644\n--- a/lib/eal/common/eal_common_interrupts.c\n+++ b/lib/eal/common/eal_common_interrupts.c\n@@ -53,10 +53,46 @@ struct rte_intr_handle *rte_intr_instance_alloc(uint32_t flags)\n \t\treturn NULL;\n \t}\n \n+\tif (uses_rte_memory) {\n+\t\tintr_handle->efds = rte_zmalloc(NULL,\n+\t\t\tRTE_MAX_RXTX_INTR_VEC_ID * sizeof(int), 0);\n+\t} else {\n+\t\tintr_handle->efds = calloc(RTE_MAX_RXTX_INTR_VEC_ID,\n+\t\t\tsizeof(int));\n+\t}\n+\tif (intr_handle->efds == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Fail to allocate event fd list\\n\");\n+\t\trte_errno = ENOMEM;\n+\t\tgoto fail;\n+\t}\n+\n+\tif (uses_rte_memory) {\n+\t\tintr_handle->elist = rte_zmalloc(NULL,\n+\t\t\tRTE_MAX_RXTX_INTR_VEC_ID * sizeof(struct rte_epoll_event),\n+\t\t\t0);\n+\t} else {\n+\t\tintr_handle->elist = calloc(RTE_MAX_RXTX_INTR_VEC_ID,\n+\t\t\tsizeof(struct rte_epoll_event));\n+\t}\n+\tif (intr_handle->elist == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"fail to allocate event fd list\\n\");\n+\t\trte_errno = ENOMEM;\n+\t\tgoto fail;\n+\t}\n+\n \tintr_handle->alloc_flags = flags;\n \tintr_handle->nb_intr = RTE_MAX_RXTX_INTR_VEC_ID;\n \n \treturn intr_handle;\n+fail:\n+\tif (uses_rte_memory) {\n+\t\trte_free(intr_handle->efds);\n+\t\trte_free(intr_handle);\n+\t} else {\n+\t\tfree(intr_handle->efds);\n+\t\tfree(intr_handle);\n+\t}\n+\treturn NULL;\n }\n \n struct rte_intr_handle *rte_intr_instance_dup(const struct rte_intr_handle *src)\n@@ -83,14 +119,69 @@ struct rte_intr_handle *rte_intr_instance_dup(const struct rte_intr_handle *src)\n \treturn intr_handle;\n }\n \n+int rte_intr_event_list_update(struct rte_intr_handle *intr_handle, int size)\n+{\n+\tstruct rte_epoll_event *tmp_elist;\n+\tbool uses_rte_memory;\n+\tint *tmp_efds;\n+\n+\tCHECK_VALID_INTR_HANDLE(intr_handle);\n+\n+\tif (size == 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Size can't be zero\\n\");\n+\t\trte_errno = EINVAL;\n+\t\tgoto fail;\n+\t}\n+\n+\tuses_rte_memory =\n+\t\tRTE_INTR_INSTANCE_USES_RTE_MEMORY(intr_handle->alloc_flags);\n+\tif (uses_rte_memory) {\n+\t\ttmp_efds = rte_realloc(intr_handle->efds, size * sizeof(int),\n+\t\t\t0);\n+\t} else {\n+\t\ttmp_efds = realloc(intr_handle->efds, size * sizeof(int));\n+\t}\n+\tif (tmp_efds == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Failed to realloc the efds list\\n\");\n+\t\trte_errno = ENOMEM;\n+\t\tgoto fail;\n+\t}\n+\tintr_handle->efds = tmp_efds;\n+\n+\tif (uses_rte_memory) {\n+\t\ttmp_elist = rte_realloc(intr_handle->elist,\n+\t\t\tsize * sizeof(struct rte_epoll_event), 0);\n+\t} else {\n+\t\ttmp_elist = realloc(intr_handle->elist,\n+\t\t\tsize * sizeof(struct rte_epoll_event));\n+\t}\n+\tif (tmp_elist == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Failed to realloc the event list\\n\");\n+\t\trte_errno = ENOMEM;\n+\t\tgoto fail;\n+\t}\n+\tintr_handle->elist = tmp_elist;\n+\n+\tintr_handle->nb_intr = size;\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n void rte_intr_instance_free(struct rte_intr_handle *intr_handle)\n {\n \tif (intr_handle == NULL)\n \t\treturn;\n-\tif (RTE_INTR_INSTANCE_USES_RTE_MEMORY(intr_handle->alloc_flags))\n+\tif (RTE_INTR_INSTANCE_USES_RTE_MEMORY(intr_handle->alloc_flags)) {\n+\t\trte_free(intr_handle->efds);\n+\t\trte_free(intr_handle->elist);\n \t\trte_free(intr_handle);\n-\telse\n+\t} else {\n+\t\tfree(intr_handle->efds);\n+\t\tfree(intr_handle->elist);\n \t\tfree(intr_handle);\n+\t}\n }\n \n int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd)\n@@ -239,6 +330,12 @@ int rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle,\n {\n \tCHECK_VALID_INTR_HANDLE(intr_handle);\n \n+\tif (intr_handle->efds == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Event fd list not allocated\\n\");\n+\t\trte_errno = EFAULT;\n+\t\tgoto fail;\n+\t}\n+\n \tif (index >= intr_handle->nb_intr) {\n \t\tRTE_LOG(ERR, EAL, \"Invalid index %d, max limit %d\\n\", index,\n \t\t\tintr_handle->nb_intr);\n@@ -256,6 +353,12 @@ int rte_intr_efds_index_set(struct rte_intr_handle *intr_handle,\n {\n \tCHECK_VALID_INTR_HANDLE(intr_handle);\n \n+\tif (intr_handle->efds == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Event fd list not allocated\\n\");\n+\t\trte_errno = EFAULT;\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@@ -275,6 +378,12 @@ struct rte_epoll_event *rte_intr_elist_index_get(\n {\n \tCHECK_VALID_INTR_HANDLE(intr_handle);\n \n+\tif (intr_handle->elist == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Event list not allocated\\n\");\n+\t\trte_errno = EFAULT;\n+\t\tgoto fail;\n+\t}\n+\n \tif (index >= intr_handle->nb_intr) {\n \t\tRTE_LOG(ERR, EAL, \"Invalid index %d, max limit %d\\n\", index,\n \t\t\tintr_handle->nb_intr);\n@@ -292,6 +401,12 @@ int rte_intr_elist_index_set(struct rte_intr_handle *intr_handle,\n {\n \tCHECK_VALID_INTR_HANDLE(intr_handle);\n \n+\tif (intr_handle->elist == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Event list not allocated\\n\");\n+\t\trte_errno = EFAULT;\n+\t\tgoto fail;\n+\t}\n+\n \tif (index >= intr_handle->nb_intr) {\n \t\tRTE_LOG(ERR, EAL, \"Invalid index %d, max limit %d\\n\", index,\n \t\t\tintr_handle->nb_intr);\ndiff --git a/lib/eal/common/eal_interrupts.h b/lib/eal/common/eal_interrupts.h\nindex 1a4e5573b2..482781b862 100644\n--- a/lib/eal/common/eal_interrupts.h\n+++ b/lib/eal/common/eal_interrupts.h\n@@ -21,9 +21,8 @@ struct rte_intr_handle {\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+\tint *efds;  /**< intr vectors/efds mapping */\n+\tstruct rte_epoll_event *elist; /**< intr vector epoll event */\n \tuint16_t vec_list_size;\n \tint *intr_vec;                 /**< intr vector number array */\n };\n",
    "prefixes": [
        "v6",
        "9/9"
    ]
}