get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55616,
    "url": "http://patches.dpdk.org/api/patches/55616/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190628182354.228-12-pbhagavatula@marvell.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": "<20190628182354.228-12-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190628182354.228-12-pbhagavatula@marvell.com",
    "date": "2019-06-28T18:23:22",
    "name": "[v3,11/42] event/octeontx2: add SSO GWS and GGRP IRQ handlers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "29c01279f3b0f3858e9b978b66d6d8b516ece21f",
    "submitter": {
        "id": 1183,
        "url": "http://patches.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerin.jacob@caviumnetworks.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190628182354.228-12-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 5227,
            "url": "http://patches.dpdk.org/api/series/5227/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5227",
            "date": "2019-06-28T18:23:11",
            "name": "OCTEONTX2 event device driver",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/5227/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55616/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55616/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "X-BeenThere": "dev@dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "MIME-Version": "1.0",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "<pbhagavatula@marvell.com>",
        "To": "<jerinj@marvell.com>, Pavan Nikhilesh <pbhagavatula@marvell.com>",
        "CC": "<dev@dpdk.org>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-28_08:, , signatures=0",
        "In-Reply-To": "<20190628182354.228-1-pbhagavatula@marvell.com>",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=PNmLe3aGudFr+eduOHs9mC1iQ2N4UEYVpQEF2h1orpw=;\n\tb=qes+Tz2ABI5kO9gmSxH1ETiBY/+D5Mr6r2X7DCP2ZSGuyar1/qgYn/u/pRPbSLF2hojs\n\tangpbv2iWMPTCOU57SDsql4VeOQAQEkc7X7dkFLq1vbMR37agKn0d4ONFA7mcmaZGT6F\n\tHVENa5FxCk88PWs2ghhvp1NDYxuloJxWn5q7bhoFJ794OEdVbrmT2Gg5aZrf8ar8Wmxn\n\ts6DhRw9fz/Wr28gIISc6LwoBCq21cYJWScepqfhRubrlrMSO6ST+bn131ArRfOw9TUSb\n\t7chrP1WH0AH97DFczqmiSnPUIcs7pqn4i/KmjCQVvzmv7Mrp8aqcsR41qubGBqaUZX2R\n\tRw== ",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DD4511B9B7;\n\tFri, 28 Jun 2019 20:24:39 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 7AA141B99C\n\tfor <dev@dpdk.org>; Fri, 28 Jun 2019 20:24:25 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx5SILBYn011342 for <dev@dpdk.org>; Fri, 28 Jun 2019 11:24:24 -0700",
            "from sc-exch01.marvell.com ([199.233.58.181])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2tdd77agjw-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n\tfor <dev@dpdk.org>; Fri, 28 Jun 2019 11:24:24 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tFri, 28 Jun 2019 11:24:23 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Fri, 28 Jun 2019 11:24:23 -0700",
            "from BG-LT7430.marvell.com (unknown [10.28.17.12])\n\tby maili.marvell.com (Postfix) with ESMTP id ABAF83F7040;\n\tFri, 28 Jun 2019 11:24:21 -0700 (PDT)"
        ],
        "X-Original-To": "patchwork@dpdk.org",
        "Content-Type": "text/plain",
        "Message-ID": "<20190628182354.228-12-pbhagavatula@marvell.com>",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Version": "2.1.15",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20190628182354.228-1-pbhagavatula@marvell.com>",
        "Subject": "[dpdk-dev] [PATCH v3 11/42] event/octeontx2: add SSO GWS and GGRP\n\tIRQ handlers",
        "Date": "Fri, 28 Jun 2019 23:53:22 +0530",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Precedence": "list"
    },
    "content": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nRegister and implement SSO GWS and GGRP IRQ handlers for error\ninterrupts.\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\n---\n drivers/event/octeontx2/Makefile         |   1 +\n drivers/event/octeontx2/meson.build      |   4 +-\n drivers/event/octeontx2/otx2_evdev.c     |  38 +++++\n drivers/event/octeontx2/otx2_evdev.h     |   6 +\n drivers/event/octeontx2/otx2_evdev_irq.c | 175 +++++++++++++++++++++++\n 5 files changed, 223 insertions(+), 1 deletion(-)\n create mode 100644 drivers/event/octeontx2/otx2_evdev_irq.c",
    "diff": "diff --git a/drivers/event/octeontx2/Makefile b/drivers/event/octeontx2/Makefile\nindex 58853e1b9..4f09c1fc8 100644\n--- a/drivers/event/octeontx2/Makefile\n+++ b/drivers/event/octeontx2/Makefile\n@@ -31,6 +31,7 @@ LIBABIVER := 1\n #\n \n SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_evdev.c\n+SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EVENTDEV) += otx2_evdev_irq.c\n \n LDLIBS += -lrte_eal -lrte_bus_pci -lrte_pci -lrte_kvargs\n LDLIBS += -lrte_mempool -lrte_eventdev -lrte_mbuf\ndiff --git a/drivers/event/octeontx2/meson.build b/drivers/event/octeontx2/meson.build\nindex 3fc96421d..5aa8113bd 100644\n--- a/drivers/event/octeontx2/meson.build\n+++ b/drivers/event/octeontx2/meson.build\n@@ -2,7 +2,9 @@\n # Copyright(C) 2019 Marvell International Ltd.\n #\n \n-sources = files('otx2_evdev.c')\n+sources = files('otx2_evdev.c',\n+\t\t'otx2_evdev_irq.c',\n+\t\t)\n \n allow_experimental_apis = true\n \ndiff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c\nindex ef6693bc5..b92bf0407 100644\n--- a/drivers/event/octeontx2/otx2_evdev.c\n+++ b/drivers/event/octeontx2/otx2_evdev.c\n@@ -13,6 +13,29 @@\n #include <rte_pci.h>\n \n #include \"otx2_evdev.h\"\n+#include \"otx2_irq.h\"\n+\n+static inline int\n+sso_get_msix_offsets(const struct rte_eventdev *event_dev)\n+{\n+\tstruct otx2_sso_evdev *dev = sso_pmd_priv(event_dev);\n+\tuint8_t nb_ports = dev->nb_event_ports;\n+\tstruct otx2_mbox *mbox = dev->mbox;\n+\tstruct msix_offset_rsp *msix_rsp;\n+\tint i, rc;\n+\n+\t/* Get SSO and SSOW MSIX vector offsets */\n+\totx2_mbox_alloc_msg_msix_offset(mbox);\n+\trc = otx2_mbox_process_msg(mbox, (void *)&msix_rsp);\n+\n+\tfor (i = 0; i < nb_ports; i++)\n+\t\tdev->ssow_msixoff[i] = msix_rsp->ssow_msixoff[i];\n+\n+\tfor (i = 0; i < dev->nb_event_queues; i++)\n+\t\tdev->sso_msixoff[i] = msix_rsp->sso_msixoff[i];\n+\n+\treturn rc;\n+}\n \n static void\n otx2_sso_info_get(struct rte_eventdev *event_dev,\n@@ -491,6 +514,9 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)\n \t\treturn -EINVAL;\n \t}\n \n+\tif (dev->configured)\n+\t\tsso_unregister_irqs(event_dev);\n+\n \tif (dev->nb_event_queues) {\n \t\t/* Finit any previous queues. */\n \t\tsso_lf_teardown(dev, SSO_LF_GGRP);\n@@ -527,6 +553,18 @@ otx2_sso_configure(const struct rte_eventdev *event_dev)\n \t\tgoto teardown_hwggrp;\n \t}\n \n+\trc = sso_get_msix_offsets(event_dev);\n+\tif (rc < 0) {\n+\t\totx2_err(\"Failed to get msix offsets %d\", rc);\n+\t\tgoto teardown_hwggrp;\n+\t}\n+\n+\trc = sso_register_irqs(event_dev);\n+\tif (rc < 0) {\n+\t\totx2_err(\"Failed to register irq %d\", rc);\n+\t\tgoto teardown_hwggrp;\n+\t}\n+\n \tdev->configured = 1;\n \trte_mb();\n \ndiff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h\nindex 1a9de1b86..e1d2dcc69 100644\n--- a/drivers/event/octeontx2/otx2_evdev.h\n+++ b/drivers/event/octeontx2/otx2_evdev.h\n@@ -105,6 +105,9 @@ struct otx2_sso_evdev {\n \tuint32_t xae_waes;\n \tuint32_t xaq_buf_size;\n \tuint32_t iue;\n+\t/* MSIX offsets */\n+\tuint16_t sso_msixoff[OTX2_SSO_MAX_VHGRP];\n+\tuint16_t ssow_msixoff[OTX2_SSO_MAX_VHWS];\n } __rte_cache_aligned;\n \n #define OTX2_SSOGWS_OPS \\\n@@ -148,5 +151,8 @@ parse_kvargs_value(const char *key, const char *value, void *opaque)\n /* Init and Fini API's */\n int otx2_sso_init(struct rte_eventdev *event_dev);\n int otx2_sso_fini(struct rte_eventdev *event_dev);\n+/* IRQ handlers */\n+int sso_register_irqs(const struct rte_eventdev *event_dev);\n+void sso_unregister_irqs(const struct rte_eventdev *event_dev);\n \n #endif /* __OTX2_EVDEV_H__ */\ndiff --git a/drivers/event/octeontx2/otx2_evdev_irq.c b/drivers/event/octeontx2/otx2_evdev_irq.c\nnew file mode 100644\nindex 000000000..7df21cc24\n--- /dev/null\n+++ b/drivers/event/octeontx2/otx2_evdev_irq.c\n@@ -0,0 +1,175 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2019 Marvell International Ltd.\n+ */\n+\n+#include \"otx2_evdev.h\"\n+\n+static void\n+sso_lf_irq(void *param)\n+{\n+\tuintptr_t base = (uintptr_t)param;\n+\tuint64_t intr;\n+\tuint8_t ggrp;\n+\n+\tggrp = (base >> 12) & 0xFF;\n+\n+\tintr = otx2_read64(base + SSO_LF_GGRP_INT);\n+\tif (intr == 0)\n+\t\treturn;\n+\n+\totx2_err(\"GGRP %d GGRP_INT=0x%\" PRIx64 \"\", ggrp, intr);\n+\n+\t/* Clear interrupt */\n+\totx2_write64(intr, base + SSO_LF_GGRP_INT);\n+}\n+\n+static int\n+sso_lf_register_irq(const struct rte_eventdev *event_dev, uint16_t ggrp_msixoff,\n+\t\t    uintptr_t base)\n+{\n+\tstruct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(event_dev->dev);\n+\tstruct rte_intr_handle *handle = &pci_dev->intr_handle;\n+\tint rc, vec;\n+\n+\tvec = ggrp_msixoff + SSO_LF_INT_VEC_GRP;\n+\n+\t/* Clear err interrupt */\n+\totx2_write64(~0ull, base + SSO_LF_GGRP_INT_ENA_W1C);\n+\t/* Set used interrupt vectors */\n+\trc = otx2_register_irq(handle, sso_lf_irq, (void *)base, vec);\n+\t/* Enable hw interrupt */\n+\totx2_write64(~0ull, base + SSO_LF_GGRP_INT_ENA_W1S);\n+\n+\treturn rc;\n+}\n+\n+static void\n+ssow_lf_irq(void *param)\n+{\n+\tuintptr_t base = (uintptr_t)param;\n+\tuint8_t gws = (base >> 12) & 0xFF;\n+\tuint64_t intr;\n+\n+\tintr = otx2_read64(base + SSOW_LF_GWS_INT);\n+\tif (intr == 0)\n+\t\treturn;\n+\n+\totx2_err(\"GWS %d GWS_INT=0x%\" PRIx64 \"\", gws, intr);\n+\n+\t/* Clear interrupt */\n+\totx2_write64(intr, base + SSOW_LF_GWS_INT);\n+}\n+\n+static int\n+ssow_lf_register_irq(const struct rte_eventdev *event_dev, uint16_t gws_msixoff,\n+\t\t     uintptr_t base)\n+{\n+\tstruct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(event_dev->dev);\n+\tstruct rte_intr_handle *handle = &pci_dev->intr_handle;\n+\tint rc, vec;\n+\n+\tvec = gws_msixoff + SSOW_LF_INT_VEC_IOP;\n+\n+\t/* Clear err interrupt */\n+\totx2_write64(~0ull, base + SSOW_LF_GWS_INT_ENA_W1C);\n+\t/* Set used interrupt vectors */\n+\trc = otx2_register_irq(handle, ssow_lf_irq, (void *)base, vec);\n+\t/* Enable hw interrupt */\n+\totx2_write64(~0ull, base + SSOW_LF_GWS_INT_ENA_W1S);\n+\n+\treturn rc;\n+}\n+\n+static void\n+sso_lf_unregister_irq(const struct rte_eventdev *event_dev,\n+\t\t      uint16_t ggrp_msixoff, uintptr_t base)\n+{\n+\tstruct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(event_dev->dev);\n+\tstruct rte_intr_handle *handle = &pci_dev->intr_handle;\n+\tint vec;\n+\n+\tvec = ggrp_msixoff + SSO_LF_INT_VEC_GRP;\n+\n+\t/* Clear err interrupt */\n+\totx2_write64(~0ull, base + SSO_LF_GGRP_INT_ENA_W1C);\n+\totx2_unregister_irq(handle, sso_lf_irq, (void *)base, vec);\n+}\n+\n+static void\n+ssow_lf_unregister_irq(const struct rte_eventdev *event_dev,\n+\t\t       uint16_t gws_msixoff, uintptr_t base)\n+{\n+\tstruct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(event_dev->dev);\n+\tstruct rte_intr_handle *handle = &pci_dev->intr_handle;\n+\tint vec;\n+\n+\tvec = gws_msixoff + SSOW_LF_INT_VEC_IOP;\n+\n+\t/* Clear err interrupt */\n+\totx2_write64(~0ull, base + SSOW_LF_GWS_INT_ENA_W1C);\n+\totx2_unregister_irq(handle, ssow_lf_irq, (void *)base, vec);\n+}\n+\n+int\n+sso_register_irqs(const struct rte_eventdev *event_dev)\n+{\n+\tstruct otx2_sso_evdev *dev = sso_pmd_priv(event_dev);\n+\tint i, rc = -EINVAL;\n+\tuint8_t nb_ports;\n+\n+\tnb_ports = dev->nb_event_ports;\n+\n+\tfor (i = 0; i < dev->nb_event_queues; i++) {\n+\t\tif (dev->sso_msixoff[i] == MSIX_VECTOR_INVALID) {\n+\t\t\totx2_err(\"Invalid SSOLF MSIX offset[%d] vector: 0x%x\",\n+\t\t\t\t i, dev->sso_msixoff[i]);\n+\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < nb_ports; i++) {\n+\t\tif (dev->ssow_msixoff[i] == MSIX_VECTOR_INVALID) {\n+\t\t\totx2_err(\"Invalid SSOWLF MSIX offset[%d] vector: 0x%x\",\n+\t\t\t\t i, dev->ssow_msixoff[i]);\n+\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < dev->nb_event_queues; i++) {\n+\t\tuintptr_t base = dev->bar2 + (RVU_BLOCK_ADDR_SSO << 20 |\n+\t\t\t\t\t      i << 12);\n+\t\trc = sso_lf_register_irq(event_dev, dev->sso_msixoff[i], base);\n+\t}\n+\n+\tfor (i = 0; i < nb_ports; i++) {\n+\t\tuintptr_t base = dev->bar2 + (RVU_BLOCK_ADDR_SSOW << 20 |\n+\t\t\t\t\t      i << 12);\n+\t\trc = ssow_lf_register_irq(event_dev, dev->ssow_msixoff[i],\n+\t\t\t\t\t  base);\n+\t}\n+\n+fail:\n+\treturn rc;\n+}\n+\n+void\n+sso_unregister_irqs(const struct rte_eventdev *event_dev)\n+{\n+\tstruct otx2_sso_evdev *dev = sso_pmd_priv(event_dev);\n+\tuint8_t nb_ports;\n+\tint i;\n+\n+\tnb_ports = dev->nb_event_ports;\n+\n+\tfor (i = 0; i < dev->nb_event_queues; i++) {\n+\t\tuintptr_t base = dev->bar2 + (RVU_BLOCK_ADDR_SSO << 20 |\n+\t\t\t\t\t      i << 12);\n+\t\tsso_lf_unregister_irq(event_dev, dev->sso_msixoff[i], base);\n+\t}\n+\n+\tfor (i = 0; i < nb_ports; i++) {\n+\t\tuintptr_t base = dev->bar2 + (RVU_BLOCK_ADDR_SSOW << 20 |\n+\t\t\t\t\t      i << 12);\n+\t\tssow_lf_unregister_irq(event_dev, dev->ssow_msixoff[i], base);\n+\t}\n+}\n",
    "prefixes": [
        "v3",
        "11/42"
    ]
}