DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alan Dewar <alangordondewar@gmail.com>
To: cristian.dumitrescu@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] rte_sched: don't count RED-drops as tail-drops
Date: Thu, 24 Aug 2017 13:00:11 +0100	[thread overview]
Message-ID: <1503576011-11389-1-git-send-email-alan.dewar@att.com> (raw)

Everytime the rte_sched_port_update_subport_stats_on_drop or
rte_sched_port_update_queue_stats_on_drop functions are called the
n_pkts_dropped counter is incremented.

The n_pkts_red_dropped counter is only incremented when the function
argument red is non-zero.

Packets that are RED-dropped are not Tail-dropped, so the n_pkts_dropped
counter should not be incremented when the n_pkts_red_dropped counter is.

Signed-off-by: Alan Dewar <alan.dewar@att.com>
---
 lib/librte_sched/rte_sched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index b7cba11..c10c266 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -1108,7 +1108,7 @@ rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port,
 	uint32_t tc_index = (qindex >> 2) & 0x3;
 	uint32_t pkt_len = pkt->pkt_len;
 
-	s->stats.n_pkts_tc_dropped[tc_index] += 1;
+	s->stats.n_pkts_tc_dropped[tc_index] += !red;
 	s->stats.n_bytes_tc_dropped[tc_index] += pkt_len;
 #ifdef RTE_SCHED_RED
 	s->stats.n_pkts_red_dropped[tc_index] += red;
@@ -1140,7 +1140,7 @@ rte_sched_port_update_queue_stats_on_drop(struct rte_sched_port *port,
 	struct rte_sched_queue_extra *qe = port->queue_extra + qindex;
 	uint32_t pkt_len = pkt->pkt_len;
 
-	qe->stats.n_pkts_dropped += 1;
+	qe->stats.n_pkts_dropped += !red;
 	qe->stats.n_bytes_dropped += pkt_len;
 #ifdef RTE_SCHED_RED
 	qe->stats.n_pkts_red_dropped += red;
-- 
2.1.4

             reply	other threads:[~2017-08-24 12:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 12:00 Alan Dewar [this message]
2017-09-25 11:05 ` Dumitrescu, Cristian

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=1503576011-11389-1-git-send-email-alan.dewar@att.com \
    --to=alangordondewar@gmail.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /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).