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 42A66A3201 for ; Mon, 21 Oct 2019 05:20:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 82AA6F3E; Mon, 21 Oct 2019 05:20:02 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 83C43A69 for ; Mon, 21 Oct 2019 05:20:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 20:20:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,322,1566889200"; d="scan'208";a="195992199" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 20 Oct 2019 20:20:00 -0700 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 20 Oct 2019 20:19:59 -0700 Received: from bgsmsx106.gar.corp.intel.com (10.223.43.196) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 20 Oct 2019 20:19:59 -0700 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.199]) by BGSMSX106.gar.corp.intel.com ([169.254.1.191]) with mapi id 14.03.0439.000; Mon, 21 Oct 2019 08:49:56 +0530 From: "Varghese, Vipin" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Kovacevic, Marko" , "Ori Kam" , "Nicolau, Radu" , "Akhil Goyal" , "Kantecki, Tomasz" , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main loop Thread-Index: AQHVgryniVnEWHqY1UansMBKecuW7qdkdVNg Date: Mon, 21 Oct 2019 03:19:56 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D3DCA5B@BGSMSX101.gar.corp.intel.com> References: <20191002205754.11746-1-pbhagavatula@marvell.com> <20191014182247.961-1-pbhagavatula@marvell.com> <20191014182247.961-9-pbhagavatula@marvell.com> In-Reply-To: <20191014182247.961-9-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDJmOWJmMTktOWQ4Ni00ZDM4LWI5YzMtMDJjYmY5NDIxNjMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRUJlQ3lDTys1XC9qRWhMZmdzcnhTRlpacEdxMFJ1bkVvdE1qcThTYjlLOTNPUVNUb3N4XC9Fc3BwMHFadGhhcE50In0= dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main loop 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 Pavan, snipped > Add event dev main loop based on enabled l2fwd options and eventdev > capabilities. >=20 > Signed-off-by: Pavan Nikhilesh > --- > + if (rsrc->event_mode) { > + port_conf.rxmode.mq_mode =3D ETH_MQ_RX_RSS; > + port_conf.rx_adv_conf.rss_conf.rss_key =3D NULL; > + port_conf.rx_adv_conf.rss_conf.rss_hf =3D ETH_RSS_IP; > + } Question, is RSS hash configured for generating flow id for Eventdev? As my= understanding. RSS for single RX port-queue pair does not require the same= .=20 snipped > + if (is_master && timer_period > 0) { > + cur_tsc =3D rte_rdtsc(); > + diff_tsc =3D cur_tsc - prev_tsc; > + > + /* advance the timer */ > + timer_tsc +=3D diff_tsc; > + > + /* if timer has reached its timeout */ > + if (unlikely(timer_tsc >=3D timer_period)) { > + print_stats(rsrc); > + /* reset the timer */ > + timer_tsc =3D 0; > + } > + prev_tsc =3D cur_tsc; > + } Is it possible to move the print_stats to service core, as 'CALL_MASTER' is= enabled in remote_launch making this a potential worker? > + > + /* Read packet from eventdev */ > + if (!rte_event_dequeue_burst(event_d_id, port_id, &ev, 1, 0)) > + continue; Is not this unlikely `nb_burst =3D=3D 0` > + > + l2fwd_event_fwd(rsrc, &ev, tx_q_id, timer_period, flags); > + > + if (flags & L2FWD_EVENT_TX_ENQ) { > + while (rte_event_enqueue_burst(event_d_id, port_id, > + &ev, 1) && > + !rsrc->force_quit) > + ; Can we place a `continue` as we are not expecting ` L2FWD_EVENT_TX_DIRECT`? > + } > + > + if (flags & L2FWD_EVENT_TX_DIRECT) { > + while > (!rte_event_eth_tx_adapter_enqueue(event_d_id, > + port_id, > + &ev, 1, 0) && > + !rsrc->force_quit) > + ; > + } > + } snipped > + > + while (!rsrc->force_quit) { > + /* if timer is enabled */ > + if (is_master && timer_period > 0) { > + cur_tsc =3D rte_rdtsc(); > + diff_tsc =3D cur_tsc - prev_tsc; > + > + /* advance the timer */ > + timer_tsc +=3D diff_tsc; > + > + /* if timer has reached its timeout */ > + if (unlikely(timer_tsc >=3D timer_period)) { > + print_stats(rsrc); > + /* reset the timer */ > + timer_tsc =3D 0; > + } > + prev_tsc =3D cur_tsc; > + } Can we move `print_stats` logic to service core? > + > + /* Read packet from eventdev */ > + nb_rx =3D rte_event_dequeue_burst(event_d_id, port_id, ev, > + deq_len, 0); > + if (nb_rx =3D=3D 0) Can we use `unlikely`? > + continue; > + > + for (i =3D 0; i < nb_rx; i++) { > + l2fwd_event_fwd(rsrc, &ev[i], tx_q_id, timer_period, > + flags); > + } > + > + if (flags & L2FWD_EVENT_TX_ENQ) { > + nb_tx =3D rte_event_enqueue_burst(event_d_id, port_id, > + ev, nb_rx); > + while (nb_tx < nb_rx && !rsrc->force_quit) > + nb_tx +=3D > rte_event_enqueue_burst(event_d_id, > + port_id, ev + nb_tx, > + nb_rx - nb_tx); Can we use `continue` as we do not transmit from the same worker int his ca= se? > + } > + snipped