netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] sch_hfsc: always keep backlog updated
@ 2016-06-01 23:15 Cong Wang
  2016-06-01 23:15 ` [Patch net] sch_prio: update backlog as well Cong Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Cong Wang @ 2016-06-01 23:15 UTC (permalink / raw)
  To: netdev; +Cc: stasn77, Cong Wang, Jamal Hadi Salim

hfsc updates backlog lazily, that is only when we
dump the stats. This is problematic after we begin to
update backlog in qdisc_tree_reduce_backlog().

Reported-by: Stas Nichiporovich <stasn77@gmail.com>
Tested-by: Stas Nichiporovich <stasn77@gmail.com>
Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/sch_hfsc.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index d783d7c..1ac9f9f 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1529,6 +1529,7 @@ hfsc_reset_qdisc(struct Qdisc *sch)
 	q->eligible = RB_ROOT;
 	INIT_LIST_HEAD(&q->droplist);
 	qdisc_watchdog_cancel(&q->watchdog);
+	sch->qstats.backlog = 0;
 	sch->q.qlen = 0;
 }
 
@@ -1559,14 +1560,6 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
 	struct hfsc_sched *q = qdisc_priv(sch);
 	unsigned char *b = skb_tail_pointer(skb);
 	struct tc_hfsc_qopt qopt;
-	struct hfsc_class *cl;
-	unsigned int i;
-
-	sch->qstats.backlog = 0;
-	for (i = 0; i < q->clhash.hashsize; i++) {
-		hlist_for_each_entry(cl, &q->clhash.hash[i], cl_common.hnode)
-			sch->qstats.backlog += cl->qdisc->qstats.backlog;
-	}
 
 	qopt.defcls = q->defcls;
 	if (nla_put(skb, TCA_OPTIONS, sizeof(qopt), &qopt))
@@ -1604,6 +1597,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 	if (cl->qdisc->q.qlen == 1)
 		set_active(cl, qdisc_pkt_len(skb));
 
+	qdisc_qstats_backlog_inc(sch, skb);
 	sch->q.qlen++;
 
 	return NET_XMIT_SUCCESS;
@@ -1672,6 +1666,7 @@ hfsc_dequeue(struct Qdisc *sch)
 
 	qdisc_unthrottled(sch);
 	qdisc_bstats_update(sch, skb);
+	qdisc_qstats_backlog_dec(sch, skb);
 	sch->q.qlen--;
 
 	return skb;
@@ -1695,6 +1690,7 @@ hfsc_drop(struct Qdisc *sch)
 			}
 			cl->qstats.drops++;
 			qdisc_qstats_drop(sch);
+			sch->qstats.backlog -= len;
 			sch->q.qlen--;
 			return len;
 		}
-- 
2.1.0

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

* [Patch net] sch_prio: update backlog as well
  2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
@ 2016-06-01 23:15 ` Cong Wang
  2016-06-03 23:26   ` David Miller
  2016-06-01 23:15 ` [Patch net] sch_drr: " Cong Wang
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Cong Wang @ 2016-06-01 23:15 UTC (permalink / raw)
  To: netdev; +Cc: stasn77, Cong Wang, Jamal Hadi Salim

We need to update backlog too when we update qlen.

Joint work with Stas.

Reported-by: Stas Nichiporovich <stasn77@gmail.com>
Tested-by: Stas Nichiporovich <stasn77@gmail.com>
Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/sch_prio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index fee1b15..4b0a821 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -85,6 +85,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
 	ret = qdisc_enqueue(skb, qdisc);
 	if (ret == NET_XMIT_SUCCESS) {
+		qdisc_qstats_backlog_inc(sch, skb);
 		sch->q.qlen++;
 		return NET_XMIT_SUCCESS;
 	}
@@ -117,6 +118,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch)
 		struct sk_buff *skb = qdisc_dequeue_peeked(qdisc);
 		if (skb) {
 			qdisc_bstats_update(sch, skb);
+			qdisc_qstats_backlog_dec(sch, skb);
 			sch->q.qlen--;
 			return skb;
 		}
@@ -135,6 +137,7 @@ static unsigned int prio_drop(struct Qdisc *sch)
 	for (prio = q->bands-1; prio >= 0; prio--) {
 		qdisc = q->queues[prio];
 		if (qdisc->ops->drop && (len = qdisc->ops->drop(qdisc)) != 0) {
+			sch->qstats.backlog -= len;
 			sch->q.qlen--;
 			return len;
 		}
@@ -151,6 +154,7 @@ prio_reset(struct Qdisc *sch)
 
 	for (prio = 0; prio < q->bands; prio++)
 		qdisc_reset(q->queues[prio]);
+	sch->qstats.backlog = 0;
 	sch->q.qlen = 0;
 }
 
