From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id BB3151B47E for ; Fri, 15 Feb 2019 17:19:18 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4193B21B55; Fri, 15 Feb 2019 11:19:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 15 Feb 2019 11:19:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=wzkU1NhNrBXO4Qu9Hp5Khq7Yjk/zvTfSbyVhKqOFUYE=; b=lFg7CLGqxcQJ bacyy3z/v8MiFV0HEMusw/lNRrvNW57U1VGk5ZhHJH81l8dFrP4GKYi/oIP+NVCR 9Gem5g/kiR5WX6EVWV3WoC/pd4bOtz9S/eAF3BEy7Zziv6pAJXY8TjOQuR69vnKR Q4vwIjHEQ5Q9fGQ1SnFm3uSHiNny1D8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=wzkU1NhNrBXO4Qu9Hp5Khq7Yjk/zvTfSbyVhKqOFU YE=; b=hcLdEHuB1jOshHNSygsjRGQF8AXP3qq+IIUI9k6E+IhmlR1mBcsdjXoZs EAE9fF7mOxN8RhchZ/AcoeTpMHRat32tPTunwZZFQmp4kccusKCmXgh4ay4KviRV bbYHyjrEYDB67v8Tf0N/unZgRjxvk9nAxT7nGo/5AasnCbUodCDrRN3PWgJepkaC mcPNGcj5ncAAo4OzbstSzTazY+yNQSKXmvkBb2d/hGVZypPq9iPU6fEGIVBTLs09 UZ/7Xj4ccWPL+spJ708SyPO6BlgGyComo2ho3F54HtANWRah1eut04XnL2pHTecv Bc6U9OJEanQcRHlKI8qg5vrTswoQw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtjedgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjg hfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcu oehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkphepjeejrddufeegrddvtd efrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 08E3810314; Fri, 15 Feb 2019 11:19:14 -0500 (EST) From: Thomas Monjalon To: David Marchand Cc: Bruce Richardson , dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , bernard.iremonger@intel.com, Maxime Coquelin , "Yigit, Ferruh" , Andrew Rybchenko , keith.wiles@intel.com Date: Fri, 15 Feb 2019 17:19:13 +0100 Message-ID: <1551030.Hp446SNAY3@xps> In-Reply-To: References: <1550158972-21895-1-git-send-email-david.marchand@redhat.com> <20190215140526.GB790616@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats 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, 15 Feb 2019 16:19:19 -0000 15/02/2019 16:04, David Marchand: > On Fri, Feb 15, 2019 at 3:05 PM Bruce Richardson > wrote: > > > On Fri, Feb 15, 2019 at 10:33:47AM +0100, David Marchand wrote: > > > On Fri, Feb 15, 2019 at 9:58 AM Thomas Monjalon > > > <[1]thomas@monjalon.net> wrote: > > > > > > 14/02/2019 19:51, David Marchand: > > > > What is the purpose of oerrors ? > > > > > > > > Since the drivers (via rte_eth_tx_burst return value) report the > > > numbers of > > > > packets successfully transmitted, the application can try to > > > retransmit the > > > > packets that did not make it and counts this. > > > > If the driver counts such "missed" packets, then it does the job > > > the > > > > application will do anyway (wasting some cycles). > > > > But what is more a problem is that the application does not know > > > if the > > > > packets in oerrors are its own retries or problems that the driver > > > can not > > > > detect (hw problems) but the hw can. > > > > > > > > So the best option is that oerrors does not report the packets the > > > driver > > > > refuses (and I can see some drivers that do not comply to this) > > > but only > > > > "external" errors from the driver pov. > > > I can see the benefit of having driver errors in the stats, > > > so it is generically stored for later analysis or print. > > > It could be managed at ethdev level instead of the application > > > doing the computation. > > > What about splitting the Tx errors in 2 fields? oerrors / ofull ? > > > Who said it's awful? sorry Bruce for anticipating ;) > > > > > > Summary, correct me if we are not aligned :-) > > > - ofull (maybe ofifoerrors?) is actually a count of SW failed > > transmits > > > - it would be handled in rte_eth_tx_burst() itself in a generic way > > > - the drivers do not need to track such SW failed transmits > > > - oerrors only counts packets HW failed transmits, dropped out of the > > > driver tx_pkt_burst() knowledge > > > - the application does not have to track SW failed transmits since the > > > stats is in ethdev > > > It sounds good to me, this means an ethdev abi breakage. > > > > Hang on, why do we need ethdev to track this at all, given that it's > > trivial for apps to track this themselves. Would we not be better just to > > add this tracking into testpmd and leave ethdev and drivers alone? Perhaps > > I'm missing something? > > > > This was my first intention but Thomas hopped in ;-) I was just opening the discussion :) > testpmd does it already via the fs->fwd_dropped stats and ovs has its > tx_dropped stat. > > The problem is that all drivers have different approach about this. > Some drivers only count real hw errors in oerrors. > But others count the packets it can't send in oerrors (+ there are some > cases that seem buggy to me where the driver will always refuse the mbufs > for reason X and the application can retry indefinitely to send...). We have 3 options: 1/ status quo = oerrors is inconsistent across drivers 2/ API break = oerrors stop being incremented for temporary unavailability (i.e. queue full, kind of ERETRY), report only packets which will be never sent, may be a small performance gain for some drivers 3/ API + ABI break = same as 2/ + report ERETRY errors in ofull (same as tx_burst() delta) Note that the option 2 is a light API break which does not require any deprecation notice because the original definition of oerrors is really vague: "failed transmitted packets" By changing the definition of errors to "packets lost", we can count HW errors + packets not matching requirements. As David suggests, the packets not matching requirements can be freed as it is done for packets successfully transmitted to the HW. We need also to update the definition of the return value of rte_eth_tx_burst(): "packets actually stored in transmit descriptors". We should also count the bad packets rejected by the driver. Then the number of bad packets would be the difference between the return value of rte_eth_tx_burst() and opackets counter. This solution is fixing some bugs and enforce a consistent behaviour. The option 3 is breaking the ABI and may degrade the performances. The only benefit is convenience or semantic: ofull would be the equivalent of imissed. The application can count the same by making the difference between the burst size and the return of rte_eth_tx_burst. My vote is for the option 2.