From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 197644A59 for ; Fri, 2 Dec 2016 01:10:33 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 01 Dec 2016 16:10:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="793256149" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by FMSMGA003.fm.intel.com with ESMTP; 01 Dec 2016 16:10:31 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.43]) by IRSMSX151.ger.corp.intel.com ([169.254.4.16]) with mapi id 14.03.0248.002; Fri, 2 Dec 2016 00:10:30 +0000 From: "Ananyev, Konstantin" To: "Kulasek, TomaszX" , Thomas Monjalon CC: "dev@dpdk.org" , "olivier.matz@6wind.com" , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH v12 1/6] ethdev: add Tx preparation Thread-Index: AQHSRbBXtZ+k3KL6/UOfLLeqKZ5NC6DuQDCAgAUTIYCAADE+AIAACOwAgAAshQCAABRuEA== Date: Fri, 2 Dec 2016 00:10:30 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0E2A74@irsmsx105.ger.corp.intel.com> References: <1477486575-25148-1-git-send-email-tomaszx.kulasek@intel.com> <1734448.0id6dCbsBT@xps13> <3042915272161B4EB253DA4D77EB373A14F57CAE@IRSMSX102.ger.corp.intel.com> <2505996.o0gdCe9Hsd@xps13> <3042915272161B4EB253DA4D77EB373A14F57CDE@IRSMSX102.ger.corp.intel.com> In-Reply-To: <3042915272161B4EB253DA4D77EB373A14F57CDE@IRSMSX102.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v12 1/6] ethdev: add Tx preparation 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: , X-List-Received-Date: Fri, 02 Dec 2016 00:10:34 -0000 >=20 > Hi Thomas, >=20 > > -----Original Message----- > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > Sent: Thursday, December 1, 2016 20:52 > > To: Kulasek, TomaszX > > Cc: dev@dpdk.org; Ananyev, Konstantin ; > > olivier.matz@6wind.com; Richardson, Bruce > > Subject: Re: [dpdk-dev] [PATCH v12 1/6] ethdev: add Tx preparation > > > > 2016-12-01 19:20, Kulasek, TomaszX: > > > Hi Thomas, > > > > > > Sorry, I have answered for this question in another thread and I miss= ed > > about this one. Detailed answer is below. > > > > Yes you already gave this answer. > > And I will continue asking the question until you understand it. > > > > > > 2016-11-28 11:54, Thomas Monjalon: > > > > > Hi, > > > > > > > > > > 2016-11-23 18:36, Tomasz Kulasek: > > > > > > --- a/config/common_base > > > > > > +++ b/config/common_base > > > > > > @@ -120,6 +120,7 @@ CONFIG_RTE_MAX_QUEUES_PER_PORT=3D1024 > > > > > > CONFIG_RTE_LIBRTE_IEEE1588=3Dn > > > > > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=3D16 > > > > > > CONFIG_RTE_ETHDEV_RXTX_CALLBACKS=3Dy > > > > > > +CONFIG_RTE_ETHDEV_TX_PREPARE=3Dy > > > > > > > > > > Please, remind me why is there a configuration here. > > > > > It should be the responsibility of the application to call > > > > > tx_prepare or not. If the application choose to use this new API > > > > > but it is disabled, then the packets won't be prepared and there = is > > no error code: > > > > > > > > > > > +#else > > > > > > + > > > > > > +static inline uint16_t > > > > > > +rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused > > > > uint16_t queue_id, > > > > > > + __rte_unused struct rte_mbuf **tx_pkts, uint16_= t > > > > > > +nb_pkts) { > > > > > > + return nb_pkts; > > > > > > +} > > > > > > + > > > > > > +#endif > > > > > > > > > > So the application is not aware of the issue and it will not use > > > > > any fallback. > > > > > > tx_prepare mechanism can be turned off by compilation flag (as discus= sed > > with Jerin in http://dpdk.org/dev/patchwork/patch/15770/) to provide re= al > > NOOP functionality (e.g. for low-end CPUs, where even unnecessary memor= y > > dereference and check can have significant impact on performance). > > > > > > Jerin observed that on some architectures (e.g. low-end ARM with > > embedded NIC), just reading and comparing 'dev->tx_pkt_prepare' may cau= se > > significant performance drop, so he proposed to introduce this > > configuration flag to provide real NOOP when tx_prepare functionality i= s > > not required, and can be turned on based on the _target_ configuration. > > > > > > For other cases, when this flag is turned on (by default), and > > tx_prepare is not implemented, functional NOOP is used based on compari= son > > (dev->tx_pkt_prepare =3D=3D NULL). > > > > So if the application call this function and if it is disabled, it simp= ly > > won't work. Packets won't be prepared, checksum won't be computed. > > > > I give up, I just NACK. >=20 > It is not to be turned on/off whatever someone wants, but only and only f= or the case, when platform developer knows, that his platform > doesn't need this callback, so, he may turn off it and then save some per= formance (this option is per target). >=20 > For this case, the behavior of tx_prepare will be exactly the same when i= t is turned on or off. If is not the same, there's no sense to turn it > off. There were long topic, where we've tried to convince you, that it sh= ould be turned on for all devices. As Tomasz pointed out the RTE_ETHDEV_TX_PREPARE was introduced to fulfill J= erin request. >>From here: "Low-end ARMv7,ARMv8 targets may not have PCIE-RC support and it may have only integrated NIC controller. On those targets/configs, where integrated = NIC controller does not use tx_prep service it can made it as NOOP to save cycles on following "rte_eth_tx_prep" and associated "if (unlikely(nb_prep < nb_rx))" checks in the application." According to the measurements he done it can save ~7% on some low-end ARM m= achine. You can read whole story here: http://dpdk.org/dev/patchwork/patch/15770/ Though, if now you guys believe that this is not good enough reason, I have absolutely no problem to remove the RTE_ETHDEV_TX_PREPARE and associ= ated logic. I personally don't use ARM boxes and don't plan to, and in theory users can still do conditional compilation at the upper layer= , if they want to.=20 Konstantin