From: John Fastabend <john.fastabend@gmail.com>
To: xiyou.wangcong@gmail.com, jhs@mojatatu.com, eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, paulmck@linux.vnet.ibm.com, brouer@redhat.com
Subject: [net-next PATCH v2 15/15] net: sched: drop ingress qdisc lock
Date: Sun, 24 Aug 2014 17:54:21 -0700 [thread overview]
Message-ID: <20140825005420.2180.4143.stgit@nitbit.x32> (raw)
In-Reply-To: <20140825004659.2180.35028.stgit@nitbit.x32>
After the previous patches to make the filters RCU safe and
support per cpu counters we can drop the qdisc lock around
the ingress qdisc hook.
This is possible because the ingress qdisc is a very basic
qdisc and only updates stats and runs tc_classify. Its the
simplest qdiscs we have.
In order for the per-cpu counters to get invoked the
ingress qdisc must set the LLQDISC flag. We could use per-cpu
counters on all counters but it is only necessary when the
qdisc lock is not held.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/core/dev.c | 2 --
net/sched/sch_ingress.c | 6 ++++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 36d4e6d..5339d11 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3510,10 +3510,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
q = rcu_dereference(rxq->qdisc);
if (q != &noop_qdisc) {
- spin_lock(qdisc_lock(q));
if (likely(!test_bit(__QDISC_STATE_DEACTIVATED, &q->state)))
result = qdisc_enqueue_root(skb, q);
- spin_unlock(qdisc_lock(q));
}
return result;
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 2423d7b..a81b333 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -88,6 +88,11 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
}
/* ------------------------------------------------------------- */
+static int ingress_init(struct Qdisc *sch, struct nlattr *opt)
+{
+ sch->flags |= TCQ_F_LLQDISC;
+ return 0;
+}
static void ingress_destroy(struct Qdisc *sch)
{
@@ -122,6 +127,7 @@ static const struct Qdisc_class_ops ingress_class_ops = {
};
static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
+ .init = ingress_init,
.cl_ops = &ingress_class_ops,
.id = "ingress",
.priv_size = sizeof(struct ingress_qdisc_data),
prev parent reply other threads:[~2014-08-25 0:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 0:47 [net-next PATCH v2 00/15] net/sched: use rcu filters John Fastabend
2014-08-25 0:48 ` [net-next PATCH v2 01/15] net: qdisc: use rcu prefix and silence sparse warnings John Fastabend
2014-08-25 0:48 ` [net-next PATCH v2 02/15] net: rcu-ify tcf_proto John Fastabend
2014-08-25 5:31 ` David Miller
2014-09-02 1:39 ` John Fastabend
2014-09-02 20:52 ` David Miller
2014-09-03 6:23 ` John Fastabend
2014-08-25 0:49 ` [net-next PATCH v2 03/15] net: sched: cls_basic use RCU John Fastabend
2014-08-25 0:49 ` [net-next PATCH v2 04/15] net: sched: cls_cgroup " John Fastabend
2014-08-25 0:49 ` [net-next PATCH v2 05/15] net: sched: cls_flow " John Fastabend
2014-08-25 0:50 ` [net-next PATCH v2 06/15] net: sched: fw " John Fastabend
2014-08-25 0:50 ` [net-next PATCH v2 07/15] net: sched: RCU cls_route John Fastabend
2014-08-25 0:51 ` [net-next PATCH v2 08/15] net: sched: RCU cls_tcindex John Fastabend
2014-08-25 0:51 ` [net-next PATCH v2 09/15] net: sched: make cls_u32 lockless John Fastabend
2014-08-25 0:52 ` [net-next PATCH v2 10/15] net: sched: rcu'ify cls_rsvp John Fastabend
2014-08-25 0:52 ` [net-next PATCH v2 11/15] net: sched: rcu'ify cls_bpf John Fastabend
2014-08-25 0:53 ` [net-next PATCH v2 12/15] net: sched: make tc_action safe to walk under RCU John Fastabend
2014-08-25 0:53 ` [net-next PATCH v2 13/15] net: sched: make bstats per cpu and estimator RCU safe John Fastabend
2014-08-25 0:53 ` [net-next PATCH v2 14/15] net: sched: make qstats per cpu John Fastabend
2014-08-25 0:54 ` John Fastabend [this message]
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=20140825005420.2180.4143.stgit@nitbit.x32 \
--to=john.fastabend@gmail.com \
--cc=brouer@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).