From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 10349A00E6 for ; Mon, 10 Jun 2019 16:46:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 07D3B1C07B; Mon, 10 Jun 2019 16:46:14 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id B91A81C06B for ; Mon, 10 Jun 2019 16:46:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 07:46:11 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 10 Jun 2019 07:46:11 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Jun 2019 07:46:11 -0700 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.97]) by FMSMSX109.amr.corp.intel.com ([169.254.15.58]) with mapi id 14.03.0415.000; Mon, 10 Jun 2019 07:46:11 -0700 From: "Carrillo, Erik G" To: Anoob Joseph , Jerin Jacob , "Rao, Nikhil" , "Gujjar, Abhinandan S" , "Richardson, Bruce" , "De Lara Guarch, Pablo" CC: Narayana Prasad , "dev@dpdk.org" , Lukasz Bartosik , Pavan Nikhilesh , Hemant Agrawal , "Nipun Gupta" , "Van Haaren, Harry" , =?iso-8859-1?Q?Mattias_R=F6nnblom?= , "Ma, Liang J" Thread-Topic: [PATCH 32/39] eventdev: add routine to launch eventmode workers Thread-Index: AQHVGjLtu56PyxAMAkWUTtITb3ilvaaU/+Xw Date: Mon, 10 Jun 2019 14:46:10 +0000 Message-ID: References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> <1559583160-13944-33-git-send-email-anoobj@marvell.com> In-Reply-To: <1559583160-13944-33-git-send-email-anoobj@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmNhZjI0YTktNTcyYS00Y2JhLWIwZmYtYzY3NTgxNTM1YTkyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZVlvaXFqa2RnZXpLUE5Uem9HVkI4WXpOZXZEaHVYdjdPZ3U5UDhkeEQzTThLd3pLUFlLbzA5bUplOGtoV1dcL2gifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 32/39] eventdev: add routine to launch eventmode workers 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" Hi Anoob, One other observation in-line: > -----Original Message----- > From: Anoob Joseph > Sent: Monday, June 3, 2019 12:33 PM > To: Jerin Jacob ; Rao, Nikhil ; > Carrillo, Erik G ; Gujjar, Abhinandan S > ; Richardson, Bruce > ; De Lara Guarch, Pablo > > Cc: Anoob Joseph ; Narayana Prasad > ; dev@dpdk.org; Lukasz Bartosik > ; Pavan Nikhilesh ; > Hemant Agrawal ; Nipun Gupta > ; Van Haaren, Harry > ; Mattias R=F6nnblom > ; Ma, Liang J > Subject: [PATCH 32/39] eventdev: add routine to launch eventmode workers >=20 > With eventmode, workers could be drafted differently according to the > capabilities of the underlying event device. The added function would > receive an array of such workers and probes the eventmode properties to > choose the worker. >=20 > Signed-off-by: Anoob Joseph > Signed-off-by: Lukasz Bartosik > --- <...Snipped...> > + > +void __rte_experimental > +rte_eventmode_helper_launch_worker(struct > rte_eventmode_helper_conf *mode_conf, > + struct rte_eventmode_helper_app_worker_params > *app_wrkr, > + uint8_t nb_wrkr_param) > +{ > + struct rte_eventmode_helper_app_worker_params *match_wrkr; > + uint32_t lcore_id; > + struct eventmode_conf *em_conf; > + > + if (mode_conf =3D=3D NULL) { > + RTE_EM_HLPR_LOG_ERR("Invalid conf"); > + return; > + } > + > + if (mode_conf->mode_params =3D=3D NULL) { > + RTE_EM_HLPR_LOG_ERR("Invalid mode params"); > + return; > + } > + > + /* Get eventmode conf */ > + em_conf =3D (struct eventmode_conf *)(mode_conf->mode_params); > + > + /* Get core ID */ > + lcore_id =3D rte_lcore_id(); > + > + /* TODO check capability for rx core */ > + > + /* Check if this is rx core */ > + if (em_conf->eth_core_mask & (1 << lcore_id)) { In the above, eth_core_mask is a uint32_t, but RTE_MAX_LCORE=3D128 in the c= ommon config. > + rte_eventmode_helper_start_worker_eth_core(em_conf, > lcore_id); > + return; > + } > + > + if (app_wrkr =3D=3D NULL || nb_wrkr_param =3D=3D 0) { > + RTE_EM_HLPR_LOG_ERR("Invalid args"); > + return; > + } > + > + /* > + * This is a regular worker thread. The application would be > + * registering multiple workers with various capabilities. The > + * worker to be run will be selected by the capabilities of the > + * event device configured. > + */ > + > + /* Get the first matching worker for the event device */ > + match_wrkr =3D rte_eventmode_helper_find_worker(lcore_id, > + em_conf, > + app_wrkr, > + nb_wrkr_param); > + > + if (match_wrkr =3D=3D NULL) { > + RTE_EM_HLPR_LOG_ERR( > + "No matching worker registered for lcore %d", > lcore_id); > + goto clean_and_exit; > + } > + > + /* Verify sanity of the matched worker */ > + if (rte_eventmode_helper_verify_match_worker(match_wrkr) !=3D 1) > { > + RTE_EM_HLPR_LOG_ERR("Error in validating the matched > worker"); > + goto clean_and_exit; > + } > + > + /* Launch the worker thread */ > + match_wrkr->worker_thread(mode_conf); > + > +clean_and_exit: > + > + /* Flag eth_cores to stop, if started */ > + rte_eventmode_helper_stop_worker_eth_core(); > +} <...Snipped...> Regards, Erik