DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <shemming@brocade.com>
Subject: [dpdk-dev] [PATCH 3/3] rte_sched: fix grinder bug
Date: Wed, 14 May 2014 09:25:27 -0700	[thread overview]
Message-ID: <20140514162629.738257220@networkplumber.org> (raw)
In-Reply-To: <20140514162524.113765980@networkplumber.org>

[-- Attachment #1: sched-unstuck-grinder.patch --]
[-- Type: text/plain, Size: 1563 bytes --]

The rte_scheduler will get stuck and not deliver any more packets
if there are two active subports and then one of them stops enqueing
more packets. This is because of abug in how the grinder state machines
are managed.

If a non-zero grinder is assigned (but not yet active), then the dequeue
would miss it and always return zero packets. The cure is to always
do a first pass over all grinders.

Signed-off-by: Stephen Hemminger <shemming@brocade.com>


---
 lib/librte_sched/rte_sched.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/lib/librte_sched/rte_sched.c	2014-05-14 09:14:01.137253986 -0700
+++ b/lib/librte_sched/rte_sched.c	2014-05-14 09:14:01.137253986 -0700
@@ -2113,12 +2113,12 @@ rte_sched_port_time_resync(struct rte_sc
 }
 
 static inline int
-rte_sched_port_exceptions(struct rte_sched_port *port)
+rte_sched_port_exceptions(struct rte_sched_port *port, int second_pass)
 {
 	int exceptions;
 
 	/* Check if any exception flag is set */
-	exceptions = (port->busy_grinders == 0) ||
+	exceptions = (second_pass && port->busy_grinders == 0) ||
 		(port->pipe_exhaustion == 1);
 	
 	/* Clear exception flags */
@@ -2140,7 +2140,8 @@ rte_sched_port_dequeue(struct rte_sched_
 	/* Take each queue in the grinder one step further */
 	for (i = 0, count = 0; ; i ++)  {
 		count += grinder_handle(port, i & (RTE_SCHED_PORT_N_GRINDERS - 1));
-		if ((count == n_pkts) || rte_sched_port_exceptions(port)) {
+		if ((count == n_pkts) ||
+		    rte_sched_port_exceptions(port, i >= RTE_SCHED_PORT_N_GRINDERS)) {
 			break;
 		}
 	}

  parent reply	other threads:[~2014-05-14 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 16:25 [dpdk-dev] [PATCH 0/3] RTE scheduler fixes Stephen Hemminger
2014-05-14 16:25 ` [dpdk-dev] [PATCH 1/3] qos: use rte_zmalloc instead of memzone for allocation Stephen Hemminger
2014-05-14 16:25 ` [dpdk-dev] [PATCH 2/3] rte_sched: fix compile if DEBUG enabled Stephen Hemminger
2014-05-14 16:25 ` Stephen Hemminger [this message]
2014-05-22 14:17 ` [dpdk-dev] [PATCH 0/3] RTE scheduler fixes Thomas Monjalon

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=20140514162629.738257220@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=shemming@brocade.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).