public inbox for netdev@vger.kernel.org 
 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 v3 1/4] mqprio: Implement select_queue class_ops
Date: Tue,  3 Oct 2017 16:44:29 -0700	[thread overview]
Message-ID: <20171003234435.8979-2-vinicius.gomes@intel.com> (raw)
In-Reply-To: <20171003234435.8979-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..9d762ca4a76c 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

  reply	other threads:[~2017-10-03 23:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 23:44 [next-queue PATCH v3 0/4] TSN: Add qdisc based config interface for CBS Vinicius Costa Gomes
2017-10-03 23:44 ` Vinicius Costa Gomes [this message]
2017-10-03 23:44 ` [next-queue PATCH v3 2/4] net/sched: Fix accessing invalid dev_queue Vinicius Costa Gomes
2017-10-04  3:47   ` Eric Dumazet
2017-10-04 17:42     ` Jesus Sanchez-Palencia
2017-10-03 23:44 ` [next-queue PATCH v3 3/4] net/sched: Introduce Credit Based Shaper (CBS) qdisc Vinicius Costa Gomes
2017-10-03 23:44 ` [next-queue PATCH v2 3/5] net/sched: Introduce the user API for the CBS shaper Vinicius Costa Gomes
2017-10-03 23:55   ` Vinicius Costa Gomes
2017-10-03 23:44 ` [next-queue PATCH v3 4/4] igb: Add support for CBS offload Vinicius Costa Gomes
2017-10-03 23:44 ` [next-queue PATCH v2 4/5] net/sched: Introduce Credit Based Shaper (CBS) qdisc Vinicius Costa Gomes
2017-10-03 23:44 ` [next-queue PATCH v2 5/5] igb: Add support for CBS offload Vinicius Costa Gomes

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

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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