get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 135785,
    "url": "https://patches.dpdk.org/api/patches/135785/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240107153454.3909-8-syalavarthi@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": "<20240107153454.3909-8-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240107153454.3909-8-syalavarthi@marvell.com",
    "date": "2024-01-07T15:34:46",
    "name": "[07/11] event/ml: add adapter start and stop",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "062415d880596cd1ad9c5f26503573bd535e7de2",
    "submitter": {
        "id": 2480,
        "url": "https://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240107153454.3909-8-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 30752,
            "url": "https://patches.dpdk.org/api/series/30752/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30752",
            "date": "2024-01-07T15:34:39",
            "name": "Introduce Event ML Adapter",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/30752/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/135785/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/135785/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 C0C6443857;\n\tSun,  7 Jan 2024 16:36:05 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0F13740A81;\n\tSun,  7 Jan 2024 16:35:28 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 94F054069D\n for <dev@dpdk.org>; Sun,  7 Jan 2024 16:35:24 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 407DlRPv022570 for <dev@dpdk.org>; Sun, 7 Jan 2024 07:35:24 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3vf78n2a1r-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Sun, 07 Jan 2024 07:35:23 -0800 (PST)",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Sun, 7 Jan 2024 07:35:22 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Sun, 7 Jan 2024 07:35:22 -0800",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id ED60C3F7093;\n Sun,  7 Jan 2024 07:35:21 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding:content-type; s=\n pfpt0220; bh=8RbFeghdMuxTooKD8XM+VT5OGWAe2K0clJ3WYfscLyM=; b=UHr\n ywZt0P2/SWaEKexJYNJaGLHWI/o5VQFtQkmXCddl5TBq7w2KuZUfOl1wZtXiNIRI\n 9VS+sR3xMWe3uSn3rM57q8mleTBfS0GYUD1jd5j2K3Rme8xeWuRnJHbQRhmfsSoh\n q6mzJZ4uRAO56nGNmETgqaLLydKx6QKKm/ux04lvDPbLtOH5LNnrf3DFBcIwOc/P\n 4KgPnpZG0cwDMWGgdH8zn5t0Bfyr7AEs5BomdtBgKpmYR5gTYH+YRXnHZg9xRMDq\n dGIgKoEmHa8ctypshwN92KATurs50w4/YsVjkot4zVPPnLH1wwQJo5t0LWPZMRn+\n O0qb5NE70nma14WvdcQ==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Srikanth Yalavarthi\n <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <aprabhu@marvell.com>, <sshankarnara@marvell.com>,\n <ptakkar@marvell.com>",
        "Subject": "[PATCH 07/11] event/ml: add adapter start and stop",
        "Date": "Sun, 7 Jan 2024 07:34:46 -0800",
        "Message-ID": "<20240107153454.3909-8-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.42.0",
        "In-Reply-To": "<20240107153454.3909-1-syalavarthi@marvell.com>",
        "References": "<20240107153454.3909-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "Bo20HX__XF6x_DgPA7zB6XBtPqBjElUi",
        "X-Proofpoint-GUID": "Bo20HX__XF6x_DgPA7zB6XBtPqBjElUi",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02",
        "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"
    },
    "content": "Added ML adapter start and stop functions.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n lib/eventdev/eventdev_pmd.h         | 42 ++++++++++++++++\n lib/eventdev/rte_event_ml_adapter.c | 75 +++++++++++++++++++++++++++++\n 2 files changed, 117 insertions(+)",
    "diff": "diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h\nindex 48e970a5097..44f26473075 100644\n--- a/lib/eventdev/eventdev_pmd.h\n+++ b/lib/eventdev/eventdev_pmd.h\n@@ -1599,6 +1599,44 @@ typedef int (*eventdev_ml_adapter_queue_pair_del_t)(const struct rte_eventdev *d\n \t\t\t\t\t\t    const struct rte_ml_dev *cdev,\n \t\t\t\t\t\t    int32_t queue_pair_id);\n \n+/**\n+ * Start ML adapter. This callback is invoked if\n+ * the caps returned from rte_event_ml_adapter_caps_get(.., mldev_id)\n+ * has RTE_EVENT_ML_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs\n+ * from mldev_id have been added to the event device.\n+ *\n+ * @param dev\n+ *   Event device pointer\n+ *\n+ * @param mldev\n+ *   ML device pointer\n+ *\n+ * @return\n+ *   - 0: Success, ML adapter started successfully.\n+ *   - <0: Error code returned by the driver function.\n+ */\n+typedef int (*eventdev_ml_adapter_start_t)(const struct rte_eventdev *dev,\n+\t\t\t\t\t   const struct rte_ml_dev *mldev);\n+\n+/**\n+ * Stop ML adapter. This callback is invoked if\n+ * the caps returned from rte_event_ml_adapter_caps_get(.., mldev_id)\n+ * has RTE_EVENT_ML_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs\n+ * from mldev_id have been added to the event device.\n+ *\n+ * @param dev\n+ *   Event device pointer\n+ *\n+ * @param mldev\n+ *   ML device pointer\n+ *\n+ * @return\n+ *   - 0: Success, ML adapter stopped successfully.\n+ *   - <0: Error code returned by the driver function.\n+ */\n+typedef int (*eventdev_ml_adapter_stop_t)(const struct rte_eventdev *dev,\n+\t\t\t\t\t  const struct rte_ml_dev *mldev);\n+\n /** Event device operations function pointer table */\n struct eventdev_ops {\n \teventdev_info_get_t dev_infos_get;\t/**< Get device info. */\n@@ -1744,6 +1782,10 @@ struct eventdev_ops {\n \t/**< Add queue pair to ML adapter */\n \teventdev_ml_adapter_queue_pair_del_t ml_adapter_queue_pair_del;\n \t/**< Delete queue pair from ML adapter */\n+\teventdev_ml_adapter_start_t ml_adapter_start;\n+\t/**< Start ML adapter */\n+\teventdev_ml_adapter_stop_t ml_adapter_stop;\n+\t/**< Stop ML adapter */\n \n \teventdev_selftest dev_selftest;\n \t/**< Start eventdev Selftest */\ndiff --git a/lib/eventdev/rte_event_ml_adapter.c b/lib/eventdev/rte_event_ml_adapter.c\nindex 95f566b1025..60c10caef68 100644\n--- a/lib/eventdev/rte_event_ml_adapter.c\n+++ b/lib/eventdev/rte_event_ml_adapter.c\n@@ -61,6 +61,14 @@ struct ml_device_info {\n \n \t/* Next queue pair to be processed */\n \tuint16_t next_queue_pair_id;\n+\n+\t/* Set to indicate processing has been started */\n+\tuint8_t dev_started;\n+\n+\t/* Set to indicate mldev->eventdev packet\n+\t * transfer uses a hardware mechanism\n+\t */\n+\tuint8_t internal_event_port;\n } __rte_cache_aligned;\n \n struct event_ml_adapter {\n@@ -1071,3 +1079,70 @@ rte_event_ml_adapter_queue_pair_del(uint8_t id, int16_t mldev_id, int32_t queue_\n \n \treturn ret;\n }\n+\n+static int\n+emla_adapter_ctrl(uint8_t id, int start)\n+{\n+\tstruct event_ml_adapter *adapter;\n+\tstruct ml_device_info *dev_info;\n+\tstruct rte_eventdev *dev;\n+\tint stop = !start;\n+\tint use_service;\n+\tuint32_t i;\n+\n+\tif (!emla_valid_id(id)) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid ML adapter id = %d\", id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tadapter = emla_id_to_adapter(id);\n+\tif (adapter == NULL)\n+\t\treturn -EINVAL;\n+\n+\tdev = &rte_eventdevs[adapter->eventdev_id];\n+\n+\tuse_service = 0;\n+\tfor (i = 0; i < rte_ml_dev_count(); i++) {\n+\t\tdev_info = &adapter->mldevs[i];\n+\t\t/* if start  check for num queue pairs */\n+\t\tif (start && !dev_info->num_qpairs)\n+\t\t\tcontinue;\n+\t\t/* if stop check if dev has been started */\n+\t\tif (stop && !dev_info->dev_started)\n+\t\t\tcontinue;\n+\t\tuse_service |= !dev_info->internal_event_port;\n+\t\tdev_info->dev_started = start;\n+\t\tif (dev_info->internal_event_port == 0)\n+\t\t\tcontinue;\n+\t\tstart ? (*dev->dev_ops->ml_adapter_start)(dev, &dev_info->dev[i]) :\n+\t\t\t(*dev->dev_ops->ml_adapter_stop)(dev, &dev_info->dev[i]);\n+\t}\n+\n+\tif (use_service)\n+\t\trte_service_runstate_set(adapter->service_id, start);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_event_ml_adapter_start(uint8_t id)\n+{\n+\tstruct event_ml_adapter *adapter;\n+\n+\tif (!emla_valid_id(id)) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid ML adapter id = %d\", id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tadapter = emla_id_to_adapter(id);\n+\tif (adapter == NULL)\n+\t\treturn -EINVAL;\n+\n+\treturn emla_adapter_ctrl(id, 1);\n+}\n+\n+int\n+rte_event_ml_adapter_stop(uint8_t id)\n+{\n+\treturn emla_adapter_ctrl(id, 0);\n+}\n",
    "prefixes": [
        "07/11"
    ]
}