From: Stephen Hemminger <shemminger@vyatta•com>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org
Subject: [PATCH 2/9] net classifier: deinline bind/unbind functions
Date: Fri, 06 Aug 2010 12:35:50 -0700 [thread overview]
Message-ID: <20100806193558.667488554@vyatta.com> (raw)
In-Reply-To: 20100806193548.007978639@vyatta.com
[-- Attachment #1: cls-deinline.patch --]
[-- Type: text/plain, Size: 3262 bytes --]
The filter bind/unbind functions are not worth inlining.
Not performance critical in the least.
Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>
---
include/net/pkt_cls.h | 52 ++------------------------------------------------
net/sched/cls_api.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 49 deletions(-)
--- a/include/net/pkt_cls.h 2010-08-06 12:21:18.000000000 -0700
+++ b/include/net/pkt_cls.h 2010-08-06 12:21:59.736709482 -0700
@@ -16,55 +16,9 @@ struct tcf_walker {
extern int register_tcf_proto_ops(struct tcf_proto_ops *ops);
extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
-
-static inline unsigned long
-__cls_set_class(unsigned long *clp, unsigned long cl)
-{
- unsigned long old_cl;
-
- old_cl = *clp;
- *clp = cl;
- return old_cl;
-}
-
-static inline unsigned long
-cls_set_class(struct tcf_proto *tp, unsigned long *clp,
- unsigned long cl)
-{
- unsigned long old_cl;
-
- tcf_tree_lock(tp);
- old_cl = __cls_set_class(clp, cl);
- tcf_tree_unlock(tp);
-
- return old_cl;
-}
-
-static inline int
-tcf_bind_filter(struct tcf_proto *tp, struct tcf_result *r, unsigned long base)
-{
- const struct Qdisc_class_ops *cops = tp->q->ops->cl_ops;
- unsigned long cl;
-
- if (!cops->bind_tcf)
- return -EINVAL;
-
- cl = cops->bind_tcf(tp->q, base, r->classid);
- cl = cls_set_class(tp, &r->class, cl);
- if (cl)
- cops->unbind_tcf(tp->q, cl);
-
- return 0;
-}
-
-static inline void
-tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
-{
- unsigned long cl;
-
- if ((cl = __cls_set_class(&r->class, 0)) != 0)
- tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
-}
+extern int tcf_bind_filter(struct tcf_proto *tp, struct tcf_result *r,
+ unsigned long base);
+extern void tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r);
struct tcf_exts {
#ifdef CONFIG_NET_CLS_ACT
--- a/net/sched/cls_api.c 2010-08-06 12:20:02.000000000 -0700
+++ b/net/sched/cls_api.c 2010-08-06 12:21:21.623261373 -0700
@@ -99,6 +99,56 @@ out:
}
EXPORT_SYMBOL(unregister_tcf_proto_ops);
+static unsigned long __cls_set_class(unsigned long *clp, unsigned long cl)
+{
+ unsigned long old_cl;
+
+ old_cl = *clp;
+ *clp = cl;
+ return old_cl;
+}
+
+static unsigned long cls_set_class(struct tcf_proto *tp, unsigned long *clp,
+ unsigned long cl)
+{
+ unsigned long old_cl;
+
+ tcf_tree_lock(tp);
+ old_cl = __cls_set_class(clp, cl);
+ tcf_tree_unlock(tp);
+
+ return old_cl;
+}
+
+int tcf_bind_filter(struct tcf_proto *tp, struct tcf_result *r,
+ unsigned long base)
+{
+ const struct Qdisc_class_ops *cops = tp->q->ops->cl_ops;
+ unsigned long cl;
+
+ if (!cops->bind_tcf)
+ return -ENOENT;
+
+ cl = cops->bind_tcf(tp->q, base, r->classid);
+ cl = cls_set_class(tp, &r->class, cl);
+ if (cl)
+ cops->unbind_tcf(tp->q, cl);
+
+ return 0;
+}
+EXPORT_SYMBOL(tcf_bind_filter);
+
+void tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
+{
+ unsigned long cl;
+
+ cl = __cls_set_class(&r->class, 0);
+ if (cl)
+ tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
+}
+EXPORT_SYMBOL(tcf_unbind_filter);
+
+
static int tfilter_notify(struct net *net, struct sk_buff *oskb,
struct nlmsghdr *n, struct tcf_proto *tp,
unsigned long fh, int event);
next prev parent reply other threads:[~2010-08-06 19:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100806193548.007978639@vyatta.com>
2010-08-06 19:35 ` [PATCH 1/9] net classifier: dont allow filters on semi-classful qdisc Stephen Hemminger
2010-08-06 21:24 ` Jarek Poplawski
2010-08-06 21:58 ` Stephen Hemminger
2010-08-06 22:23 ` [PATCH] sfq: add dummy bind/unbind handles Stephen Hemminger
2010-08-06 23:17 ` Jarek Poplawski
2010-08-08 5:45 ` David Miller
2010-08-08 7:04 ` Jarek Poplawski
2010-08-09 15:01 ` Franchoze Eric
2010-08-06 22:26 ` [PATCH 1/9] net classifier: dont allow filters on semi-classful qdisc Jarek Poplawski
2010-08-08 5:59 ` David Miller
2010-08-06 19:35 ` Stephen Hemminger [this message]
2010-08-06 19:35 ` [PATCH 3/9] u32 classifier: fix sparse warnings Stephen Hemminger
2010-08-06 19:35 ` [PATCH 4/9] netem: add locking around changes Stephen Hemminger
2010-08-06 19:35 ` [PATCH 5/9] netem: cleanup dump code Stephen Hemminger
2010-08-06 19:35 ` [PATCH 6/9] netem: distribution table changes Stephen Hemminger
2010-08-06 19:35 ` [PATCH 7/9] netem: dump distribution table Stephen Hemminger
2010-08-06 19:35 ` [PATCH 8/9] netem - revised correlated loss generator Stephen Hemminger
2010-08-06 19:35 ` [PATCH 9/9] netem: restore no jitter option Stephen Hemminger
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=20100806193558.667488554@vyatta.com \
--to=shemminger@vyatta$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/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