Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net] net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues
@ 2019-12-03  3:17 Dust Li
  2019-12-03 19:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dust Li @ 2019-12-03  3:17 UTC (permalink / raw)
  To: Cong Wang, Jamal Hadi Salim, Jiri Pirko, John Fastabend; +Cc: Tony Lu, netdev

 sch->q.len hasn't been set if the subqueue is a NOLOCK qdisc
 in mq_dump() and mqprio_dump().

Fixes: ce679e8df7ed ("net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mqprio")
Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
---
 net/sched/sch_mq.c     | 1 +
 net/sched/sch_mqprio.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c
index 278c0b2dc523..e79f1afe0cfd 100644
--- a/net/sched/sch_mq.c
+++ b/net/sched/sch_mq.c
@@ -153,6 +153,7 @@ static int mq_dump(struct Qdisc *sch, struct sk_buff *skb)
 			__gnet_stats_copy_queue(&sch->qstats,
 						qdisc->cpu_qstats,
 						&qdisc->qstats, qlen);
+			sch->q.qlen		+= qlen;
 		} else {
 			sch->q.qlen		+= qdisc->q.qlen;
 			sch->bstats.bytes	+= qdisc->bstats.bytes;
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index 0d0113a24962..de4e00a58bc6 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -411,6 +411,7 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)
 			__gnet_stats_copy_queue(&sch->qstats,
 						qdisc->cpu_qstats,
 						&qdisc->qstats, qlen);
+			sch->q.qlen		+= qlen;
 		} else {
 			sch->q.qlen		+= qdisc->q.qlen;
 			sch->bstats.bytes	+= qdisc->bstats.bytes;
-- 
2.19.1.3.ge56e4f7


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues
  2019-12-03  3:17 [PATCH net] net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues Dust Li
@ 2019-12-03 19:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-12-03 19:54 UTC (permalink / raw)
  To: dust.li; +Cc: xiyou.wangcong, jhs, jiri, john.fastabend, tonylu, netdev

From: Dust Li <dust.li@linux.alibaba.com>
Date: Tue,  3 Dec 2019 11:17:40 +0800

>  sch->q.len hasn't been set if the subqueue is a NOLOCK qdisc
>  in mq_dump() and mqprio_dump().
> 
> Fixes: ce679e8df7ed ("net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mqprio")
> Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
> Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03  3:17 [PATCH net] net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues Dust Li
2019-12-03 19:54 ` David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git