From patchwork Tue Sep 10 08:31:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 143850 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 354A445954; Tue, 10 Sep 2024 10:31:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C7A8427B3; Tue, 10 Sep 2024 10:31:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2C502427AD for ; Tue, 10 Sep 2024 10:31:36 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 489Kq7fp007328; Tue, 10 Sep 2024 01:31:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=u dbc2B0n7R81gTbWD6/anvmo4KHVI44XlUx8rkaVyTs=; b=jW6g8NIfhHaT5VAGb LsMW3vdy39h7N/tGIM8ak1sGYyLA0Yn3s/G3A/6Rtk6JI1w3u//MatlHUwmH7BT/ bkU92CnRUAXl4X0Gsjibq+Q28sro8gjhrRQvZQmvG7sbDATpw87mQZWHdPT8NUQp l9wBmaYX2GUvm9Dv5QCnlE8AueQFK+ffrd7JuFTnKjMnwd9+GzfAZah7in1HaBTQ cw9XWfD11ryWucj1OrSccVWTGZLJiRhYc2AEM9/hBNqSUc4/iAVVbpTJFMerxHSb 56oAuowtLZXnp0rET0aLa5lC9MSh16EoJSOW+G/Lrh30hPsqHjJo2hIsLekOsWpd 6V2dg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41gyc08196-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2024 01:31:34 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 10 Sep 2024 01:31:33 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 10 Sep 2024 01:31:33 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id C869F3F709E; Tue, 10 Sep 2024 01:31:29 -0700 (PDT) From: To: , , , , , , , , CC: , Pavan Nikhilesh Subject: [RFC 1/3] eventdev: introduce event prefetching Date: Tue, 10 Sep 2024 14:01:15 +0530 Message-ID: <20240910083117.4281-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240910083117.4281-1-pbhagavatula@marvell.com> References: <20240910083117.4281-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: aBlU26bW9zMxeSk6zSJjua4P6C7ZKJpa X-Proofpoint-GUID: aBlU26bW9zMxeSk6zSJjua4P6C7ZKJpa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh Event prefetching enhances scheduling performance by pre-scheduling events to event ports when dequeues are issued. The dequeue operation initiates the prefetch operation, which completes in parallel without affecting the dequeued event flow contexts and dequeue latency. Event devices can indicate prefetching capabilities using `RTE_EVENT_DEV_CAP_EVENT_PREFETCH` and `RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH` via the event device info function `info.event_dev_cap`. Applications can select the prefetch type and configure it via `rte_event_dev_config.prefetch_type` in the `rte_event_dev_configure` API. The supported prefetch types are: * `RTE_EVENT_DEV_PREFETCH_NONE` - No prefetching. * `RTE_EVENT_DEV_PREFETCH` - Always issue a prefetch on dequeue. * `RTE_EVENT_DEV_PREFETCH_INTELLIGENT` - Delay issuing prefetch until there are no forward progress constraints with the held flow contexts. Signed-off-by: Pavan Nikhilesh --- app/test/test_eventdev.c | 62 +++++++++++++++++++++ doc/guides/prog_guide/eventdev/eventdev.rst | 22 ++++++++ lib/eventdev/rte_eventdev.h | 48 ++++++++++++++++ 3 files changed, 132 insertions(+) diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index e4e234dc98..1fd3d1fa69 100644 --- a/app/test/test_eventdev.c +++ b/app/test/test_eventdev.c @@ -1250,6 +1250,66 @@ test_eventdev_profile_switch(void) return TEST_SUCCESS; } +static int +prefetch_test(rte_event_dev_prefetch_type_t prefetch_type, const char *prefetch_name) +{ +#define NB_EVENTS 1024 + uint64_t start, total; + struct rte_event ev; + int rc, cnt; + + ev.event_type = RTE_EVENT_TYPE_CPU; + ev.queue_id = 0; + ev.op = RTE_EVENT_OP_NEW; + ev.u64 = 0xBADF00D0; + + for (cnt = 0; cnt < NB_EVENTS; cnt++) { + ev.flow_id = cnt; + rc = rte_event_enqueue_burst(TEST_DEV_ID, 0, &ev, 1); + TEST_ASSERT(rc == 1, "Failed to enqueue event"); + } + + RTE_SET_USED(prefetch_type); + total = 0; + while (cnt) { + start = rte_rdtsc_precise(); + rc = rte_event_dequeue_burst(TEST_DEV_ID, 0, &ev, 1, 0); + if (rc) { + total += rte_rdtsc_precise() - start; + cnt--; + } + } + printf("Prefetch type : %s, avg cycles %" PRIu64 "\n", prefetch_name, total / NB_EVENTS); + + return TEST_SUCCESS; +} + +static int +test_eventdev_prefetch_configure(void) +{ + struct rte_event_dev_config dev_conf; + struct rte_event_dev_info info; + int rc; + + rte_event_dev_info_get(TEST_DEV_ID, &info); + + if ((info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PREFETCH) == 0) + return TEST_SKIPPED; + + devconf_set_default_sane_values(&dev_conf, &info); + dev_conf.prefetch_type = RTE_EVENT_DEV_PREFETCH; + rc = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); + TEST_ASSERT_SUCCESS(rc, "Failed to configure eventdev"); + + rc = prefetch_test(RTE_EVENT_DEV_PREFETCH_NONE, "RTE_EVENT_DEV_PREFETCH_NONE"); + rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH, "RTE_EVENT_DEV_PREFETCH"); + if (info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH) + rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH_INTELLIGENT, + "RTE_EVENT_DEV_PREFETCH_INTELLIGENT"); + + return rc; +} + static int test_eventdev_close(void) { @@ -1310,6 +1370,8 @@ static struct unit_test_suite eventdev_common_testsuite = { test_eventdev_start_stop), TEST_CASE_ST(eventdev_configure_setup, eventdev_stop_device, test_eventdev_profile_switch), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_prefetch_configure), TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, test_eventdev_link), TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, diff --git a/doc/guides/prog_guide/eventdev/eventdev.rst b/doc/guides/prog_guide/eventdev/eventdev.rst index fb6dfce102..89064883b7 100644 --- a/doc/guides/prog_guide/eventdev/eventdev.rst +++ b/doc/guides/prog_guide/eventdev/eventdev.rst @@ -357,6 +357,28 @@ Worker path: // Process the event received. } +Event Prefetching +~~~~~~~~~~~~~~~~~ + +Event prefetching enhances scheduling performance by pre-scheduling events to event ports +when dequeues are issued. +The `rte_event_dequeue_burst` operation initiates the prefetch operation, which completes +in parallel without affecting the dequeued event flow contexts and dequeue latency. +On the next dequeue operation, the prefetched events are dequeued and prefetch is initiated +again. + +An application can use event prefetching if the event device supports it at either device +level or at a individual port level. +The application can check prefetch capability by checking if ``rte_event_dev_info.event_dev_cap`` +has the bit ``RTE_EVENT_DEV_CAP_PREFETCH`` set, if present prefetching can be enabled at device +configuration time by setting appropriate prefetch type in ``rte_event_dev_config.prefetch``. + +Currently, the following prefetch types are supported: + * ``RTE_EVENT_DEV_PREFETCH_NONE`` - No prefetching. + * ``RTE_EVENT_DEV_PREFETCH`` - Always issue a prefetch when dequeue is issued. + * ``RTE_EVENT_DEV_PREFETCH_INTELLIGENT`` - Issue prefetch when dequeue is issued and there are + no forward progress constraints. + Starting the EventDev ~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index 08e5f9320b..59c323c8ee 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -446,6 +446,30 @@ struct rte_event; * @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_EVENT_PREFETCH (1ULL << 16) +/**< Event device supports event prefetching. + * + * When this capability is available, the application can enable event prefetching on the event + * device to prefetch/pre-schedule events to a event port when `rte_event_dequeue_burst()` + * is issued. + * The prefetch process starts with the `rte_event_dequeue_burst()` call and the + * prefetched events are returned on the next `rte_event_dequeue_burst()` call. + * + * @see rte_event_dev_configure() + */ + +#define RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH (1ULL << 17) +/**< Event device supports intelligent event prefetching. + * + * When this capability is available, the application can enable intelligent prefetching + * on the event device where the events are prefetched/pre-scheduled when + * there are no forward progress constraints with the currently held flow contexts. + * The prefetch process starts with the `rte_event_dequeue_burst()` call and the + * prefetched events are returned on the next `rte_event_dequeue_burst()` call. + * + * @see rte_event_dev_configure() + */ + /* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 /**< Highest priority level for events and queues. @@ -680,6 +704,25 @@ rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id, * @see rte_event_dequeue_timeout_ticks(), rte_event_dequeue_burst() */ +typedef enum { + RTE_EVENT_DEV_PREFETCH_NONE = 0, + /* Disable prefetch across the event device or on a given event port. + * @ref rte_event_dev_config.prefetch_type + */ + RTE_EVENT_DEV_PREFETCH, + /* Enable prefetch always across the event device or a given event port. + * @ref rte_event_dev_config.prefetch_type + * @see RTE_EVENT_DEV_CAP_EVENT_PREFETCH + */ + RTE_EVENT_DEV_PREFETCH_INTELLIGENT, + /* Enable intelligent prefetch across the event device or a given event port. + * Delay issuing prefetch until there are no forward progress constraints with + * the held flow contexts. + * @ref rte_event_dev_config.prefetch_type + * @see RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH + */ +} rte_event_dev_prefetch_type_t; + /** Event device configuration structure */ struct rte_event_dev_config { uint32_t dequeue_timeout_ns; @@ -752,6 +795,11 @@ struct rte_event_dev_config { * optimized for single-link usage, this field is a hint for how many * to allocate; otherwise, regular event ports and queues will be used. */ + rte_event_dev_prefetch_type_t prefetch_type; + /**< Event prefetch type to use across the event device, if supported. + * @see RTE_EVENT_DEV_CAP_EVENT_PREFETCH + * @see RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH + */ }; /** From patchwork Tue Sep 10 08:31:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 143851 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 0326045954; Tue, 10 Sep 2024 10:31:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97925427C3; Tue, 10 Sep 2024 10:31:40 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 46E89427BD for ; Tue, 10 Sep 2024 10:31:39 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48A40An2029271; Tue, 10 Sep 2024 01:31:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=0 mChxt4hRn3/f4UugvnkaZHNzZnl+bqdMvPlySp4Fjk=; b=YVhzLbD81puL0iqiz 9sVmOK8aRbcwleLYHTwgfHiaW8/xC5lioTPXEYxyV2Y6JQ0TpdIAHgk8Jo1foSWP Q4cdg+V/MT4wGuz+CjADL0mzlnG9PtqWgqIr7R6wPWauxqXxT4LJy8zlwhz0GCsF j2l+ZY0rYQXW1pX7SiXL/teAnClwZlDrGsR4kkoweR+xPqfcRssPsA/bGScutFEA gtZClXJ1o76g55VnMk94qeD71LrEAQ0aaMfrTetoNRwdSH5lQf7RFm2f2Qvtbi1r ZMXbKpcJ0SB2+Oo9cJ3XZ+YIB01okhHMOlPwBlomoSIr55wXlCLp+LmDQdcaaDjF 9Mhzg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 41gygtfxkt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2024 01:31:38 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 10 Sep 2024 01:31:37 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 10 Sep 2024 01:31:37 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 95BCB3F709E; Tue, 10 Sep 2024 01:31:33 -0700 (PDT) From: To: , , , , , , , , CC: , Pavan Nikhilesh Subject: [RFC 2/3] eventdev: allow event ports to modified prefetches Date: Tue, 10 Sep 2024 14:01:16 +0530 Message-ID: <20240910083117.4281-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240910083117.4281-1-pbhagavatula@marvell.com> References: <20240910083117.4281-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Suql03C0_3EbtCjEg32mxydn6XE1sZbB X-Proofpoint-GUID: Suql03C0_3EbtCjEg32mxydn6XE1sZbB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh Some event devices allow prefetch types to be modified at runtime on an event port. Add `RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PREFETCH` capability to indicate that the event device supports this feature. Add `rte_event_port_prefetch_modify()` API to modify the prefetch type at runtime. Signed-off-by: Pavan Nikhilesh --- app/test/test_eventdev.c | 61 +++++++++++++++++++-- doc/guides/prog_guide/eventdev/eventdev.rst | 12 ++++ lib/eventdev/eventdev_pmd.h | 2 + lib/eventdev/eventdev_private.c | 10 ++++ lib/eventdev/eventdev_trace_points.c | 3 + lib/eventdev/rte_eventdev.h | 55 +++++++++++++++++++ lib/eventdev/rte_eventdev_core.h | 5 ++ lib/eventdev/rte_eventdev_trace_fp.h | 11 +++- lib/eventdev/version.map | 4 ++ 9 files changed, 157 insertions(+), 6 deletions(-) diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index 1fd3d1fa69..af27a9f0ec 100644 --- a/app/test/test_eventdev.c +++ b/app/test/test_eventdev.c @@ -1251,7 +1251,8 @@ test_eventdev_profile_switch(void) } static int -prefetch_test(rte_event_dev_prefetch_type_t prefetch_type, const char *prefetch_name) +prefetch_test(rte_event_dev_prefetch_type_t prefetch_type, const char *prefetch_name, + uint8_t modify) { #define NB_EVENTS 1024 uint64_t start, total; @@ -1269,7 +1270,11 @@ prefetch_test(rte_event_dev_prefetch_type_t prefetch_type, const char *prefetch_ TEST_ASSERT(rc == 1, "Failed to enqueue event"); } - RTE_SET_USED(prefetch_type); + if (modify) { + rc = rte_event_port_prefetch_modify(TEST_DEV_ID, 0, prefetch_type); + TEST_ASSERT_SUCCESS(rc, "Failed to modify prefetch type"); + } + total = 0; while (cnt) { start = rte_rdtsc_precise(); @@ -1301,11 +1306,55 @@ test_eventdev_prefetch_configure(void) rc = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); TEST_ASSERT_SUCCESS(rc, "Failed to configure eventdev"); - rc = prefetch_test(RTE_EVENT_DEV_PREFETCH_NONE, "RTE_EVENT_DEV_PREFETCH_NONE"); - rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH, "RTE_EVENT_DEV_PREFETCH"); + rc = prefetch_test(RTE_EVENT_DEV_PREFETCH_NONE, "RTE_EVENT_DEV_PREFETCH_NONE", 0); + rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH, "RTE_EVENT_DEV_PREFETCH", 0); if (info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH) rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH_INTELLIGENT, - "RTE_EVENT_DEV_PREFETCH_INTELLIGENT"); + "RTE_EVENT_DEV_PREFETCH_INTELLIGENT", 0); + + return rc; +} + +static int +test_eventdev_prefetch_modify(void) +{ + struct rte_event_dev_config dev_conf; + struct rte_event_queue_conf qcfg; + struct rte_event_port_conf pcfg; + struct rte_event_dev_info info; + int rc; + + rte_event_dev_info_get(TEST_DEV_ID, &info); + if ((info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PREFETCH) == 0) + return TEST_SKIPPED; + + devconf_set_default_sane_values(&dev_conf, &info); + dev_conf.prefetch_type = RTE_EVENT_DEV_PREFETCH_NONE; + rc = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); + TEST_ASSERT_SUCCESS(rc, "Failed to configure eventdev"); + + rc = rte_event_port_default_conf_get(TEST_DEV_ID, 0, &pcfg); + TEST_ASSERT_SUCCESS(rc, "Failed to get port0 default config"); + rc = rte_event_port_setup(TEST_DEV_ID, 0, &pcfg); + TEST_ASSERT_SUCCESS(rc, "Failed to setup port0"); + + rc = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qcfg); + TEST_ASSERT_SUCCESS(rc, "Failed to get queue0 default config"); + rc = rte_event_queue_setup(TEST_DEV_ID, 0, &qcfg); + TEST_ASSERT_SUCCESS(rc, "Failed to setup queue0"); + + rc = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0); + TEST_ASSERT(rc == (int)dev_conf.nb_event_queues, "Failed to link port, device %d", + TEST_DEV_ID); + + rc = rte_event_dev_start(TEST_DEV_ID); + TEST_ASSERT_SUCCESS(rc, "Failed to start event device"); + + rc = prefetch_test(RTE_EVENT_DEV_PREFETCH_NONE, "RTE_EVENT_DEV_PREFETCH_NONE", 1); + rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH, "RTE_EVENT_DEV_PREFETCH", 1); + if (info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH) + rc |= prefetch_test(RTE_EVENT_DEV_PREFETCH_INTELLIGENT, + "RTE_EVENT_DEV_PREFETCH_INTELLIGENT", 1); return rc; } @@ -1372,6 +1421,8 @@ static struct unit_test_suite eventdev_common_testsuite = { test_eventdev_profile_switch), TEST_CASE_ST(eventdev_configure_setup, NULL, test_eventdev_prefetch_configure), + TEST_CASE_ST(eventdev_configure_setup, eventdev_stop_device, + test_eventdev_prefetch_modify), TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, test_eventdev_link), TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, diff --git a/doc/guides/prog_guide/eventdev/eventdev.rst b/doc/guides/prog_guide/eventdev/eventdev.rst index 89064883b7..8b6085512d 100644 --- a/doc/guides/prog_guide/eventdev/eventdev.rst +++ b/doc/guides/prog_guide/eventdev/eventdev.rst @@ -379,6 +379,18 @@ Currently, the following prefetch types are supported: * ``RTE_EVENT_DEV_PREFETCH_INTELLIGENT`` - Issue prefetch when dequeue is issued and there are no forward progress constraints. +To enable or disable event prefetching at a given event port, the application can use +``rte_event_port_prefetch_modify()`` API. + +.. code-block:: c + + rte_event_port_prefetch_modify(dev_id, port_id, RTE_EVENT_DEV_PREFETCH); + // Dequeue events from the event port with normal dequeue() function. + rte_event_port_prefetch_modify(dev_id, port_id, RTE_EVENT_DEV_PREFETCH_NONE); + // Disable prefetching if thread is about to be scheduled out and issue dequeue() to drain + // pending events. + + Starting the EventDev ~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 7a5699f14b..d93c11e9f1 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -184,6 +184,8 @@ struct __rte_cache_aligned rte_eventdev { /**< Pointer to PMD DMA adapter enqueue function. */ event_profile_switch_t profile_switch; /**< Pointer to PMD Event switch profile function. */ + event_prefetch_modify_t prefetch_modify; + /**< Pointer to PMD Event port prefetch modify function. */ uint64_t reserved_64s[3]; /**< Reserved for future fields */ void *reserved_ptrs[3]; /**< Reserved for future fields */ diff --git a/lib/eventdev/eventdev_private.c b/lib/eventdev/eventdev_private.c index 017f97ccab..6e8beb29ad 100644 --- a/lib/eventdev/eventdev_private.c +++ b/lib/eventdev/eventdev_private.c @@ -96,6 +96,14 @@ dummy_event_port_profile_switch(__rte_unused void *port, __rte_unused uint8_t pr return -EINVAL; } +static int +dummy_event_port_prefetch_modify(__rte_unused void *port, + __rte_unused rte_event_dev_prefetch_type_t prefetch) +{ + RTE_EDEV_LOG_ERR("modify prefetch requested for unconfigured event device"); + return -EINVAL; +} + void event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op) { @@ -114,6 +122,7 @@ event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op) .ca_enqueue = dummy_event_crypto_adapter_enqueue, .dma_enqueue = dummy_event_dma_adapter_enqueue, .profile_switch = dummy_event_port_profile_switch, + .prefetch_modify = dummy_event_port_prefetch_modify, .data = dummy_data, }; @@ -136,5 +145,6 @@ event_dev_fp_ops_set(struct rte_event_fp_ops *fp_op, fp_op->ca_enqueue = dev->ca_enqueue; fp_op->dma_enqueue = dev->dma_enqueue; fp_op->profile_switch = dev->profile_switch; + fp_op->prefetch_modify = dev->prefetch_modify; fp_op->data = dev->data->ports; } diff --git a/lib/eventdev/eventdev_trace_points.c b/lib/eventdev/eventdev_trace_points.c index 8024e07531..e0547d18c6 100644 --- a/lib/eventdev/eventdev_trace_points.c +++ b/lib/eventdev/eventdev_trace_points.c @@ -49,6 +49,9 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_maintain, RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_profile_switch, lib.eventdev.port.profile.switch) +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_prefetch_modify, + lib.eventdev.port.prefetch.modify) + /* Eventdev Rx adapter trace points */ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_create, lib.eventdev.rx.adapter.create) diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index 59c323c8ee..1bc6c48dd3 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -470,6 +470,16 @@ struct rte_event; * @see rte_event_dev_configure() */ +#define RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PREFETCH (1ULL << 18) +/**< Event device supports event prefetching per event port. + * + * When this flag is set, the event device allows controlling the event + * prefetching/pre-scheduling at a event port granularity. + * + * @see rte_event_dev_configure() + * @see rte_event_port_prefetch_modify() + */ + /* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 /**< Highest priority level for events and queues. @@ -708,18 +718,23 @@ typedef enum { RTE_EVENT_DEV_PREFETCH_NONE = 0, /* Disable prefetch across the event device or on a given event port. * @ref rte_event_dev_config.prefetch_type + * @ref rte_event_port_prefetch_modify() */ RTE_EVENT_DEV_PREFETCH, /* Enable prefetch always across the event device or a given event port. * @ref rte_event_dev_config.prefetch_type + * @ref rte_event_port_prefetch_modify() * @see RTE_EVENT_DEV_CAP_EVENT_PREFETCH + * @see RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PREFETCH */ RTE_EVENT_DEV_PREFETCH_INTELLIGENT, /* Enable intelligent prefetch across the event device or a given event port. * Delay issuing prefetch until there are no forward progress constraints with * the held flow contexts. * @ref rte_event_dev_config.prefetch_type + * @ref rte_event_port_prefetch_modify() * @see RTE_EVENT_DEV_CAP_EVENT_INTELLIGENT_PREFETCH + * @see RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PREFETCH */ } rte_event_dev_prefetch_type_t; @@ -2922,6 +2937,46 @@ rte_event_port_profile_switch(uint8_t dev_id, uint8_t port_id, uint8_t profile_i return fp_ops->profile_switch(port, profile_id); } +/** + * Change the prefetch type to use on an event port. + * + * This function is used to change the current prefetch type configured + * on an event port, the prefetch type can be set to none to disable prefetching. + * This effects the subsequent ``rte_event_dequeue_burst`` call. + * The event device should support RTE_EVENT_DEV_CAP_PER_PORT_PREFETCH capability. + * + * @param dev_id + * The identifier of the device. + * @param port_id + * The identifier of the event port. + * @param type + * The prefetch type to use on the event port. + * @return + * - 0 on success. + * - -EINVAL if *dev_id*, *port_id*, or *type* is invalid. + * - -ENOTSUP if the device doesn't support prefetch or per port prefetch. + */ +static inline int +rte_event_port_prefetch_modify(uint8_t dev_id, uint8_t port_id, rte_event_dev_prefetch_type_t type) +{ + const struct rte_event_fp_ops *fp_ops; + void *port; + + fp_ops = &rte_event_fp_ops[dev_id]; + port = fp_ops->data[port_id]; + +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG + if (dev_id >= RTE_EVENT_MAX_DEVS || port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) + return -EINVAL; + + if (port == NULL) + return -EINVAL; +#endif + rte_eventdev_trace_port_prefetch_modify(dev_id, port_id, type); + + return fp_ops->prefetch_modify(port, type); +} + #ifdef __cplusplus } #endif diff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h index fc8e1556ab..b185fe3654 100644 --- a/lib/eventdev/rte_eventdev_core.h +++ b/lib/eventdev/rte_eventdev_core.h @@ -49,6 +49,9 @@ typedef uint16_t (*event_dma_adapter_enqueue_t)(void *port, struct rte_event ev[ typedef int (*event_profile_switch_t)(void *port, uint8_t profile); /**< @internal Switch active link profile on the event port. */ +typedef int (*event_prefetch_modify_t)(void *port, rte_event_dev_prefetch_type_t prefetch_type); +/**< @internal Modify prefetch type on the event port. */ + struct __rte_cache_aligned rte_event_fp_ops { void **data; /**< points to array of internal port data pointers */ @@ -76,6 +79,8 @@ struct __rte_cache_aligned rte_event_fp_ops { /**< PMD DMA adapter enqueue function. */ event_profile_switch_t profile_switch; /**< PMD Event switch profile function. */ + event_prefetch_modify_t prefetch_modify; + /**< PMD Event port prefetch switch. */ uintptr_t reserved[4]; }; diff --git a/lib/eventdev/rte_eventdev_trace_fp.h b/lib/eventdev/rte_eventdev_trace_fp.h index 04d510ad00..06bfd48011 100644 --- a/lib/eventdev/rte_eventdev_trace_fp.h +++ b/lib/eventdev/rte_eventdev_trace_fp.h @@ -8,7 +8,7 @@ /** * @file * - * API for ethdev trace support + * API for eventdev trace support */ #ifdef __cplusplus @@ -54,6 +54,15 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_u8(profile); ) +RTE_TRACE_POINT_FP( + rte_eventdev_trace_port_prefetch_modify, + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, + int type), + rte_trace_point_emit_u8(dev_id); + rte_trace_point_emit_u8(port_id); + rte_trace_point_emit_int(type); +) + RTE_TRACE_POINT_FP( rte_eventdev_trace_eth_tx_adapter_enqueue, RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table, diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map index 4947bb4ec6..62c0563fb1 100644 --- a/lib/eventdev/version.map +++ b/lib/eventdev/version.map @@ -147,6 +147,10 @@ EXPERIMENTAL { rte_event_port_profile_unlink; rte_event_port_profile_links_get; __rte_eventdev_trace_port_profile_switch; + + # added in 24.11 + rte_event_port_prefetch_modify; + __rte_eventdev_trace_port_prefetch_modify; }; INTERNAL { From patchwork Tue Sep 10 08:31:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 143852 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 6BA0545954; Tue, 10 Sep 2024 10:31:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDF46427C8; Tue, 10 Sep 2024 10:31:45 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4D0CC427C6 for ; Tue, 10 Sep 2024 10:31:44 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 489KauTo026024; Tue, 10 Sep 2024 01:31:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=K YUucr/uPid/f9SOIn4POhU3a3ADxkoKF3Tolg7dcNg=; b=EBI3983T/g9mCSVzA IN9mUWJ6L22OWa0Q9kfHlmo/prAX6qgdWqlc3ljzrvind4nTF8cyZSbDpJqRP3KJ JC0l/y4QR0RWMpoBANtyDKywux5VBwT2OR7Za7Rw7b827lJ4igxZsMl3p6LLopGc P3ln9aG07R078YtjXqzuPb6xLWWOp8VSYTU2eTqUJq966zophvIptWI4Hx4Up9Nm YWmd0flhE3dfbwpXDR65IDi+b6Qm8Oj+QfcorX5v+m/BYAl8wG2K0A7iyB5bYhYn ZSDWG7rrMGjkH66hrjsDSXwPtbYQAOIMhO1tWnKA3a41nfgEwj8aGj+Nxf51KXw1 FB2Hw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41gyc081be-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Sep 2024 01:31:43 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 10 Sep 2024 01:31:40 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 10 Sep 2024 01:31:40 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 5FAA63F709E; Tue, 10 Sep 2024 01:31:37 -0700 (PDT) From: To: , , , , , , , , CC: , Pavan Nikhilesh Subject: [RFC 3/3] eventdev: add SW event prefetch hint Date: Tue, 10 Sep 2024 14:01:17 +0530 Message-ID: <20240910083117.4281-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240910083117.4281-1-pbhagavatula@marvell.com> References: <20240910083117.4281-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: u_r1PelK2tH88WAXd2AZAjUaUJwl07f7 X-Proofpoint-GUID: u_r1PelK2tH88WAXd2AZAjUaUJwl07f7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh Add a new eventdev API to provide a hint to the eventdev PMD to prefetch the next event into the event port, without releasing the current flow context. Event device that support this feature advertises the capability using the RTE_EVENT_DEV_CAP_SW_PREFETCH capability flag. Application can invoke `rte_event_port_prefetch` to hint the PMD. Signed-off-by: Pavan Nikhilesh --- doc/guides/prog_guide/eventdev/eventdev.rst | 8 ++++ lib/eventdev/eventdev_pmd.h | 2 + lib/eventdev/eventdev_private.c | 9 ++++ lib/eventdev/eventdev_trace_points.c | 3 ++ lib/eventdev/rte_eventdev.h | 49 +++++++++++++++++++++ lib/eventdev/rte_eventdev_core.h | 4 ++ lib/eventdev/rte_eventdev_trace_fp.h | 8 ++++ lib/eventdev/version.map | 2 + 8 files changed, 85 insertions(+) diff --git a/doc/guides/prog_guide/eventdev/eventdev.rst b/doc/guides/prog_guide/eventdev/eventdev.rst index 8b6085512d..ea05de53f5 100644 --- a/doc/guides/prog_guide/eventdev/eventdev.rst +++ b/doc/guides/prog_guide/eventdev/eventdev.rst @@ -390,6 +390,14 @@ To enable or disable event prefetching at a given event port, the application ca // Disable prefetching if thread is about to be scheduled out and issue dequeue() to drain // pending events. +Event Prefetch Hint can be used to provide a hint to the eventdev PMD to prefetch the next event +without releasing the current flow context. Event device that support this feature advertises the +capability using the ``RTE_EVENT_DEV_CAP_SW_PREFETCH`` capability flag. +If prefetching is already enabled at a event device or event port level then the hint is ignored. + +.. code-block:: c + + rte_event_port_prefetch(dev_id, port_id, RTE_EVENT_DEV_PREFETCH); Starting the EventDev ~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index d93c11e9f1..698bdcc14f 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -186,6 +186,8 @@ struct __rte_cache_aligned rte_eventdev { /**< Pointer to PMD Event switch profile function. */ event_prefetch_modify_t prefetch_modify; /**< Pointer to PMD Event port prefetch modify function. */ + event_prefetch_t prefetch; + /**< Pointer to PMD Event port prefetch function. */ uint64_t reserved_64s[3]; /**< Reserved for future fields */ void *reserved_ptrs[3]; /**< Reserved for future fields */ diff --git a/lib/eventdev/eventdev_private.c b/lib/eventdev/eventdev_private.c index 6e8beb29ad..39d5234551 100644 --- a/lib/eventdev/eventdev_private.c +++ b/lib/eventdev/eventdev_private.c @@ -104,6 +104,13 @@ dummy_event_port_prefetch_modify(__rte_unused void *port, return -EINVAL; } +static void +dummy_event_port_prefetch(__rte_unused void *port, + __rte_unused rte_event_dev_prefetch_type_t prefetch) +{ + RTE_EDEV_LOG_ERR("prefetch requested for unconfigured event device"); +} + void event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op) { @@ -123,6 +130,7 @@ event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op) .dma_enqueue = dummy_event_dma_adapter_enqueue, .profile_switch = dummy_event_port_profile_switch, .prefetch_modify = dummy_event_port_prefetch_modify, + .prefetch = dummy_event_port_prefetch, .data = dummy_data, }; @@ -146,5 +154,6 @@ event_dev_fp_ops_set(struct rte_event_fp_ops *fp_op, fp_op->dma_enqueue = dev->dma_enqueue; fp_op->profile_switch = dev->profile_switch; fp_op->prefetch_modify = dev->prefetch_modify; + fp_op->prefetch = dev->prefetch; fp_op->data = dev->data->ports; } diff --git a/lib/eventdev/eventdev_trace_points.c b/lib/eventdev/eventdev_trace_points.c index e0547d18c6..199cfa742f 100644 --- a/lib/eventdev/eventdev_trace_points.c +++ b/lib/eventdev/eventdev_trace_points.c @@ -52,6 +52,9 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_profile_switch, RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_prefetch_modify, lib.eventdev.port.prefetch.modify) +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_prefetch, + lib.eventdev.port.prefetch) + /* Eventdev Rx adapter trace points */ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_create, lib.eventdev.rx.adapter.create) diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index 1bc6c48dd3..d487389a2c 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -480,6 +480,15 @@ struct rte_event; * @see rte_event_port_prefetch_modify() */ +#define RTE_EVENT_DEV_CAP_SW_PREFETCH (1ULL << 19) +/**< Event device supports software prefetching. + * + * When this flag is set, the application can issue prefetch request on + * a event port. + * + * @see rte_event_port_prefetch() + */ + /* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 /**< Highest priority level for events and queues. @@ -2977,6 +2986,46 @@ rte_event_port_prefetch_modify(uint8_t dev_id, uint8_t port_id, rte_event_dev_pr return fp_ops->prefetch_modify(port, type); } +/** + * Provide a hint to the event device to prefetch events to event port . + * + * Hint the event device to prefetch events to the event port. + * The call doesn't not guarantee that the events will be prefetched. + * The call doesn't release the flow context currently held by the event port. + * The event device should support RTE_EVENT_DEV_CAP_SW_PREFETCH capability. + * + * When prefetching is enabled at an event device or event port level, the hint + * is ignored. + * + * Subsequent calls to rte_event_dequeue_burst() will dequeue the prefetch events + * but prefetch operation is not issued again. + * + * @param dev_id + * The identifier of the device. + * @param port_id + * The identifier of the event port. + * @param type + * The prefetch type to use on the event port. + */ +static inline void +rte_event_port_prefetch(uint8_t dev_id, uint8_t port_id, rte_event_dev_prefetch_type_t type) +{ + const struct rte_event_fp_ops *fp_ops; + void *port; + + fp_ops = &rte_event_fp_ops[dev_id]; + port = fp_ops->data[port_id]; + +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG + if (dev_id >= RTE_EVENT_MAX_DEVS || port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) + return; + if (port == NULL) + return; +#endif + rte_eventdev_trace_port_prefetch(dev_id, port_id, type); + + fp_ops->prefetch(port, type); +} #ifdef __cplusplus } #endif diff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h index b185fe3654..66edb75649 100644 --- a/lib/eventdev/rte_eventdev_core.h +++ b/lib/eventdev/rte_eventdev_core.h @@ -52,6 +52,9 @@ typedef int (*event_profile_switch_t)(void *port, uint8_t profile); typedef int (*event_prefetch_modify_t)(void *port, rte_event_dev_prefetch_type_t prefetch_type); /**< @internal Modify prefetch type on the event port. */ +typedef void (*event_prefetch_t)(void *port, rte_event_dev_prefetch_type_t prefetch_type); +/**< @internal Issue prefetch on an event port. */ + struct __rte_cache_aligned rte_event_fp_ops { void **data; /**< points to array of internal port data pointers */ @@ -81,6 +84,7 @@ struct __rte_cache_aligned rte_event_fp_ops { /**< PMD Event switch profile function. */ event_prefetch_modify_t prefetch_modify; /**< PMD Event port prefetch switch. */ + event_prefetch_t prefetch; uintptr_t reserved[4]; }; diff --git a/lib/eventdev/rte_eventdev_trace_fp.h b/lib/eventdev/rte_eventdev_trace_fp.h index 06bfd48011..01fa5cba7c 100644 --- a/lib/eventdev/rte_eventdev_trace_fp.h +++ b/lib/eventdev/rte_eventdev_trace_fp.h @@ -63,6 +63,14 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_int(type); ) +RTE_TRACE_POINT_FP( + rte_eventdev_trace_port_prefetch, + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, int type), + rte_trace_point_emit_u8(dev_id); + rte_trace_point_emit_u8(port_id); + rte_trace_point_emit_int(type); +) + RTE_TRACE_POINT_FP( rte_eventdev_trace_eth_tx_adapter_enqueue, RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table, diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map index 62c0563fb1..bb291f23e3 100644 --- a/lib/eventdev/version.map +++ b/lib/eventdev/version.map @@ -151,6 +151,8 @@ EXPERIMENTAL { # added in 24.11 rte_event_port_prefetch_modify; __rte_eventdev_trace_port_prefetch_modify; + rte_event_port_prefetch; + __rte_eventdev_trace_port_prefetch; }; INTERNAL {