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 F14FA45A7B; Sun, 6 Oct 2024 19:06:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5D6640663; Sun, 6 Oct 2024 19:06:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BAD0940661 for ; Sun, 6 Oct 2024 19:06:40 +0200 (CEST) Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 496GUKOm005463; Sun, 6 Oct 2024 10:06:40 -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 cfQGa3rPVbzZ3Al93x/eNGoPU82OPiApC7Y1GIGXB4=; b=WMFCcgV87/jo5Sa83 SE+CPldEEUl7cN/0aV6+9uZJwE4KyPRpEfEegAgX03ggm8MQHKiGa5k5ldSle6iq lhwEe5j9vWOV3uDgBLFEOuEqDFXespaDHdGeLLwuv/JbYuxYpnYpwu9L1y+2ABLA 1Uu9ByKrWD1KegRjG1081fvp6bICAOQ5T9OstaAYx5ohnwnkDyd2P9dLeTK7Dy9o L9lwVSkBdvKHCKTKmmaFHmlRafSld8Q9Rmb2BG9kb9jrzVNYYUtCgEZyvQeTJeAY /WUWfhIaO8RXP9vi8P1fZbEyUAWX883FGXO4X1p7z9b0/geZqt4z1Ye/dECq0m7x 8B1wQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 423p77gjfd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 06 Oct 2024 10:06:39 -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; Sun, 6 Oct 2024 10:06:38 -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; Sun, 6 Oct 2024 10:06:38 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 6D5EB3F7044; Sun, 6 Oct 2024 10:06:34 -0700 (PDT) From: To: , , , , , , , , , CC: , Pavan Nikhilesh Subject: [PATCH v8 5/6] app/test-eventdev: add pre-scheduling support Date: Sun, 6 Oct 2024 22:36:07 +0530 Message-ID: <20241006170608.14182-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241006170608.14182-1-pbhagavatula@marvell.com> References: <20241005080001.8681-1-pbhagavatula@marvell.com> <20241006170608.14182-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: ro7gG1BZzLCyrGK8_xO7syfts6Fwp9xX X-Proofpoint-GUID: ro7gG1BZzLCyrGK8_xO7syfts6Fwp9xX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_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..901b8ba55d 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_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_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_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