Subject: Re: [RFC] tcf_bind_filter failure handling

From: Thomas Graf <[email-masked]>
Date: Mon, 13 Dec 2004 20:32:28 +0100

* jamal <[email-masked]> 2004-12-13 14:23
> 
> When/why would binding fail? tcindex is an exception.
> I dont see binding as having any contribution to the error path.
> Additional locking is not advisable. The binding could happen while
> traffic is running.

The binding fails if the class does not exist at the time the classifier
is loaded. The original implementation regarded binding optional to do
the classid -> class lookup only once while loading instead of everytime
classify() returns. tcindex does not do so because it uses the class
field to determine whether a perfect hash bucket is used or not. I
changed it to check classid || police || action because one of them is
definitely defined and enforced as a requirement during validation.

The locking i mentioned was not a spinlock but rather a refcnt++ in the
class intended to be bound later during change, i.e. to ensure a qdisc
destroy rcu callback can't destroy the class while we're about to bind
to it. But since we agree on changing tcindex this is not an issue and
nothing will change.

Sorry for the confusion, my word choice was rather bad for such a
simple issue and produced more confusion than results.