-- 
2.1.0

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

* [Patch net] sch_drr: update backlog as well
  2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
  2016-06-01 23:15 ` [Patch net] sch_prio: update backlog as well Cong Wang
@ 2016-06-01 23:15 ` Cong Wang
  2016-06-03 23:25   ` David Miller
  2016-06-01 23:15 ` [Patch net] sch_red: " Cong Wang
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Cong Wang @ 2016-06-01 23:15 UTC (permalink / raw)
  To: netdev; +Cc: stasn77, Cong Wang, Jamal Hadi Salim

Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/sch_drr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index a63e879..bf8af2c 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -375,6 +375,7 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		cl->deficit = cl->quantum;
 	}
 
+	qdisc_qstats_backlog_inc(sch, skb);
 	sch->q.qlen++;
 	return err;
 }
@@ -407,6 +408,7 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch)
 
 			bstats_update(&cl->bstats, skb);
 			qdisc_bstats_update(sch, skb);
+			qdisc_qstats_backlog_dec(sch, skb);
 			sch->q.qlen--;
 			return skb;
 		}
@@ -428,6 +430,7 @@ static unsigned int drr_drop(struct Qdisc *sch)
 		if (cl->qdisc->ops->drop) {
 			len = cl->qdisc->ops->drop(cl->qdisc);
 			if (len > 0) {
+				sch->qstats.backlog -= len;
 				sch->q.qlen--;
 				if (cl->qdisc->q.qlen == 0)
 					list_del(&cl->alist);
@@ -463,6 +466,7 @@ static void drr_reset_qdisc(struct Qdisc *sch)
 			qdisc_reset(cl->qdisc);
 		}
 	}
+	sch->qstats.backlog = 0;
 	sch->q.qlen = 0;
 }
 
-- 
2.1.0

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

* [Patch net] sch_red: update backlog as well
  2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
  2016-06-01 23:15 ` [Patch net] sch_prio: update backlog as well Cong Wang
  2016-06-01 23:15 ` [Patch net] sch_drr: " Cong Wang
@ 2016-06-01 23:15 ` Cong Wang
  2016-06-03 23:25   ` David Miller
  2016-06-01 23:15 ` [Patch net] sch_tbf: " Cong Wang
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Cong Wang @ 2016-06-01 23:15 UTC (permalink / raw)
  To: netdev; +Cc: stasn77, Cong Wang, Jamal Hadi Salim

Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/sch_red.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 8c0508c..91578bd 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -97,6 +97,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
 	ret = qdisc_enqueue(skb, child);
 	if (likely(ret == NET_XMIT_SUCCESS)) {
+		qdisc_qstats_backlog_inc(sch, skb);
 		sch->q.qlen++;
 	} else if (net_xmit_drop_count(ret)) {
 		q->stats.pdrop++;
@@ -118,6 +119,7 @@ static struct sk_buff *red_dequeue(struct Qdisc *sch)
 	skb = child->dequeue(child);
 	if (skb) {
 		qdisc_bstats_update(sch, skb);
+		qdisc_qstats_backlog_dec(sch, skb);
 		sch->q.qlen--;
 	} else {
 		if (!red_is_idling(&q->vars))
@@ -143,6 +145,7 @@ static unsigned int red_drop(struct Qdisc *sch)
 	if (child->ops->drop && (len = child->ops->drop(child)) > 0) {
 		q->stats.other++;
 		qdisc_qstats_drop(sch);
+		sch->qstats.backlog -= len;
 		sch->q.qlen--;
 		return len;
 	}
@@ -158,6 +161,7 @@ static void red_reset(struct Qdisc *sch)
 	struct red_sched_data *q = qdisc_priv(sch);
 
 	qdisc_reset(q->qdisc);
+	sch->qstats.backlog = 0;
 	sch->q.qlen = 0;
 	red_restart(&q->vars);
 }
-- 
2.1.0

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

* [Patch net] sch_tbf: update backlog as well
  2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
                   ` (2 preceding siblings ...)
  2016-06-01 23:15 ` [Patch net] sch_red: " Cong Wang
@ 2016-06-01 23:15 ` Cong Wang
  2016-06-03 23:26   ` David Miller
  2016-06-01 23:15 ` [Patch net] act_police: fix a crash during removal Cong Wang
  2016-06-03 23:26 ` [Patch net] sch_hfsc: always keep backlog updated David Miller
  5 siblings, 1 reply; 13+ messages in thread
From: Cong Wang @ 2016-06-01 23:15 UTC (permalink / raw)
  To: netdev; +Cc: stasn77, Cong Wang, Jamal Hadi Salim

Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/sch_tbf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 83b90b5..3161e49 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -207,6 +207,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		return ret;
 	}
 
+	qdisc_qstats_backlog_inc(sch, skb);
 	sch->q.qlen++;
 	return NET_XMIT_SUCCESS;
 }
@@ -217,6 +218,7 @@ static unsigned int tbf_drop(struct Qdisc *sch)
 	unsigned int len = 0;
 
 	if (q->qdisc->ops->drop && (len = q->qdisc->ops->drop(q->qdisc)) != 0) {
+		sch->qstats.backlog -= len;
 		sch->q.qlen--;
 		qdisc_qstats_drop(sch);
 	}
@@ -263,6 +265,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc *sch)
 			q->t_c = now;
 			q->tokens = toks;
 			q->ptokens = ptoks;
+			qdisc_qstats_backlog_dec(sch, skb);
 			sch->q.qlen--;
 			qdisc_unthrottled(sch);
 			qdisc_bstats_update(sch, skb);
@@ -294,6 +297,7 @@ static void tbf_reset(struct Qdisc *sch)
 	struct tbf_sched_data *q = qdisc_priv(sch);
 
 	qdisc_reset(q->qdisc);
+	sch->qstats.backlog = 0;
 	sch->q.qlen = 0;
 	q->t_c = ktime_get_ns();
 	q->tokens = q->buffer;
-- 
2.1.0

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

* [Patch net] act_police: fix a crash during removal
  2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
                   ` (3 preceding siblings ...)
  2016-06-01 23:15 ` [Patch net] sch_tbf: " Cong Wang
@ 2016-06-01 23:15 ` Cong Wang
  2016-06-03 23:28   ` David Miller
  2016-06-03 23:26 ` [Patch net] sch_hfsc: always keep backlog updated David Miller
  5 siblings, 1 reply; 13+ messages in thread
