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 ACE3FA04F3; Fri, 20 Dec 2019 15:27:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD75B3576; Fri, 20 Dec 2019 15:27:55 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 8D784235; Fri, 20 Dec 2019 15:27:54 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBKERkP8005786; Fri, 20 Dec 2019 06:27:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=sfranZD6/5Z7DL2RcmHTdeCiMPAmrfpOrjx2TAUs+Ug=; b=s+jo7KA+ckB6sgN1JOws10srh2/SCXotZxBwuyTkbnOsKVRWYzP9VtbW8eOUp9st6LEx C79sTdSHE+buEPvuO4ihpiKaawIBTy3QiDcVtC0Rl5z63nfbiiq/agqIHqWjHPltLUwY zwcWwpUKA0DxxrpRp07IqrIpfE1AhbX0FVmLjH2fIRnFGLdOY3b5m27BXEXIxy1f8Uix oKcGdn5RSVX00Wga7KwTH5RZgrVvVBpxyrM6O6z0KcwRB9dOEYnBbs5VEY7PqlVP6Td0 SHAO/Mx7skNFO14O5XKtKWsLE4CH1zhydYIJqKYU2kCYdDU2OCPUo0Kj75ABpoZx0yYk KA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2x0sfy16fd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 20 Dec 2019 06:27:53 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 20 Dec 2019 06:27:47 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 20 Dec 2019 06:27:47 -0800 Received: from BG-LT7430.marvell.com (unknown [10.28.17.28]) by maili.marvell.com (Postfix) with ESMTP id BFB453F7040; Fri, 20 Dec 2019 06:27:43 -0800 (PST) From: To: , Marko Kovacevic , Ori Kam , Bruce Richardson , "Radu Nicolau" , Akhil Goyal , "Tomasz Kantecki" , Sunil Kumar Kori , Pavan Nikhilesh CC: , Date: Fri, 20 Dec 2019 19:57:41 +0530 Message-ID: <20191220142742.2077-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 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,18.0.572 definitions=2019-12-20_03:2019-12-17,2019-12-20 signatures=0 Subject: [dpdk-dev] [PATCH] examples/l2fwd-event: fix event device config 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: Pavan Nikhilesh Always enable implicit release since we don't support explicit release in datapath. Master lcore is used only for printing stats so don't allocate event port for it. Fix service launch for event device without distributed scheduling. Fixes: bcb6f841d42a ("examples/l2fwd-event: setup service core") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh --- examples/l2fwd-event/l2fwd_event.c | 2 +- examples/l2fwd-event/l2fwd_event_generic.c | 9 ++++++--- examples/l2fwd-event/l2fwd_event_internal_port.c | 11 +++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-event/l2fwd_event.c index 0379c580d..38d590c14 100644 --- a/examples/l2fwd-event/l2fwd_event.c +++ b/examples/l2fwd-event/l2fwd_event.c @@ -67,7 +67,7 @@ l2fwd_event_service_setup(struct l2fwd_resources *rsrc) int ret, i; rte_event_dev_info_get(evt_rsrc->event_d_id, &evdev_info); - if (evdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED) { + if (!(evdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED)) { ret = rte_event_dev_service_id_get(evt_rsrc->event_d_id, &service_id); if (ret != -ESRCH && ret != 0) diff --git a/examples/l2fwd-event/l2fwd_event_generic.c b/examples/l2fwd-event/l2fwd_event_generic.c index b7e467c1e..b07306a17 100644 --- a/examples/l2fwd-event/l2fwd_event_generic.c +++ b/examples/l2fwd-event/l2fwd_event_generic.c @@ -42,8 +42,10 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc) /* Event device configurtion */ rte_event_dev_info_get(event_d_id, &dev_info); - evt_rsrc->disable_implicit_release = !!(dev_info.event_dev_cap & - RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE); + + /* Enable implicit release */ + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE) + evt_rsrc->disable_implicit_release = 0; if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES) event_queue_cfg |= RTE_EVENT_QUEUE_CFG_ALL_TYPES; @@ -70,7 +72,8 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc) event_d_conf.nb_event_port_enqueue_depth = dev_info.max_event_port_enqueue_depth; - num_workers = rte_lcore_count() - rte_service_lcore_count(); + /* Ignore Master core and service cores. */ + num_workers = rte_lcore_count() - 1 - rte_service_lcore_count(); if (dev_info.max_event_ports < num_workers) num_workers = dev_info.max_event_ports; diff --git a/examples/l2fwd-event/l2fwd_event_internal_port.c b/examples/l2fwd-event/l2fwd_event_internal_port.c index b382763dd..5e6e8598a 100644 --- a/examples/l2fwd-event/l2fwd_event_internal_port.c +++ b/examples/l2fwd-event/l2fwd_event_internal_port.c @@ -27,7 +27,6 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) .nb_event_port_enqueue_depth = 128 }; struct rte_event_dev_info dev_info; - uint8_t disable_implicit_release; const uint8_t event_d_id = 0; /* Always use first event device only */ uint32_t event_queue_cfg = 0; uint16_t ethdev_count = 0; @@ -44,10 +43,9 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) /* Event device configurtion */ rte_event_dev_info_get(event_d_id, &dev_info); - disable_implicit_release = !!(dev_info.event_dev_cap & - RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE); - evt_rsrc->disable_implicit_release = - disable_implicit_release; + /* Enable implicit release */ + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE) + evt_rsrc->disable_implicit_release = 0; if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES) event_queue_cfg |= RTE_EVENT_QUEUE_CFG_ALL_TYPES; @@ -73,7 +71,8 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) event_d_conf.nb_event_port_enqueue_depth = dev_info.max_event_port_enqueue_depth; - num_workers = rte_lcore_count(); + /* Ignore Master core. */ + num_workers = rte_lcore_count() - 1; if (dev_info.max_event_ports < num_workers) num_workers = dev_info.max_event_ports; -- 2.17.1