Netdev List
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Cc: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	andre.guedes@intel.com, ivan.briano@intel.com,
	boon.leong.ong@intel.com, richardcochran@gmail.com,
	henrik@austad.us, levipearson@gmail.com, rodney.cummings@ni.com
Subject: [next-queue PATCH v9 3/6] net/sched: Add select_queue() class_ops for mqprio
Date: Mon, 16 Oct 2017 18:01:25 -0700	[thread overview]
Message-ID: <20171017010128.22141-4-vinicius.gomes@intel.com> (raw)
In-Reply-To: <20171017010128.22141-1-vinicius.gomes@intel.com>

From: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>

When replacing a child qdisc from mqprio, tc_modify_qdisc() must fetch
the netdev_queue pointer that the current child qdisc is associated
with before creating the new qdisc.

Currently, when using mqprio as root qdisc, the kernel will end up
getting the queue #0 pointer from the mqprio (root qdisc), which leaves
any new child qdisc with a possibly wrong netdev_queue pointer.

Implementing the Qdisc_class_ops select_queue() on mqprio fixes this
issue and avoid an inconsistent state when child qdiscs are replaced.

Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
---
 net/sched/sch_mqprio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index 6bcdfe6e7b63..8c042ae323e3 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -396,6 +396,12 @@ static void mqprio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
 	}
 }
 
+static struct netdev_queue *mqprio_select_queue(struct Qdisc *sch,
+						struct tcmsg *tcm)
+{
+	return mqprio_queue_get(sch, TC_H_MIN(tcm->tcm_parent));
+}
+
 static const struct Qdisc_class_ops mqprio_class_ops = {
 	.graft		= mqprio_graft,
 	.leaf		= mqprio_leaf,
@@ -403,6 +409,7 @@ static const struct Qdisc_class_ops mqprio_class_ops = {
 	.walk		= mqprio_walk,
 	.dump		= mqprio_dump_class,
 	.dump_stats	= mqprio_dump_class_stats,
+	.select_queue	= mqprio_select_queue,
 };
 
 static struct Qdisc_ops mqprio_qdisc_ops __read_mostly = {
-- 
2.14.2

  parent reply	other threads:[~2017-10-17  1:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  1:01 [next-queue PATCH v9 0/6] TSN: Add qdisc based config interface for CBS Vinicius Costa Gomes
2017-10-17  1:01 ` [next-queue PATCH v9 1/6] net/sched: Check for null dev_queue on create flow Vinicius Costa Gomes
2017-10-17  1:01 ` [next-queue PATCH v9 2/6] net/sched: Change behavior of mq select_queue() Vinicius Costa Gomes
2017-10-17  1:01 ` Vinicius Costa Gomes [this message]
2017-10-17  1:01 ` [next-queue PATCH v9 4/6] net/sched: Introduce Credit Based Shaper (CBS) qdisc Vinicius Costa Gomes
2017-10-17  1:01 ` [next-queue PATCH v9 5/6] net/sched: Add support for HW offloading for CBS Vinicius Costa Gomes
2017-10-17  1:01 ` [next-queue PATCH v9 6/6] igb: Add support for CBS offload Vinicius Costa Gomes
2017-10-20  1:47   ` [Intel-wired-lan] " Brown, Aaron F
2017-10-17 11:35 ` [next-queue PATCH v9 0/6] TSN: Add qdisc based config interface for CBS Henrik Austad

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=20171017010128.22141-4-vinicius.gomes@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=andre.guedes@intel.com \
    --cc=boon.leong.ong@intel.com \
    --cc=henrik@austad.us \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=ivan.briano@intel.com \
    --cc=jesus.sanchez-palencia@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=levipearson@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=rodney.cummings@ni.com \
    --cc=xiyou.wangcong@gmail.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