From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0080.outbound.protection.outlook.com [104.47.40.80]) by dpdk.org (Postfix) with ESMTP id 4FB242B9E for ; Thu, 22 Sep 2016 12:00:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qPTv3RAvGPIYd0CHUnaNwb0u4raVEbKg+cWVkvTIvEs=; b=Dgsg9lTPspq5g5tvt3UytJoiZqg52jf01+k8eqkuVgaciN2u99HJ3mzHyZgzwpXgGFybQM7daUzbiMGnOSNHkulhWNLD6tpi0OTI67qC6g7CdkG0CArACK2pD85f+b1P3Hqu092jH/0/Jhgo2BKWYoyxKTH99q/PCSUxpA1+84k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (111.93.218.67) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Thu, 22 Sep 2016 10:00:18 +0000 Date: Thu, 22 Sep 2016 15:29:48 +0530 From: Jerin Jacob To: "Ananyev, Konstantin" CC: "Kulasek, TomaszX" , "dev@dpdk.org" Message-ID: <20160922095947.GA6420@localhost.localdomain> References: <1472228578-6980-1-git-send-email-tomaszx.kulasek@intel.com> <1473691487-10032-1-git-send-email-tomaszx.kulasek@intel.com> <1473691487-10032-2-git-send-email-tomaszx.kulasek@intel.com> <2601191342CEEE43887BDE71AB9772583F0B583F@irsmsx105.ger.corp.intel.com> <3042915272161B4EB253DA4D77EB373A14F1A294@IRSMSX102.ger.corp.intel.com> <20160919160630.GA18610@localhost.localdomain> <2601191342CEEE43887BDE71AB9772583F0B8F33@irsmsx105.ger.corp.intel.com> <20160921082956.GA5358@localhost.localdomain> <2601191342CEEE43887BDE71AB9772583F0BA159@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB9772583F0BA159@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.6.2 (2016-07-01) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0014.INDPRD01.PROD.OUTLOOK.COM (10.164.137.21) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: d56eb4f2-f8f4-49f4-3732-08d3e2cf43c7 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 2:nZYxqKtxLfSpq96n4tFHu9zffsEuFrZthrOzNQAyrmc1ADhu3qCEQ3LJJLoQw7RVXIYp47wc91kocIhYwKjD+50LPc2eirHHn4rrimiZVNGjJ5v487FWI3SqPzQgmIuz7eODrC4lqWvRTVF0GtnruxaYQZrMx57NWU+4iKSY4OBmN9UPkEQlaMOo/XqCUuSq; 3:tcPms8PCOghc7Skvlo8VpEVARtaOTAAoDCNyp1NYXtL8e0wImSm+K2aRk5IWLjHxVCsBbmeE2Q1iqGrO8Da+cyatdvthP7WYBGYT8wy2cWQQHNunz+jEAvnhbxVg72QO; 25:GPFb1dYbY9RWXYnxIS/H5bOxzWlSGqWSB154pp7rLfeFvwIFeOsWkDFis2h0+XdB0PoIL94PNrVtrj/LvLfvsRUows+woazOZa4BSHVOaHjG5+g6oDVh0OmphtWoRCyDtRfyB26HLbAGgaKNzwaLYRGICD+60myFizJGStUKwrmXo2gi9NL7pr/LB4E876MOu/PjnxQ6jlbl0tZMBSAuXoFf1Wdfo9B53AsJzj8JHvl9bmGeFdVD7bHerE0s5Wr37r3MxPZ91CoCF0kKrpNOh71Fvzx/Zgw+/f0l2/reIF49rJyHWixI9ckPQJP+KxkKLHuAi+QymjgLYRQSCvzRO+pt9sqpDlQY7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test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:BTrGHGCCL1j4MEJriwRdTN5w5R1t2cCfE90S6P9hOqZijv+92S5YaP0107pSQ0ssY6kWarRdSDC3O1l4g0T07MfOC40QEyXYsYd3qT3pC+anMTWF+OPM6rDxLaXATUOCSU0YMIgYZqTigWOAdwLULfT822VTYtpux29hEuRVKokhUXem+yyo5kIvSfX07PWiqDkpgIJBdOO8K6vpGeNaPF5EpP4WB7zxWQCshN4W8nfcDkBjq3m9PGumgFAs5ixSq1OR562qdN++Y6zL34S4uzPwG4w0mWOKpj6wMjfQi6qffQRBrOtHetNZzE3IZi/c9DlCVBH4pW2WB5lx/tcHOjl4dANCTCmjAnN20BxcIlw1LESkHi8q/Zbq8obigGScjDblH2DPcwamaVDHeTZ5sBbRp5+hid2GpGb7ZB6MITKKKZTkxViS8Cx4qafgbTGM X-Forefront-PRVS: 0073BFEF03 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(24454002)(15395725005)(92566002)(54356999)(2906002)(47776003)(77096005)(15975445007)(1720100001)(2950100001)(101416001)(50466002)(66066001)(9686002)(3846002)(110136003)(5660300001)(76176999)(23726003)(68736007)(586003)(1076002)(83506001)(4326007)(6116002)(61506002)(8676002)(97756001)(5009440100003)(106356001)(46406003)(42186005)(105586002)(50986999)(19580395003)(81156014)(7736002)(97736004)(7846002)(33656002)(4001350100001)(305945005)(189998001)(93886004)(81166006)(7099028)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:G/1fKaPNfi8mnmICb6WB3PwBMWjlwaVr4NjhfRq?= =?us-ascii?Q?XOm/2IPdn2Uipq3i2spLsTXXLSi00PerkWhGsiqdDi39fvX5ckFAefmulSZv?= =?us-ascii?Q?Czt3Mn617xyDeHwS9j4u8ehlviUa2DftuqS1SOrhKaNC1+CqM5v+MQ/aLLbN?= =?us-ascii?Q?IELpsqswEdkXx1fgNx3zVdRNksksk/1E0GiI2l2u9+gOZ5WVkoXSezLTsy9N?= =?us-ascii?Q?i9o+5SjlScONc/JPmrExwpUcS+ZKeCFXAImm86i4XN5u2TvOqsxXz/qinmhb?= =?us-ascii?Q?i8H+CtMoFLCtjit7bXUbpYOE9sfrtHn5k3s6ta3DT6JZml3qP4YuPSDMxIF5?= =?us-ascii?Q?PeqK4Pr1RpyVzeSnF4VjHMPEgrp7eSIiZf2f8AWrrnc7O0/1OGCgzpjFRDqd?= =?us-ascii?Q?GoqGO/TXP4ycXUBkV71uCVDKhC5/YAmGpdYpZQsVaTIGUjXxZC9JnRpOkkhk?= =?us-ascii?Q?JhYGKkmj4awKQBVwsicNWzF2vR3RLTIAD3iV9uJawb6j/OFVDdz2A8ZwOEr1?= =?us-ascii?Q?rejDNWrek/D0inpmeCsiXD+SRwLp4aVSc73P5N1SEPzIfB1W8FwUMDGQEx/e?= =?us-ascii?Q?VSSC7qinGQ48QvwLRkI6kjL6hs44GCqdrp1aoK5wWDqifCQ45RqiWoc3WxAI?= =?us-ascii?Q?AD9uV0kZdG6A6sGKN6yQdcnCvXFJyfa70QV+fSTeyeeAwWkNVO+M/R0ic2O4?= =?us-ascii?Q?t7+4eK4vQKotAAzjVbL90UThHuIlngmkQnQkfs74MgjfZ/BRv+ZaKi/jA+qW?= =?us-ascii?Q?6AEdPyrC9cvH8N2XnsjVKerpf+Ql3gtBmTJsYpOqSN7FFnqOaiSLR5YSya0S?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bbJdBAnDA930eqM2XNBygBcVrKfvlPHgIMhH73DktZYvaoji218IwOgS/NMcTNy4BMlJPAa+Q==; 24:S3Vw6Wz24UFehBCbEwITh9tsWEUfx6NlQ1E4CKrtw5CgGDhYdSlAJeR4mDjvK8Ok3h+BanQ2NG/TO2oMDjNkdh5Zxbn2N7QVFxJOMkYIlLs=; 7:CLJespqrr6VnkBNKZY5xJHZY+6vk1bE5SCdisIvpDMoID2TaNtjhZB2g/jKSRj0Ejq4JqrlKY0B2FK4NsWlnjtGNjqgEipT3KbfaN8Wx5zmX1JbyALVO06kEE4F6HdRa3SCOxEOzplwYgfRkRS8G2RppCG10Y0k/ILhH8DSgLjBo9f7hIJfZNwxdO21ktiDDrn+y4gyxaMnV3XQkKxjhwXmCuaCc6QdU2SChCnRMCtmKcna3NQFU6mF/gKm47iRzzZ2fxe0CfeF6f4JnoDFo32yjcn4hjtELWhaNetvj53vwXbbVolE/NCrLTFQp9ZnD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2016 10:00:18.6307 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: Re: [dpdk-dev] [PATCH v2 1/6] ethdev: add Tx preparation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 10:00:23 -0000 On Thu, Sep 22, 2016 at 09:36:15AM +0000, Ananyev, Konstantin wrote: Hi Konstantin, > > Hi Jerin, > > > > > > > Hi Jerin, > > > > Hi Konstantin, > > > > > > > > > > > > > > > > > > > > > > [...] > > > > > > > > > > > > + > > > > > > > +#ifdef RTE_ETHDEV_TX_PREP > > > > > > > > > > > > Sorry for being a bit late on that discussion, but what the > > > > > > point of having that config macro (RTE_ETHDEV_TX_PREP ) at all? > > > > > > As I can see right now, if driver doesn't setup tx_pkt_prep, > > > > > > then nb_pkts would be return anyway... > > > > > > > > > > > > BTW, there is my another question - should it be that way? > > > > > > Shouldn't we return 0 (and set rte_errno=ENOTSUP) here if > > > > > > dev->tx_pk_prep == NULL? > > > > > > > > > > > > > > > > It's an answer to the Jerin's request discussed here: > > > > > http://dpdk.org/ml/archives/dev/2016-September/046437.html > > > > > > > > > > When driver doesn't support tx_prep, default behavior is "we don't > > > > > know requirements, so we have nothing to do here". It will > > > > > simplify > > > > application logic and improve performance for these drivers, I think. Catching this error with every burst may be problematic. > > > > > > > > > > As for RTE_ETHDEV_TX_PREP macro, suggested by Jerin in the same > > > > > thread, I still don't think It's the best solution of the problem > > > > described by him. I have added it here for further discussion. > > > > > > > > > > Jerin, have you something to add? > > > > > > > > Nothing very specific to add here. I think, I have tried to share > > > > the rational in, http://dpdk.org/ml/archives/dev/2016- > > > > September/046437.html > > > > > > > > > > Ok, not sure I am fully understand your intention here. > > > I think I understand why you propose rte_eth_tx_prep() to do: > > > if (!dev->tx_pkt_prep) > > > return nb_pkts; > > > > > > That allows drivers to NOOP the tx_prep functionality without paying > > > the price for callback invocation. > > > > In true sense, returning the nb_pkts makes it functional NOP as well(i.e The PMD does not have any limitation on Tx side, so all > > packets are _good_(no preparation is required)) > > > > > > > What I don't understand, why with that in place we also need a NOOP > > > for the whole rte_eth_tx_prep(): > > > +static inline uint16_t > > > +rte_eth_tx_prep(uint8_t port_id __rte_unused, uint16_t queue_id __rte_unused, > > > + struct rte_mbuf **tx_pkts __rte_unused, uint16_t nb_pkts) { > > > + return nb_pkts; > > > +} > > > + > > > +#endif > > > > > > What are you trying to save here: just reading ' dev->tx_pkt_prep'? > > > If so, then it seems not that performance critical for me. > > > Something else? > > > > The proposed scheme can make it as true NOOP from compiler perspective too if a target decided to do that, I have checked the > > instruction generation with arm Assembly, a non true compiler NOOP has following instructions overhead at minimum. > > > > # 1 load > > # 1 mov > > if (!dev->tx_pkt_prep) > > return nb_pkts; > > Yep. > > > > > # compile can't predict this function needs be executed or not so > > # pressure on register allocation and mostly likely it call for > > # some stack push and pop based load on outer function(as it is an > > # inline function) > > > Well, I suppose compiler wouldn't try to fill function argument registers before the branch above. Not the case with arm gcc compiler(may be based outer function load). The recent, external pool manager function pointer conversion reduced around 700kpps/core in local cache mode(even though the function pointers are not executed) > > > > > return (*dev->tx_pkt_prep)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts); > > > > # 1 branch > > if (unlikely(nb_prep < nb_rx)) { > > # bunch of code not executed, but pressure on i cache > > int i; > > for (i = nb_prep; i < nb_rx; i++) > > rte_pktmbuf_free(pkts_burst[i]); > > } > > > > From a server target(IA or high-end armv8) with external PCIe based system makes sense to have RTE_ETHDEV_TX_PREP option > > enabled(which is the case in proposed patch) but the low end arm platforms with > > - limited cores > > - less i cache > > - IPC == 1 > > - running around 1GHz > > - most importantly, _integrated_ nic controller with no external PCIE > > support > > does not make much sense to waste the cycles/time for it. > > cycle saved is cycle earned. > > Ok, so it is all to save one memory de-refrence and a comparison plus branch. > Do you have aby estimation how badly it would hit low-end cpu performance? around 400kpps/core. On four core systems, around 2 mpps.(4 core with 10G*2 ports) > The reason I am asking: obviously I would prefer to avoid to introduce new build config option > (that's the common dpdk coding practice these days) unless it is really important. Practice is something we need to revisit based on the new use case/usage. I think, the scheme of non external pcie based NW cards is new to DPDK. > > > > > Since DPDK compilation is based on _target_, I really don't see any issue with this approach nor it does not hurt anything on server > > target. > > So, IMO, It should be upto the target to decide what works better for the target. > > > > Jerin > > > > > From my point of view NOOP on the driver level is more than enough. > > > Again I would prefer to introduce new config option, if possible. > > > > > > Konstantin > > >