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 AF692A2EFC for ; Thu, 19 Sep 2019 11:27:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3FE5F1ED56; Thu, 19 Sep 2019 11:26:39 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D0C381ED55 for ; Thu, 19 Sep 2019 11:26:37 +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 x8J9PUUX012561; Thu, 19 Sep 2019 02:26:37 -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=PNQfFZ5D0MrLEPJt4yfrMqyfxB4sVPs+xAaOydsr/YY=; b=r360m8DKPC35T/zEZv3whttbrUl7Y63H6wqOKxjsgNB5XGETlJ24uKAV3Tsv65tYE9i4 gT5ORgbS9JwXB6rT+HZYwq7xwN05vc8Zuok0x/Vkg9QYZ/oMwDm3xNpnUTjVyqfop2K5 4yXJN+07ggmIrO7X/IBtq/fGm9OnBa6zvgukbMVkZr6SAlPTAojbovJmmO9aBE+nFm+f Nhy1tp4U269sEa/UH6TgS8Rf/aBV7x00+bvqMPv10K7i8go7NG0OD7cG1hLYZ6CmDO/P RFaueWO6c705RPU+BvIdCCzlvSzHb4ntiE8zxaT6TZG9ZltjQhI1jpJ5sXQ5ELKbbzS1 Ww== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2v3vcdt774-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Sep 2019 02:26:37 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 19 Sep 2019 02:26:35 -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; Thu, 19 Sep 2019 02:26:35 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.12]) by maili.marvell.com (Postfix) with ESMTP id B95143F703F; Thu, 19 Sep 2019 02:26:32 -0700 (PDT) From: To: , , , Marko Kovacevic , Ori Kam , Radu Nicolau , Tomasz Kantecki , Sunil Kumar Kori , "Pavan Nikhilesh" CC: Date: Thu, 19 Sep 2019 14:56:01 +0530 Message-ID: <20190919092603.5485-8-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919092603.5485-1-pbhagavatula@marvell.com> References: <20190919092603.5485-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.70,1.0.8 definitions=2019-09-19_03:2019-09-18,2019-09-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 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 f24bdd4a4..09c86d2cd 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -616,6 +616,8 @@ main(int argc, char **argv) ret, portid); } + /* Now start internal services */ + eventdev_rsrc->ops.service_setup(); goto skip_port_config; } -- 2.17.1