Thread (19 messages) 19 messages, 5 authors, 2015-03-30

Re: [patch net-next] tc: introduce OpenFlow classifier

From: Hannes Frederic Sowa <hidden>
Date: 2015-03-26 20:39:12

On Thu, Mar 26, 2015, at 16:29, Jiri Pirko wrote:
Thu, Mar 26, 2015 at 03:23:56PM CET, hannes@stressinduktion.org wrote:
quoted
quoted
+static int of_classify(struct sk_buff *skb, const struct tcf_proto *tp,
+		       struct tcf_result *res)
+{
+	struct cls_of_head *head = rcu_dereference_bh(tp->root);
+	struct cls_of_filter *f;
+	struct of_flow_key skb_key;
+	int ret;
+
+	of_extract_key(skb, &skb_key);
+
+	list_for_each_entry_rcu(f, &head->filters, list) {
+		if (!of_match(&skb_key, f))
+			continue;
This seems very limited to me, do you have plans to extend this?
What do you have in mind?
We have the possibility to make the order of the matches matter easily
here (like a decision tree).
Maybe this would give a benefit over simple full match with mask, so
user space can align the most
significant matches first thus creating less churn in the caches and
make the lookup time shorter?
I understand, if you want build a simples openvswitch replacement a hash
table would be good to go,
too.

Just a proposal, maybe we can add more benefit to this kind of
classifier.

Albeit it looks a bit like cls_bpf could do that more easily.

What do you think?

Bye,
Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help