From: Cong Wang @ 2016-06-01 23:15 UTC (permalink / raw)
  To: netdev; +Cc: stasn77, Cong Wang, Jamal Hadi Salim

The police action is using its own code to initialize tcf hash
info, which makes us to forgot to initialize a->hinfo correctly.
Fix this by calling the helper function tcf_hash_create() directly.

This patch fixed the following crash:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
 IP: [<ffffffff810c099f>] __lock_acquire+0xd3/0xf91
 PGD d3c34067 PUD d3e18067 PMD 0
 Oops: 0000 [#1] SMP
 CPU: 2 PID: 853 Comm: tc Not tainted 4.6.0+ #87
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 task: ffff8800d3e28040 ti: ffff8800d3f6c000 task.ti: ffff8800d3f6c000
 RIP: 0010:[<ffffffff810c099f>]  [<ffffffff810c099f>] __lock_acquire+0xd3/0xf91
 RSP: 0000:ffff88011b203c80  EFLAGS: 00010002
 RAX: 0000000000000046 RBX: 0000000000000000 RCX: 0000000000000000
 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000028
 RBP: ffff88011b203d40 R08: 0000000000000001 R09: 0000000000000000
 R10: ffff88011b203d58 R11: ffff88011b208000 R12: 0000000000000001
 R13: ffff8800d3e28040 R14: 0000000000000028 R15: 0000000000000000
 FS:  0000000000000000(0000) GS:ffff88011b200000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000028 CR3: 00000000d4be1000 CR4: 00000000000006e0
 Stack:
  ffff8800d3e289c0 0000000000000046 000000001b203d60 ffffffff00000000
  0000000000000000 ffff880000000000 0000000000000000 ffffffff00000000
  ffffffff8187142c ffff88011b203ce8 ffff88011b203ce8 ffffffff8101dbfc
 Call Trace:
  <IRQ>
  [<ffffffff8187142c>] ? __tcf_hash_release+0x77/0xd1
  [<ffffffff8101dbfc>] ? native_sched_clock+0x1a/0x35
  [<ffffffff8101dbfc>] ? native_sched_clock+0x1a/0x35
  [<ffffffff810a9604>] ? sched_clock_local+0x11/0x78
  [<ffffffff810bf6a1>] ? mark_lock+0x24/0x201
  [<ffffffff810c1dbd>] lock_acquire+0x120/0x1b4
  [<ffffffff810c1dbd>] ? lock_acquire+0x120/0x1b4
  [<ffffffff8187142c>] ? __tcf_hash_release+0x77/0xd1
  [<ffffffff81aad89f>] _raw_spin_lock_bh+0x3c/0x72
  [<ffffffff8187142c>] ? __tcf_hash_release+0x77/0xd1
  [<ffffffff8187142c>] __tcf_hash_release+0x77/0xd1
  [<ffffffff81871a27>] tcf_action_destroy+0x49/0x7c
  [<ffffffff81870b1c>] tcf_exts_destroy+0x20/0x2d
  [<ffffffff8189273b>] u32_destroy_key+0x1b/0x4d
  [<ffffffff81892788>] u32_delete_key_freepf_rcu+0x1b/0x1d
  [<ffffffff810de3b8>] rcu_process_callbacks+0x610/0x82e
  [<ffffffff8189276d>] ? u32_destroy_key+0x4d/0x4d
  [<ffffffff81ab0bc1>] __do_softirq+0x191/0x3f4

Fixes: ddf97ccdd7cb ("net_sched: add network namespace support for tc actions")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/sched/act_police.c | 31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index b884dae..e2a38c2 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -38,7 +38,7 @@ struct tcf_police {
 	bool			peak_present;
 };
 #define to_police(pc)	\
-	container_of(pc, struct tcf_police, common)
+	container_of(pc->priv, struct tcf_police, common)
 
 #define POL_TAB_MASK     15
 
@@ -119,14 +119,12 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
 				 struct nlattr *est, struct tc_action *a,
 				 int ovr, int bind)
 {
-	unsigned int h;
 	int ret = 0, err;
 	struct nlattr *tb[TCA_POLICE_MAX + 1];
 	struct tc_police *parm;
 	struct tcf_police *police;
 	struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL;
 	struct tc_action_net *tn = net_generic(net, police_net_id);
-	struct tcf_hashinfo *hinfo = tn->hinfo;
 	int size;
 
 	if (nla == NULL)
@@ -145,7 +143,7 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
 
 	if (parm->index) {
 		if (tcf_hash_search(tn, a, parm->index)) {
-			police = to_police(a->priv);
+			police = to_police(a);
 			if (bind) {
 				police->tcf_bindcnt += 1;
 				police->tcf_refcnt += 1;
@@ -156,16 +154,14 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
 			/* not replacing */
 			return -EEXIST;
 		}
+	} else {
+		ret = tcf_hash_create(tn, parm->index, NULL, a,
+				      sizeof(*police), bind, false);
+		if (ret)
+			return ret;
+		ret = ACT_P_CREATED;
 	}
 
-	police = kzalloc(sizeof(*police), GFP_KERNEL);
-	if (police == NULL)
-		return -ENOMEM;
-	ret = ACT_P_CREATED;
-	police->tcf_refcnt = 1;
-	spin_lock_init(&police->tcf_lock);
-	if (bind)
-		police->tcf_bindcnt = 1;
 override:
 	if (parm->rate.rate) {
 		err = -ENOMEM;
@@ -181,6 +177,7 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
 		}
 	}
 
+	police = to_police(a);
 	spin_lock_bh(&police->tcf_lock);
 	if (est) {
 		err = gen_replace_estimator(&police->tcf_bstats, NULL,
@@ -237,16 +234,8 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
 		return ret;
 
 	police->tcfp_t_c = ktime_get_ns();
-	police->tcf_index = parm->index ? parm->index :
-		tcf_hash_new_index(tn);
-	police->tcf_tm.install = jiffies;
-	police->tcf_tm.lastuse = jiffies;
-	h = tcf_hash(police->tcf_index, POL_TAB_MASK);
-	spin_lock_bh(&hinfo->lock);
-	hlist_add_head(&police->tcf_head, &hinfo->htab[h]);
-	spin_unlock_bh(&hinfo->lock);
+	tcf_hash_insert(tn, a);
 
-	a->priv = police;
 	return ret;
 
 failure_unlock:
-- 
2.1.0

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

* Re: [Patch net] sch_red: update backlog as well
  2016-06-01 23:15 ` [Patch net] sch_red: " Cong Wang
@ 2016-06-03 23:25   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2016-06-03 23:25 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, stasn77, jhs

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed,  1 Jun 2016 16:15:18 -0700

> Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net] sch_drr: update backlog as well
  2016-06-01 23:15 ` [Patch net] sch_drr: " Cong Wang
@ 2016-06-03 23:25   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2016-06-03 23:25 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, stasn77, jhs

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed,  1 Jun 2016 16:15:17 -0700

> Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net] sch_tbf: update backlog as well
  2016-06-01 23:15 ` [Patch net] sch_tbf: " Cong Wang
@ 2016-06-03 23:26   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2016-06-03 23:26 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, stasn77, jhs

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed,  1 Jun 2016 16:15:19 -0700

> Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net] sch_hfsc: always keep backlog updated
  2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
                   ` (4 preceding siblings ...)
  2016-06-01 23:15 ` [Patch net] act_police: fix a crash during removal Cong Wang
@ 2016-06-03 23:26 ` David Miller
  5 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2016-06-03 23:26 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, stasn77, jhs

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed,  1 Jun 2016 16:15:15 -0700

> hfsc updates backlog lazily, that is only when we
> dump the stats. This is problematic after we begin to
> update backlog in qdisc_tree_reduce_backlog().
> 
> Reported-by: Stas Nichiporovich <stasn77@gmail.com>
> Tested-by: Stas Nichiporovich <stasn77@gmail.com>
> Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net] sch_prio: update backlog as well
  2016-06-01 23:15 ` [Patch net] sch_prio: update backlog as well Cong Wang
@ 2016-06-03 23:26   ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2016-06-03 23:26 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, stasn77, jhs

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed,  1 Jun 2016 16:15:16 -0700

> We need to update backlog too when we update qlen.
> 
> Joint work with Stas.
> 
> Reported-by: Stas Nichiporovich <stasn77@gmail.com>
> Tested-by: Stas Nichiporovich <stasn77@gmail.com>
> Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net] act_police: fix a crash during removal
  2016-06-01 23:15 ` [Patch net] act_police: fix a crash during removal Cong Wang
@ 2016-06-03 23:28   ` David Miller
  2016-06-06  5:41     ` Cong Wang
  0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2016-06-03 23:28 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, stasn77, jhs

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed,  1 Jun 2016 16:15:20 -0700

> The police action is using its own code to initialize tcf hash
> info, which makes us to forgot to initialize a->hinfo correctly.
> Fix this by calling the helper function tcf_hash_create() directly.
> 
> This patch fixed the following crash:
 ...
> Fixes: ddf97ccdd7cb ("net_sched: add network namespace support for tc actions")
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

This adds a new warning, please resubmit with this fixed.

net/sched/act_police.c: In function ‘tcf_act_police_locate’:
net/sched/act_police.c:247:3: warning: ‘police’ may be used uninitialized in this function [-Wmaybe-uninitialized]

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

* Re: [Patch net] act_police: fix a crash during removal
  2016-06-03 23:28   ` David Miller
@ 2016-06-06  5:41     ` Cong Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Cong Wang @ 2016-06-06  5:41 UTC (permalink / raw)
  To: David Miller
  Cc: Linux Kernel Network Developers,
	Стас Ничипорович,
	Jamal Hadi Salim

On Fri, Jun 3, 2016 at 4:28 PM, David Miller <davem@davemloft.net> wrote:
> From: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Wed,  1 Jun 2016 16:15:20 -0700
>
>> The police action is using its own code to initialize tcf hash
>> info, which makes us to forgot to initialize a->hinfo correctly.
>> Fix this by calling the helper function tcf_hash_create() directly.
>>
>> This patch fixed the following crash:
>  ...
>> Fixes: ddf97ccdd7cb ("net_sched: add network namespace support for tc actions")
>> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
> This adds a new warning, please resubmit with this fixed.
>
> net/sched/act_police.c: In function ‘tcf_act_police_locate’:
> net/sched/act_police.c:247:3: warning: ‘police’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Oh, sure, my compiler didn't catch this.

I will send v2 tomorrow.

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

end of thread, other threads:[~2016-06-06  5:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01 23:15 [Patch net] sch_hfsc: always keep backlog updated Cong Wang
2016-06-01 23:15 ` [Patch net] sch_prio: update backlog as well Cong Wang
2016-06-03 23:26   ` David Miller
2016-06-01 23:15 ` [Patch net] sch_drr: " Cong Wang
2016-06-03 23:25   ` David Miller
2016-06-01 23:15 ` [Patch net] sch_red: " Cong Wang
2016-06-03 23:25   ` David Miller
2016-06-01 23:15 ` [Patch net] sch_tbf: " Cong Wang
2016-06-03 23:26   ` David Miller
2016-06-01 23:15 ` [Patch net] act_police: fix a crash during removal Cong Wang
2016-06-03 23:28   ` David Miller
2016-06-06  5:41     ` Cong Wang
2016-06-03 23:26 ` [Patch net] sch_hfsc: always keep backlog updated David Miller

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).