netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@intel.com>
To: netdev@vger.kernel.org
Cc: vinicius.gomes@intel.com
Subject: [PATCH 4/5] net: sched: taprio: Fix taprio_peek()
Date: Fri, 19 Apr 2019 17:00:51 -0700	[thread overview]
Message-ID: <20190420000052.4242-5-andre.guedes@intel.com> (raw)
In-Reply-To: <20190420000052.4242-1-andre.guedes@intel.com>

While traversing taprio's children qdisc list, if the gate is closed for
a given traffic class, we should continue traversing the list since the
remaining qdiscs may have skb ready for transmission.

This patch also takes this opportunity and changes the function to use
the TAPRIO_ALL_GATES_OPEN macro instead of the magic number '-1'.

Fixes: 5a781ccbd19e (“tc: Add support for configuring the taprio scheduler”)
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 net/sched/sch_taprio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index 1671510c187f..110436d11f86 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -89,7 +89,7 @@ static struct sk_buff *taprio_peek(struct Qdisc *sch)
 
 	rcu_read_lock();
 	entry = rcu_dereference(q->current_entry);
-	gate_mask = entry ? entry->gate_mask : -1;
+	gate_mask = entry ? entry->gate_mask : TAPRIO_ALL_GATES_OPEN;
 	rcu_read_unlock();
 
 	if (!gate_mask)
@@ -111,7 +111,7 @@ static struct sk_buff *taprio_peek(struct Qdisc *sch)
 		tc = netdev_get_prio_tc_map(dev, prio);
 
 		if (!(gate_mask & BIT(tc)))
-			return NULL;
+			continue;
 
 		return skb;
 	}
-- 
2.21.0


  parent reply	other threads:[~2019-04-20  1:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20  0:00 [PATCH 0/5] Taprio qdisc fixes Andre Guedes
2019-04-20  0:00 ` [PATCH 1/5] net: sched: taprio: Remove pointless variable assigment Andre Guedes
2019-04-20  0:00 ` [PATCH 2/5] net: sched: taprio: Refactor taprio_get_start_time() Andre Guedes
2019-04-20  0:00 ` [PATCH 3/5] net: sched: taprio: Fix null pointer deref bug Andre Guedes
2019-04-22 18:04   ` Cong Wang
2019-04-22 18:07     ` Cong Wang
2019-04-22 19:21       ` Guedes, Andre
2019-04-22 19:36         ` Cong Wang
2019-04-23 19:21           ` Guedes, Andre
2019-04-23 19:24             ` Cong Wang
2019-04-20  0:00 ` Andre Guedes [this message]
2019-04-20  0:00 ` [PATCH 5/5] net: sched: taprio: Fix taprio_dequeue() Andre Guedes
2019-04-21  3:46 ` [PATCH 0/5] Taprio qdisc fixes David Miller
2019-04-22 19:18   ` Guedes, Andre
2019-04-23  4:21     ` David Miller

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=20190420000052.4242-5-andre.guedes@intel.com \
    --to=andre.guedes@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=vinicius.gomes@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).