From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 42A9A45A76; Tue, 1 Oct 2024 08:15:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD12340DCA; Tue, 1 Oct 2024 08:14:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 04D3240DC9 for ; Tue, 1 Oct 2024 08:14:42 +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 48ULfArN000750; Mon, 30 Sep 2024 23:14:42 -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=Q KD3QANp6NcgivKs8a22B23c7X6tw1HVo/eavaUiWCA=; b=bLedXzUwBPEHhNTCr e23/KNhlrlkR7fvGuPiMmo67+xrzfVNBA2l1v98zPHz68v1dIM4UbHfBKFlAVllC TYwWerUfIE6EnUyiXMeZLuH9HvEOTnoH+gl7l+TEYKSS5kgFyr+/W78HKefzXFCm enWBQTc7oV8flycXzzIysLag2hAyHb5b80qtMnBSMxdeGBeH9YTkUlfljtGWSJyQ e1qgPOHNh3WcDuE/JrC4AL/Ywyt6skZup4tfu/Rl4uuGd7v5LGHdjnYl/l2fLDOY f6kZa8Z7dvPTZ98E5vq1XfPJaYJ8Gg17pVlJsvArOn4JFHHD8MFptTeH8NsIfVWz 9V+vQ== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41yt6gc0me-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Sep 2024 23:14:42 -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; Mon, 30 Sep 2024 23:14:41 -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; Mon, 30 Sep 2024 23:14:41 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id E06893F7066; Mon, 30 Sep 2024 23:14:36 -0700 (PDT) From: To: , , , , , , , , CC: , Pavan Nikhilesh Subject: [PATCH v3 5/6] app/test-eventdev: add pre-scheduling support Date: Tue, 1 Oct 2024 11:44:10 +0530 Message-ID: <20241001061411.2537-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241001061411.2537-1-pbhagavatula@marvell.com> References: <20240917071106.8815-1-pbhagavatula@marvell.com> <20241001061411.2537-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: vT_pUrrmkn5mSyzToDs9AjAAYyNPq8HW X-Proofpoint-ORIG-GUID: vT_pUrrmkn5mSyzToDs9AjAAYyNPq8HW 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 support to configure pre-scheduling for eventdev test application. Option `--preschedule` 0 - Disable pre-scheduling. 1 - Enable pre-scheduling. 2 - Enable pre-schedule with adaptive mode (Default). Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/evt_common.h | 45 ++++++++++++++++++++++++------- app/test-eventdev/evt_options.c | 17 ++++++++++++ app/test-eventdev/evt_options.h | 1 + doc/guides/tools/testeventdev.rst | 6 +++++ 4 files changed, 59 insertions(+), 10 deletions(-) diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h index dbe1e5c0c4..176c077e51 100644 --- a/app/test-eventdev/evt_common.h +++ b/app/test-eventdev/evt_common.h @@ -64,6 +64,8 @@ struct evt_options { uint8_t nb_timer_adptrs; uint8_t timdev_use_burst; uint8_t per_port_pool; + uint8_t preschedule; + uint8_t preschedule_opted; uint8_t sched_type_list[EVT_MAX_STAGES]; uint16_t mbuf_sz; uint16_t wkr_deq_dep; @@ -184,6 +186,30 @@ evt_configure_eventdev(struct evt_options *opt, uint8_t nb_queues, return ret; } + if (opt->preschedule_opted && opt->preschedule) { + switch (opt->preschedule) { + case RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE: + if (!(info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)) { + evt_err("Preschedule type %d not supported", opt->preschedule); + return -EINVAL; + } + break; + case RTE_EVENT_DEV_PRESCHEDULE: + if (!(info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)) { + evt_err("Preschedule type %d not supported", opt->preschedule); + return -EINVAL; + } + break; + default: + break; + } + } + + if (!opt->preschedule_opted) { + if (info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + opt->preschedule = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE; + } + if (opt->deq_tmo_nsec) { if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) { opt->deq_tmo_nsec = info.min_dequeue_timeout_ns; @@ -198,16 +224,15 @@ evt_configure_eventdev(struct evt_options *opt, uint8_t nb_queues, } const struct rte_event_dev_config config = { - .dequeue_timeout_ns = opt->deq_tmo_nsec, - .nb_event_queues = nb_queues, - .nb_event_ports = nb_ports, - .nb_single_link_event_port_queues = 0, - .nb_events_limit = info.max_num_events, - .nb_event_queue_flows = opt->nb_flows, - .nb_event_port_dequeue_depth = - info.max_event_port_dequeue_depth, - .nb_event_port_enqueue_depth = - info.max_event_port_enqueue_depth, + .dequeue_timeout_ns = opt->deq_tmo_nsec, + .nb_event_queues = nb_queues, + .nb_event_ports = nb_ports, + .nb_single_link_event_port_queues = 0, + .nb_events_limit = info.max_num_events, + .nb_event_queue_flows = opt->nb_flows, + .nb_event_port_dequeue_depth = info.max_event_port_dequeue_depth, + .nb_event_port_enqueue_depth = info.max_event_port_enqueue_depth, + .preschedule_type = opt->preschedule, }; return rte_event_dev_configure(opt->dev_id, &config); diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c index fb5a0a255f..323d1e724d 100644 --- a/app/test-eventdev/evt_options.c +++ b/app/test-eventdev/evt_options.c @@ -130,6 +130,17 @@ evt_parse_tx_pkt_sz(struct evt_options *opt, const char *arg __rte_unused) return ret; } +static int +evt_parse_preschedule(struct evt_options *opt, const char *arg __rte_unused) +{ + int ret; + + ret = parser_read_uint8(&(opt->preschedule), arg); + opt->preschedule_opted = 1; + + return ret; +} + static int evt_parse_timer_prod_type(struct evt_options *opt, const char *arg __rte_unused) { @@ -510,6 +521,10 @@ usage(char *program) " across all the ethernet devices before\n" " event workers start.\n" "\t--tx_pkt_sz : Packet size to use with Tx first." + "\t--preschedule : Pre-schedule type to use.\n" + " 0 - disable pre-schedule\n" + " 1 - pre-schedule\n" + " 2 - pre-schedule adaptive (Default)\n" ); printf("available tests:\n"); evt_test_dump_names(); @@ -598,6 +613,7 @@ static struct option lgopts[] = { { EVT_HELP, 0, 0, 0 }, { EVT_TX_FIRST, 1, 0, 0 }, { EVT_TX_PKT_SZ, 1, 0, 0 }, + { EVT_PRESCHEDULE, 1, 0, 0 }, { NULL, 0, 0, 0 } }; @@ -647,6 +663,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_PER_PORT_POOL, evt_parse_per_port_pool}, { EVT_TX_FIRST, evt_parse_tx_first}, { EVT_TX_PKT_SZ, evt_parse_tx_pkt_sz}, + { EVT_PRESCHEDULE, evt_parse_preschedule}, }; for (i = 0; i < RTE_DIM(parsermap); i++) { diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h index 646060c7c6..18a893b704 100644 --- a/app/test-eventdev/evt_options.h +++ b/app/test-eventdev/evt_options.h @@ -59,6 +59,7 @@ #define EVT_PER_PORT_POOL ("per_port_pool") #define EVT_TX_FIRST ("tx_first") #define EVT_TX_PKT_SZ ("tx_pkt_sz") +#define EVT_PRESCHEDULE ("preschedule") #define EVT_HELP ("help") void evt_options_default(struct evt_options *opt); diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst index 00eb702571..38e2ec0c36 100644 --- a/doc/guides/tools/testeventdev.rst +++ b/doc/guides/tools/testeventdev.rst @@ -236,6 +236,12 @@ The following are the application command-line options: Packet size to use for `--tx_first`. Only applicable for `pipeline_atq` and `pipeline_queue` tests. +* ``--preschedule`` + + Enable pre-scheduling of events. + 0 - Disable pre-scheduling. + 1 - Enable pre-scheduling. + 2 - Enable pre-schedule with adaptive mode (Default). Eventdev Tests -------------- -- 2.25.1