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 98AA445AAF; Fri, 4 Oct 2024 18:26:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6371942E97; Fri, 4 Oct 2024 18:25:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BB55642DA3 for ; Fri, 4 Oct 2024 18:25:26 +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 494E9bUv022373; Fri, 4 Oct 2024 09:25:26 -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=D 92h1U+b4SRBMTqBWxsAOah1Zh/ebIpeR5Ke/xVZn9s=; b=Veo2MpWeYdm7qb1FR ofOhOjPmKrzlrIhIeJTph/6Ywe+S8L1UOX48jTVg/bgEd4iQAS9CyU7uaqxxYH89 N5VgQejCiZCO11heb0ppr7mUYi8mlgCt4fdXonYFGFi97ObykSS6bpoFVulYjU6p GMdIRDZoK4VHcZCN44aNQ7SZdfH/ilLCmIRFEaEh1gXoRGULELO+ftRGmj3reww8 AQtU+rZMr6fejhsY+S9ld+fi3SqCHT6qKTVSxrt6JIiMcKTwqWcDo3d+um6mPnht F9u8I8rPwlnUXC01dn3DjlHcZ6bypzOjh1Wg3RkX5LOLY/xMvtHt9+g1bysRJWpd tR8oA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 42204tj9b5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Oct 2024 09:25:25 -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; Fri, 4 Oct 2024 09:25:25 -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; Fri, 4 Oct 2024 09:25:25 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 647743F7061; Fri, 4 Oct 2024 09:25:20 -0700 (PDT) From: To: , , , , , , , , , Radu Nicolau , "Akhil Goyal" , Sunil Kumar Kori , "Pavan Nikhilesh" CC: Subject: [PATCH v5 6/6] examples: use eventdev pre-scheduling Date: Fri, 4 Oct 2024 21:54:51 +0530 Message-ID: <20241004162451.6842-7-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: hI8jvMn7r8iVlbPjqT10b-k_4GRjxxMB X-Proofpoint-GUID: hI8jvMn7r8iVlbPjqT10b-k_4GRjxxMB 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 Enable event pre-scheduling if supported by the event device. Signed-off-by: Pavan Nikhilesh --- examples/eventdev_pipeline/pipeline_worker_generic.c | 6 ++++++ examples/eventdev_pipeline/pipeline_worker_tx.c | 6 ++++++ examples/ipsec-secgw/event_helper.c | 6 ++++++ examples/l2fwd-event/l2fwd_event_generic.c | 6 ++++++ examples/l2fwd-event/l2fwd_event_internal_port.c | 6 ++++++ examples/l3fwd/l3fwd_event_generic.c | 6 ++++++ examples/l3fwd/l3fwd_event_internal_port.c | 6 ++++++ 7 files changed, 42 insertions(+) diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c index 831d7fd53d..06384c683c 100644 --- a/examples/eventdev_pipeline/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline/pipeline_worker_generic.c @@ -192,6 +192,12 @@ setup_eventdev_generic(struct worker_data *worker_data) config.nb_event_port_enqueue_depth = dev_info.max_event_port_enqueue_depth; + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + config.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + config.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + ret = rte_event_dev_configure(dev_id, &config); if (ret < 0) { printf("%d: Error configuring device\n", __LINE__); diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c index 98a52f3892..c9a04cad56 100644 --- a/examples/eventdev_pipeline/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline/pipeline_worker_tx.c @@ -505,6 +505,12 @@ setup_eventdev_worker_tx_enq(struct worker_data *worker_data) config.nb_event_port_enqueue_depth = dev_info.max_event_port_enqueue_depth; + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + config.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + config.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + ret = rte_event_dev_configure(dev_id, &config); if (ret < 0) { printf("%d: Error configuring device\n", __LINE__); diff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c index 89fb7e62a5..dadddcb306 100644 --- a/examples/ipsec-secgw/event_helper.c +++ b/examples/ipsec-secgw/event_helper.c @@ -669,6 +669,12 @@ eh_initialize_eventdev(struct eventmode_conf *em_conf) eventdev_conf.nb_event_port_enqueue_depth = evdev_default_conf.max_event_port_enqueue_depth; + if (evdev_default_conf.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + eventdev_conf.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (evdev_default_conf.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + eventdev_conf.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + /* Configure event device */ ret = rte_event_dev_configure(eventdev_id, &eventdev_conf); if (ret < 0) { diff --git a/examples/l2fwd-event/l2fwd_event_generic.c b/examples/l2fwd-event/l2fwd_event_generic.c index 1977e23261..d805264744 100644 --- a/examples/l2fwd-event/l2fwd_event_generic.c +++ b/examples/l2fwd-event/l2fwd_event_generic.c @@ -86,6 +86,12 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc) evt_rsrc->has_burst = !!(dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE); + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + ret = rte_event_dev_configure(event_d_id, &event_d_conf); if (ret < 0) rte_panic("Error in configuring event device\n"); diff --git a/examples/l2fwd-event/l2fwd_event_internal_port.c b/examples/l2fwd-event/l2fwd_event_internal_port.c index 717a7bceb8..26233d1ab6 100644 --- a/examples/l2fwd-event/l2fwd_event_internal_port.c +++ b/examples/l2fwd-event/l2fwd_event_internal_port.c @@ -82,6 +82,12 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) evt_rsrc->has_burst = !!(dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE); + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + ret = rte_event_dev_configure(event_d_id, &event_d_conf); if (ret < 0) rte_panic("Error in configuring event device\n"); diff --git a/examples/l3fwd/l3fwd_event_generic.c b/examples/l3fwd/l3fwd_event_generic.c index ddb6e5c38d..d86439df52 100644 --- a/examples/l3fwd/l3fwd_event_generic.c +++ b/examples/l3fwd/l3fwd_event_generic.c @@ -74,6 +74,12 @@ l3fwd_event_device_setup_generic(void) evt_rsrc->has_burst = !!(dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE); + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + ret = rte_event_dev_configure(event_d_id, &event_d_conf); if (ret < 0) rte_panic("Error in configuring event device\n"); diff --git a/examples/l3fwd/l3fwd_event_internal_port.c b/examples/l3fwd/l3fwd_event_internal_port.c index cb49a8b9fa..b390e3469d 100644 --- a/examples/l3fwd/l3fwd_event_internal_port.c +++ b/examples/l3fwd/l3fwd_event_internal_port.c @@ -73,6 +73,12 @@ l3fwd_event_device_setup_internal_port(void) evt_rsrc->has_burst = !!(dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE); + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE; + + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE) + event_d_conf.preschedule_type = RTE_EVENT_PRESCHEDULE_ADAPTIVE; + ret = rte_event_dev_configure(event_d_id, &event_d_conf); if (ret < 0) rte_panic("Error in configuring event device\n"); -- 2.25.1