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 7581B45AAF; Fri, 4 Oct 2024 18:26:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 699BF42F37; Fri, 4 Oct 2024 18:25:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B82E342DA3 for ; Fri, 4 Oct 2024 18:25:27 +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 494E9B8C021820; Fri, 4 Oct 2024 09:25:27 -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=CddgI42VMF18lwDSe 9KxkcXDbeDQsX64t37/VDAKTTrykZN24H2YsD5YwZk7Z8hBw99r2NYLkZ4PV5vww W9hdSLwJxWITAgLhEdMkji0mjaz/80dcoxP5IdnzOTnpFGujU7QIz4qhH30b8tHN DwoiIfKVxLzhTcXkS64mjIUkcP+Ytimo7z6HQGS2+lztMVeeMYw2/sq3Y8iyecMt PGX38+4PmNFqlAasfhxFX/gMe4woaHsYgcNaVIm/7SmRs2dP+t03tm4dsae8nfuN u5erdDF98H3O8Nz2geeSvxic4H4efvvBFMWOhs0HjyxSw6RtaGdXfCl1lAi/hMOc USFKg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 42204tj99m-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Oct 2024 09:25:26 -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; Fri, 4 Oct 2024 09:25:19 -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; Fri, 4 Oct 2024 09:25:19 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 21AF23F7071; Fri, 4 Oct 2024 09:25:15 -0700 (PDT) From: To: , , , , , , , , CC: , Pavan Nikhilesh Subject: [PATCH v5 5/6] app/test-eventdev: add pre-scheduling support Date: Fri, 4 Oct 2024 21:54:50 +0530 Message-ID: <20241004162451.6842-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241004162451.6842-1-pbhagavatula@marvell.com> References: <20241001131901.7920-1-pbhagavatula@marvell.com> <20241004162451.6842-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: WQl7rgyacnhNhpE8qM-OrC6NIQi5TSI1 X-Proofpoint-GUID: WQl7rgyacnhNhpE8qM-OrC6NIQi5TSI1 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..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