DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: David Marchand <david.marchand@redhat.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	dev@dpdk.org, Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	bernard.iremonger@intel.com,
	Maxime Coquelin <mcoqueli@redhat.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	keith.wiles@intel.com
Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats
Date: Fri, 15 Feb 2019 17:19:13 +0100	[thread overview]
Message-ID: <1551030.Hp446SNAY3@xps> (raw)
In-Reply-To: <CAJFAV8zYYQEV5xcuyvqh0by_DXtRwPhdb1+Z=bgzsdgip1YC-Q@mail.gmail.com>

15/02/2019 16:04, David Marchand:
> On Fri, Feb 15, 2019 at 3:05 PM Bruce Richardson <bruce.richardson@intel.com>
> 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.

  reply	other threads:[~2019-02-15 16:19 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 15:42 [dpdk-dev] [PATCH 0/5] display testpmd forwarding engine stats on the fly David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 1/5] app/testpmd: remove unused fwd_ctx field David Marchand
2019-02-18 19:55   ` Rami Rosen
2019-02-14 15:42 ` [dpdk-dev] [PATCH 2/5] app/testpmd: add missing newline when showing statistics David Marchand
2019-02-19  5:48   ` Rami Rosen
2019-02-14 15:42 ` [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats David Marchand
2019-02-14 16:30   ` Bruce Richardson
2019-02-14 17:39     ` David Marchand
2019-02-14 18:51       ` David Marchand
2019-02-15  8:57         ` Thomas Monjalon
2019-02-15  9:33           ` David Marchand
2019-02-15 14:05             ` Bruce Richardson
2019-02-15 14:13               ` Wiles, Keith
2019-02-15 15:04               ` David Marchand
2019-02-15 16:19                 ` Thomas Monjalon [this message]
2019-02-15 17:32                   ` David Marchand
2019-02-15 18:15                     ` Ananyev, Konstantin
2019-02-15 18:31                       ` David Marchand
2019-02-15 18:42                         ` Ananyev, Konstantin
2019-02-15 19:38                           ` Thomas Monjalon
2019-02-16  0:37                             ` Stephen Hemminger
2019-02-16 13:23                               ` Ananyev, Konstantin
2019-02-16 12:50                             ` Ananyev, Konstantin
2019-02-20  8:33                               ` David Marchand
2019-02-24 11:55                                 ` Ananyev, Konstantin
2019-02-14 15:42 ` [dpdk-dev] [PATCH 4/5] app/testpmd: remove useless casts on statistics David Marchand
2019-02-14 15:42 ` [dpdk-dev] [PATCH 5/5] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-11 15:35 ` [dpdk-dev] [PATCH v2 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-11 15:35   ` [dpdk-dev] [PATCH v2 1/4] app/testpmd: remove unused fwd_ctx field David Marchand
2019-03-19 18:29     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-03-19 18:29       ` Ferruh Yigit
2019-03-11 15:35   ` [dpdk-dev] [PATCH v2 2/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-11 15:53     ` Andrew Rybchenko
2019-03-11 15:35   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-11 15:57     ` Andrew Rybchenko
2019-03-11 16:03       ` David Marchand
2019-03-11 15:35   ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02   ` [dpdk-dev] [PATCH v3 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-20 10:02     ` David Marchand
2019-03-20 10:02     ` [dpdk-dev] [PATCH v3 1/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-20 10:02       ` David Marchand
2019-03-20 13:49       ` Andrew Rybchenko
2019-03-20 13:49         ` Andrew Rybchenko
2019-03-20 10:02     ` [dpdk-dev] [PATCH v3 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-20 10:02       ` David Marchand
2019-03-20 13:55       ` Andrew Rybchenko
2019-03-20 13:55         ` Andrew Rybchenko
2019-03-20 10:02     ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-20 10:02       ` David Marchand
2019-03-20 13:58       ` Andrew Rybchenko
2019-03-20 13:58         ` Andrew Rybchenko
2019-03-20 10:02     ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-20 10:02       ` David Marchand
2019-03-20 12:25       ` Ferruh Yigit
2019-03-20 12:25         ` Ferruh Yigit
2019-03-20 12:44         ` David Marchand
2019-03-20 12:44           ` David Marchand
2019-03-20 13:29           ` Ferruh Yigit
2019-03-20 13:29             ` Ferruh Yigit
2019-03-21 18:50       ` Ferruh Yigit
2019-03-21 18:50         ` Ferruh Yigit
2019-03-21 20:34         ` David Marchand
2019-03-21 20:34           ` David Marchand
2019-03-22 13:37     ` [dpdk-dev] [PATCH v4 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-22 13:37       ` David Marchand
2019-03-22 13:37       ` [dpdk-dev] [PATCH v4 1/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-22 13:37         ` David Marchand
2019-03-22 17:03         ` Maxime Coquelin
2019-03-22 17:03           ` Maxime Coquelin
2019-03-22 17:17         ` Maxime Coquelin
2019-03-22 17:17           ` Maxime Coquelin
2019-03-22 17:23           ` David Marchand
2019-03-22 17:23             ` David Marchand
2019-03-22 17:31             ` Andrew Rybchenko
2019-03-22 17:31               ` Andrew Rybchenko
2019-03-22 17:35         ` Andrew Rybchenko
2019-03-22 17:35           ` Andrew Rybchenko
2019-03-22 17:43           ` David Marchand
2019-03-22 17:43             ` David Marchand
2019-03-23 19:12             ` David Marchand
2019-03-23 19:12               ` David Marchand
2019-03-25  6:34               ` Andrew Rybchenko
2019-03-25  6:34                 ` Andrew Rybchenko
2019-03-22 13:37       ` [dpdk-dev] [PATCH v4 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-22 13:37         ` David Marchand
2019-03-22 17:06         ` Maxime Coquelin
2019-03-22 17:06           ` Maxime Coquelin
2019-03-22 13:37       ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-22 13:37         ` David Marchand
2019-03-22 17:11         ` Maxime Coquelin
2019-03-22 17:11           ` Maxime Coquelin
2019-03-22 13:37       ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-22 13:37         ` David Marchand
2019-03-22 17:22         ` Maxime Coquelin
2019-03-22 17:22           ` Maxime Coquelin
2019-03-25  8:51       ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly David Marchand
2019-03-25  8:51         ` David Marchand
2019-03-25  8:51         ` [dpdk-dev] [PATCH v5 1/4] app/testpmd: add missing newline when showing statistics David Marchand
2019-03-25  8:51           ` David Marchand
2019-03-25  8:55           ` Andrew Rybchenko
2019-03-25  8:55             ` Andrew Rybchenko
2019-03-25  8:51         ` [dpdk-dev] [PATCH v5 2/4] app/testpmd: extend fwd statistics to 64bits David Marchand
2019-03-25  8:51           ` David Marchand
2019-03-25  8:51         ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: remove useless casts on statistics David Marchand
2019-03-25  8:51           ` David Marchand
2019-03-25  8:51         ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: display/clear forwarding stats on demand David Marchand
2019-03-25  8:51           ` David Marchand
2019-03-25 14:05         ` [dpdk-dev] [PATCH v5 0/4] display testpmd forwarding engine stats on the fly Ferruh Yigit
2019-03-25 14:05           ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1551030.Hp446SNAY3@xps \
    --to=thomas@monjalon.net \
    --cc=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=keith.wiles@intel.com \
    --cc=mcoqueli@redhat.com \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).