From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CB861A0613 for ; Tue, 24 Sep 2019 11:43:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 887D41BEA5; Tue, 24 Sep 2019 11:42:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D718F397D for ; Tue, 24 Sep 2019 11:42:42 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8O9ebW3031413; Tue, 24 Sep 2019 02:42:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=Z5042YI86RClvIsCdLEhD6jpf2jUYl0rc1VOBpm/osw=; b=Skrn+4geVZQ0ImsgV0XIFV2sKcR0ke6Z0yAd6xJ+iVjt25ukBzi4cs8R+GI8Y16Pj60+ N2Juuzd1JJhxIk7armzElVhwO0rkkaMmrC00pDNHKtP87qLBn14Zi2PItzAugoxoiBsW NMdPp8Wg5TMMlnDAevFPCpHobBFalusAe44fw/pZJh3d426ODReWXlYGL5OYbQ3Lcshl PRo1BeIkC/GRjdCAb1SMc9ooH4S7wKgidkq9KuOyHsNGpLTIziqM3YnS1UfT6Q1vtDBE 8qDjgqBQeVmz8/4tfP11RFkQYHbtIgthNcOjA0YW8y/0F1xSfQAUFvGw2dgJiCcNfhio dw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2v5h7qj4ja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 02:42:42 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 24 Sep 2019 02:42:40 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 24 Sep 2019 02:42:40 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.28]) by maili.marvell.com (Postfix) with ESMTP id 002E53F703F; Tue, 24 Sep 2019 02:42:37 -0700 (PDT) From: To: , , , Marko Kovacevic , Ori Kam , Radu Nicolau , Tomasz Kantecki , Sunil Kumar Kori , "Pavan Nikhilesh" CC: Date: Tue, 24 Sep 2019 15:12:06 +0530 Message-ID: <20190924094209.3827-8-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190924094209.3827-1-pbhagavatula@marvell.com> References: <20190919101346.8832-1-pbhagavatula@marvell.com> <20190924094209.3827-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-24_04:2019-09-23,2019-09-24 signatures=0 Subject: [dpdk-dev] [PATCH v4 07/10] examples/l2fwd-event: add service core setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sunil Kumar Kori Add service core setup when eventdev and Rx/Tx adapter don't have internal port capability. Signed-off-by: Sunil Kumar Kori --- examples/l2fwd-event/l2fwd_eventdev_generic.c | 31 +++++++++++++++++++ .../l2fwd_eventdev_internal_port.c | 6 ++++ examples/l2fwd-event/main.c | 2 ++ 3 files changed, 39 insertions(+) diff --git a/examples/l2fwd-event/l2fwd_eventdev_generic.c b/examples/l2fwd-event/l2fwd_eventdev_generic.c index 68b63279a..e1e603052 100644 --- a/examples/l2fwd-event/l2fwd_eventdev_generic.c +++ b/examples/l2fwd-event/l2fwd_eventdev_generic.c @@ -17,6 +17,36 @@ #include "l2fwd_common.h" #include "l2fwd_eventdev.h" +static void +eventdev_service_setup_generic(void) +{ + struct eventdev_resources *eventdev_rsrc = get_eventdev_rsrc(); + uint32_t lcore_id[RTE_MAX_LCORE] = {0}; + int32_t req_service_cores = 3; + int32_t avail_service_cores; + + avail_service_cores = rte_service_lcore_list(lcore_id, RTE_MAX_LCORE); + if (avail_service_cores < req_service_cores) { + rte_exit(EXIT_FAILURE, "Enough services cores are not present" + " Required = %d Available = %d", + req_service_cores, avail_service_cores); + } + + /* Start eventdev scheduler service */ + rte_service_map_lcore_set(eventdev_rsrc->service_id, lcore_id[0], 1); + rte_service_lcore_start(lcore_id[0]); + + /* Start eventdev Rx adapter service */ + rte_service_map_lcore_set(eventdev_rsrc->rx_adptr.service_id, + lcore_id[1], 1); + rte_service_lcore_start(lcore_id[1]); + + /* Start eventdev Tx adapter service */ + rte_service_map_lcore_set(eventdev_rsrc->tx_adptr.service_id, + lcore_id[2], 1); + rte_service_lcore_start(lcore_id[2]); +} + static uint32_t eventdev_setup_generic(uint16_t ethdev_count) { @@ -315,4 +345,5 @@ eventdev_set_generic_ops(struct eventdev_setup_ops *ops) ops->event_queue_setup = event_queue_setup_generic; ops->event_port_setup = event_port_setup_generic; ops->adapter_setup = rx_tx_adapter_setup_generic; + ops->service_setup = eventdev_service_setup_generic; } diff --git a/examples/l2fwd-event/l2fwd_eventdev_internal_port.c b/examples/l2fwd-event/l2fwd_eventdev_internal_port.c index 02663242f..39fcb4326 100644 --- a/examples/l2fwd-event/l2fwd_eventdev_internal_port.c +++ b/examples/l2fwd-event/l2fwd_eventdev_internal_port.c @@ -265,6 +265,11 @@ rx_tx_adapter_setup_internal_port(uint16_t ethdev_count) } } +static void +eventdev_service_setup_internal_port(void) +{ +} + void eventdev_set_internal_port_ops(struct eventdev_setup_ops *ops) { @@ -272,4 +277,5 @@ eventdev_set_internal_port_ops(struct eventdev_setup_ops *ops) ops->event_queue_setup = event_queue_setup_internal_port; ops->event_port_setup = event_port_setup_internal_port; ops->adapter_setup = rx_tx_adapter_setup_internal_port; + ops->service_setup = eventdev_service_setup_internal_port; } diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 3f72d0579..60882da52 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -633,6 +633,8 @@ main(int argc, char **argv) ret, portid); } + /* Now start internal services */ + eventdev_rsrc->ops.service_setup(); goto skip_port_config; } -- 2.17.1