Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/100565/?format=api
http://patches.dpdk.org/api/patches/100565/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211006065012.16508-4-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": "<20211006065012.16508-4-pbhagavatula@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211006065012.16508-4-pbhagavatula@marvell.com", "date": "2021-10-06T06:50:01", "name": "[v3,04/14] eventdev: move inline APIs into separate structure", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "81bd69b6f2b0e2076d98d90d08c0665f7eb96fdd", "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": "jerinj@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211006065012.16508-4-pbhagavatula@marvell.com/mbox/", "series": [ { "id": 19405, "url": "http://patches.dpdk.org/api/series/19405/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19405", "date": "2021-10-06T06:49:58", "name": "[v3,01/14] eventdev: make driver interface as internal", "version": 3, "mbox": "http://patches.dpdk.org/series/19405/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/100565/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/100565/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 8D867A0C45;\n\tWed, 6 Oct 2021 08:51:20 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DBDA3413FB;\n\tWed, 6 Oct 2021 08:51:07 +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 5D66C413FB\n for <dev@dpdk.org>; Wed, 6 Oct 2021 08:51:06 +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 195MBVQN012814;\n Tue, 5 Oct 2021 23:51:03 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 3bgy9d1mcf-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 05 Oct 2021 23:51:03 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Tue, 5 Oct 2021 23:51:01 -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 23:51:01 -0700", "from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176])\n by maili.marvell.com (Postfix) with ESMTP id 358113F707C;\n Tue, 5 Oct 2021 23:50:59 -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-transfer-encoding : content-type; s=pfpt0220;\n bh=OEAzPlm0XNyc9CcA0UmZmHRgmVB5NfBjcdKcUmreViw=;\n b=argwbvBzkIhJjwWv+d3S/tbsg1eVcAmiiXOpSrVZqB48on2hB1wCtAKZfegiPGj1EPkk\n 8SwpURwPh3ous53krHpclh+YZczJJbDngks4Gb0DNYvevBxlmYHxcKntH7vpXQVCs0Cu\n E/T9gWdO/AzlDiALUCuYo/Z6LiLWR/0TLmHQtB29Tzv39kqctNtv5aYEe/xfHXp0FRlx\n dlDsPcpWDeEcUfkRQ/FYib45gsC/fdy2DnFR75RE6cSH+v20u02PUJnsAJr1qQGhM1DJ\n HO0UkgIdg8tCfq5C2pn2F7RgGhbjfiDXgi4D+TaeLLJcAgRD8qkMZ2pOJO9+vaB0j0R8 /Q==", "From": "<pbhagavatula@marvell.com>", "To": "<jerinj@marvell.com>, Ray Kinsella <mdr@ashroe.eu>", "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>", "Date": "Wed, 6 Oct 2021 12:20:01 +0530", "Message-ID": "<20211006065012.16508-4-pbhagavatula@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20211006065012.16508-1-pbhagavatula@marvell.com>", "References": "<20211003082710.8398-1-pbhagavatula@marvell.com>\n <20211006065012.16508-1-pbhagavatula@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "vCst4cywpJ0ziDoZIlDluPEa7KSfQgrg", "X-Proofpoint-ORIG-GUID": "vCst4cywpJ0ziDoZIlDluPEa7KSfQgrg", "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_06,2021-10-04_01,2020-04-07_01", "Subject": "[dpdk-dev] [PATCH v3 04/14] eventdev: move inline APIs into\n separate structure", "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: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nMove fastpath inline function pointers from rte_eventdev into a\nseparate structure accessed via a flat array.\nThe intension is to make rte_eventdev and related structures private\nto avoid future API/ABI breakages.`\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\nAcked-by: Ray Kinsella <mdr@ashroe.eu>\n---\n lib/eventdev/eventdev_pmd.h | 38 +++++++++++\n lib/eventdev/eventdev_pmd_pci.h | 4 +-\n lib/eventdev/eventdev_private.c | 112 +++++++++++++++++++++++++++++++\n lib/eventdev/meson.build | 1 +\n lib/eventdev/rte_eventdev.c | 22 +++++-\n lib/eventdev/rte_eventdev_core.h | 28 ++++++++\n lib/eventdev/version.map | 6 ++\n 7 files changed, 209 insertions(+), 2 deletions(-)\n create mode 100644 lib/eventdev/eventdev_private.c", "diff": "diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h\nindex 7eb2aa0520..b188280778 100644\n--- a/lib/eventdev/eventdev_pmd.h\n+++ b/lib/eventdev/eventdev_pmd.h\n@@ -1189,4 +1189,42 @@ __rte_internal\n int\n rte_event_pmd_release(struct rte_eventdev *eventdev);\n \n+/**\n+ *\n+ * @internal\n+ * This is the last step of device probing.\n+ * It must be called after a port is allocated and initialized successfully.\n+ *\n+ * @param eventdev\n+ * New event device.\n+ */\n+__rte_internal\n+void\n+event_dev_probing_finish(struct rte_eventdev *eventdev);\n+\n+/**\n+ * Reset eventdevice fastpath APIs to dummy values.\n+ *\n+ * @param fp_ops\n+ * The *fp_ops* pointer to reset.\n+ */\n+__rte_internal\n+void\n+event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op);\n+\n+/**\n+ * Set eventdevice fastpath APIs to event device values.\n+ *\n+ * @param fp_ops\n+ * The *fp_ops* pointer to set.\n+ */\n+__rte_internal\n+void\n+event_dev_fp_ops_set(struct rte_event_fp_ops *fp_ops,\n+\t\t const struct rte_eventdev *dev);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n #endif /* _RTE_EVENTDEV_PMD_H_ */\ndiff --git a/lib/eventdev/eventdev_pmd_pci.h b/lib/eventdev/eventdev_pmd_pci.h\nindex 2f12a5eb24..499852db16 100644\n--- a/lib/eventdev/eventdev_pmd_pci.h\n+++ b/lib/eventdev/eventdev_pmd_pci.h\n@@ -67,8 +67,10 @@ rte_event_pmd_pci_probe_named(struct rte_pci_driver *pci_drv,\n \n \t/* Invoke PMD device initialization function */\n \tretval = devinit(eventdev);\n-\tif (retval == 0)\n+\tif (retval == 0) {\n+\t\tevent_dev_probing_finish(eventdev);\n \t\treturn 0;\n+\t}\n \n \tRTE_EDEV_LOG_ERR(\"driver %s: (vendor_id=0x%x device_id=0x%x)\"\n \t\t\t\" failed\", pci_drv->driver.name,\ndiff --git a/lib/eventdev/eventdev_private.c b/lib/eventdev/eventdev_private.c\nnew file mode 100644\nindex 0000000000..9084833847\n--- /dev/null\n+++ b/lib/eventdev/eventdev_private.c\n@@ -0,0 +1,112 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2021 Marvell.\n+ */\n+\n+#include \"eventdev_pmd.h\"\n+#include \"rte_eventdev.h\"\n+\n+static uint16_t\n+dummy_event_enqueue(__rte_unused void *port,\n+\t\t __rte_unused const struct rte_event *ev)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event enqueue requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_event_enqueue_burst(__rte_unused void *port,\n+\t\t\t __rte_unused const struct rte_event ev[],\n+\t\t\t __rte_unused uint16_t nb_events)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event enqueue burst requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_event_dequeue(__rte_unused void *port, __rte_unused struct rte_event *ev,\n+\t\t __rte_unused uint64_t timeout_ticks)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event dequeue requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_event_dequeue_burst(__rte_unused void *port,\n+\t\t\t __rte_unused struct rte_event ev[],\n+\t\t\t __rte_unused uint16_t nb_events,\n+\t\t\t __rte_unused uint64_t timeout_ticks)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event dequeue burst requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_event_tx_adapter_enqueue(__rte_unused void *port,\n+\t\t\t __rte_unused struct rte_event ev[],\n+\t\t\t __rte_unused uint16_t nb_events)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event Tx adapter enqueue requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_event_tx_adapter_enqueue_same_dest(__rte_unused void *port,\n+\t\t\t\t\t __rte_unused struct rte_event ev[],\n+\t\t\t\t\t __rte_unused uint16_t nb_events)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event Tx adapter enqueue same destination requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+static uint16_t\n+dummy_event_crypto_adapter_enqueue(__rte_unused void *port,\n+\t\t\t\t __rte_unused struct rte_event ev[],\n+\t\t\t\t __rte_unused uint16_t nb_events)\n+{\n+\tRTE_EDEV_LOG_ERR(\n+\t\t\"event crypto adapter enqueue requested for unconfigured event device\");\n+\treturn 0;\n+}\n+\n+void\n+event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op)\n+{\n+\tstatic void *dummy_data[RTE_MAX_QUEUES_PER_PORT];\n+\tstatic const struct rte_event_fp_ops dummy = {\n+\t\t.enqueue = dummy_event_enqueue,\n+\t\t.enqueue_burst = dummy_event_enqueue_burst,\n+\t\t.enqueue_new_burst = dummy_event_enqueue_burst,\n+\t\t.enqueue_forward_burst = dummy_event_enqueue_burst,\n+\t\t.dequeue = dummy_event_dequeue,\n+\t\t.dequeue_burst = dummy_event_dequeue_burst,\n+\t\t.txa_enqueue = dummy_event_tx_adapter_enqueue,\n+\t\t.txa_enqueue_same_dest =\n+\t\t\tdummy_event_tx_adapter_enqueue_same_dest,\n+\t\t.ca_enqueue = dummy_event_crypto_adapter_enqueue,\n+\t\t.data = dummy_data,\n+\t};\n+\n+\t*fp_op = dummy;\n+}\n+\n+void\n+event_dev_fp_ops_set(struct rte_event_fp_ops *fp_op,\n+\t\t const struct rte_eventdev *dev)\n+{\n+\tfp_op->enqueue = dev->enqueue;\n+\tfp_op->enqueue_burst = dev->enqueue_burst;\n+\tfp_op->enqueue_new_burst = dev->enqueue_new_burst;\n+\tfp_op->enqueue_forward_burst = dev->enqueue_forward_burst;\n+\tfp_op->dequeue = dev->dequeue;\n+\tfp_op->dequeue_burst = dev->dequeue_burst;\n+\tfp_op->txa_enqueue = dev->txa_enqueue;\n+\tfp_op->txa_enqueue_same_dest = dev->txa_enqueue_same_dest;\n+\tfp_op->ca_enqueue = dev->ca_enqueue;\n+\tfp_op->data = dev->data->ports;\n+}\ndiff --git a/lib/eventdev/meson.build b/lib/eventdev/meson.build\nindex 8b51fde361..9051ff04b7 100644\n--- a/lib/eventdev/meson.build\n+++ b/lib/eventdev/meson.build\n@@ -8,6 +8,7 @@ else\n endif\n \n sources = files(\n+ 'eventdev_private.c',\n 'rte_eventdev.c',\n 'rte_event_ring.c',\n 'eventdev_trace_points.c',\ndiff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c\nindex bfcfa31cd1..4c30a37831 100644\n--- a/lib/eventdev/rte_eventdev.c\n+++ b/lib/eventdev/rte_eventdev.c\n@@ -46,6 +46,9 @@ static struct rte_eventdev_global eventdev_globals = {\n \t.nb_devs\t\t= 0\n };\n \n+/* Public fastpath APIs. */\n+struct rte_event_fp_ops rte_event_fp_ops[RTE_EVENT_MAX_DEVS];\n+\n /* Event dev north bound API implementation */\n \n uint8_t\n@@ -300,8 +303,8 @@ int\n rte_event_dev_configure(uint8_t dev_id,\n \t\t\tconst struct rte_event_dev_config *dev_conf)\n {\n-\tstruct rte_eventdev *dev;\n \tstruct rte_event_dev_info info;\n+\tstruct rte_eventdev *dev;\n \tint diag;\n \n \tRTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);\n@@ -470,10 +473,13 @@ rte_event_dev_configure(uint8_t dev_id,\n \t\treturn diag;\n \t}\n \n+\tevent_dev_fp_ops_reset(rte_event_fp_ops + dev_id);\n+\n \t/* Configure the device */\n \tdiag = (*dev->dev_ops->dev_configure)(dev);\n \tif (diag != 0) {\n \t\tRTE_EDEV_LOG_ERR(\"dev%d dev_configure = %d\", dev_id, diag);\n+\t\tevent_dev_fp_ops_reset(rte_event_fp_ops + dev_id);\n \t\tevent_dev_queue_config(dev, 0);\n \t\tevent_dev_port_config(dev, 0);\n \t}\n@@ -1244,6 +1250,8 @@ rte_event_dev_start(uint8_t dev_id)\n \telse\n \t\treturn diag;\n \n+\tevent_dev_fp_ops_set(rte_event_fp_ops + dev_id, dev);\n+\n \treturn 0;\n }\n \n@@ -1284,6 +1292,7 @@ rte_event_dev_stop(uint8_t dev_id)\n \tdev->data->dev_started = 0;\n \t(*dev->dev_ops->dev_stop)(dev);\n \trte_eventdev_trace_stop(dev_id);\n+\tevent_dev_fp_ops_reset(rte_event_fp_ops + dev_id);\n }\n \n int\n@@ -1302,6 +1311,7 @@ rte_event_dev_close(uint8_t dev_id)\n \t\treturn -EBUSY;\n \t}\n \n+\tevent_dev_fp_ops_reset(rte_event_fp_ops + dev_id);\n \trte_eventdev_trace_close(dev_id);\n \treturn (*dev->dev_ops->dev_close)(dev);\n }\n@@ -1435,6 +1445,7 @@ rte_event_pmd_release(struct rte_eventdev *eventdev)\n \tif (eventdev == NULL)\n \t\treturn -EINVAL;\n \n+\tevent_dev_fp_ops_reset(rte_event_fp_ops + eventdev->data->dev_id);\n \teventdev->attached = RTE_EVENTDEV_DETACHED;\n \teventdev_globals.nb_devs--;\n \n@@ -1460,6 +1471,15 @@ rte_event_pmd_release(struct rte_eventdev *eventdev)\n \treturn 0;\n }\n \n+void\n+event_dev_probing_finish(struct rte_eventdev *eventdev)\n+{\n+\tif (eventdev == NULL)\n+\t\treturn;\n+\n+\tevent_dev_fp_ops_set(rte_event_fp_ops + eventdev->data->dev_id,\n+\t\t\t eventdev);\n+}\n \n static int\n handle_dev_list(const char *cmd __rte_unused,\ndiff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h\nindex 115b97e431..4461073101 100644\n--- a/lib/eventdev/rte_eventdev_core.h\n+++ b/lib/eventdev/rte_eventdev_core.h\n@@ -39,6 +39,34 @@ typedef uint16_t (*event_crypto_adapter_enqueue_t)(void *port,\n \t\t\t\t\t\t uint16_t nb_events);\n /**< @internal Enqueue burst of events on crypto adapter */\n \n+struct rte_event_fp_ops {\n+\tevent_enqueue_t enqueue;\n+\t/**< PMD enqueue function. */\n+\tevent_enqueue_burst_t enqueue_burst;\n+\t/**< PMD enqueue burst function. */\n+\tevent_enqueue_burst_t enqueue_new_burst;\n+\t/**< PMD enqueue burst new function. */\n+\tevent_enqueue_burst_t enqueue_forward_burst;\n+\t/**< PMD enqueue burst fwd function. */\n+\tevent_dequeue_t dequeue;\n+\t/**< PMD dequeue function. */\n+\tevent_dequeue_burst_t dequeue_burst;\n+\t/**< PMD dequeue burst function. */\n+\tevent_tx_adapter_enqueue_t txa_enqueue;\n+\t/**< PMD Tx adapter enqueue function. */\n+\tevent_tx_adapter_enqueue_t txa_enqueue_same_dest;\n+\t/**< PMD Tx adapter enqueue same destination function. */\n+\tevent_crypto_adapter_enqueue_t ca_enqueue;\n+\t/**< PMD Crypto adapter enqueue function. */\n+\tuintptr_t reserved[2];\n+\n+\tvoid **data;\n+\t/**< points to array of internal port data pointers */\n+\tuintptr_t reserved2[4];\n+} __rte_cache_aligned;\n+\n+extern struct rte_event_fp_ops rte_event_fp_ops[RTE_EVENT_MAX_DEVS];\n+\n #define RTE_EVENTDEV_NAME_MAX_LEN (64)\n /**< @internal Max length of name of event PMD */\n \ndiff --git a/lib/eventdev/version.map b/lib/eventdev/version.map\nindex 5f1fe412a4..a3a732089b 100644\n--- a/lib/eventdev/version.map\n+++ b/lib/eventdev/version.map\n@@ -85,6 +85,9 @@ DPDK_22 {\n \trte_event_timer_cancel_burst;\n \trte_eventdevs;\n \n+\t#added in 21.11\n+\trte_event_fp_ops;\n+\n \tlocal: *;\n };\n \n@@ -141,6 +144,9 @@ EXPERIMENTAL {\n INTERNAL {\n \tglobal:\n \n+\tevent_dev_fp_ops_reset;\n+\tevent_dev_fp_ops_set;\n+\tevent_dev_probing_finish;\n \trte_event_pmd_selftest_seqn_dynfield_offset;\n \trte_event_pmd_allocate;\n \trte_event_pmd_get_named_dev;\n", "prefixes": [ "v3", "04/14" ] }{ "id": 100565, "url": "