netdev
[Top] [All Lists]

Re: On Extending NFMark...

To: Rusty Russell <rusty@xxxxxxxxxxxxxxxx>
Subject: Re: On Extending NFMark...
From: "James R. Leu" <jleu@xxxxxxxxxxxxxx>
Date: Thu, 1 Mar 2001 07:55:43 -0600
Cc: Richard Guy Briggs <rgb@xxxxxxxxxxxxxxxxxxxxx>, netfilter-devel@xxxxxxxxxxxxx, linux-ipsec@xxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <E14YKx2-0007bp-00@halfway>; from rusty@linuxcare.com.au on Thu, Mar 01, 2001 at 03:44:28PM +1100
Organization: none
References: <20010220110113.C3910@grendel.conscoop.ottawa.on.ca> <E14YKx2-0007bp-00@halfway>
Reply-to: jleu@xxxxxxxxxxxxxx
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2i
Hello,

I haven't been following this thread long from the beginning, but I have a
patch that might be related.

I wrote and MPLS implementation which needs to mark skbs and store an piece
of info with the skb until it reaches the mpls_output() function.

I created an array of void* on each skb.  Each protocol that wants to use
an entry in this array claims a index in that array (via a header file).
There is also an array of function pointers, these are called when we want to
clean up the array.

The major downfall of this technique is the overhead of always having the
array even though it may not be used.  I like the idea of having a linked
list, except for the case when we cannot allocate memory to add to the
list, and because we would have to search the list to find a particular
protocols info. (these reasons are why I choose an array)

<snip>

> The classic nfmark field problem; that there is only one.  See also,
> nfct.
> 
> For a generic linked-list of blobs approach, there are several
> problems:
> 1) How do I tell which one is mine?
> 2) What happens when packet is copied?
> 3) What happens when packet is cloned?
> 4) What happens when packet is destroyed?
> 
For the array technique:
1. by the protocol index
2. Copy it.
3. Copy it.
4. Call the protocols functions pointer to clean up

Jim

-- 
James R. Leu

<Prev in Thread] Current Thread [Next in Thread>
  • Re: On Extending NFMark..., James R. Leu <=