Re: [PATCH] netfilter: use idr instead of list to speed up packet lookup by id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 7, 2010 at 7:48 PM, Patrick McHardy <kaber@xxxxxxxxx> wrote:
> Changli Gao wrote:
>
> This doesn't compile:
>
> net/netfilter/nfnetlink_queue.c:57: error: field 'idr' has incomplete type
> net/netfilter/nfnetlink_queue.c: In function 'instance_create':
> net/netfilter/nfnetlink_queue.c:112: error: implicit declaration of
> function 'idr_init'
> net/netfilter/nfnetlink_queue.c: In function 'instance_destroy_rcu':
> net/netfilter/nfnetlink_queue.c:143: error: implicit declaration of
> function 'idr_destroy'
> net/netfilter/nfnetlink_queue.c: In function 'find_dequeue_entry':
> net/netfilter/nfnetlink_queue.c:170: error: implicit declaration of
> function 'idr_find'
> net/netfilter/nfnetlink_queue.c:170: warning: assignment makes pointer
> from integer without a cast
> net/netfilter/nfnetlink_queue.c:172: error: implicit declaration of
> function 'idr_remove'
> net/netfilter/nfnetlink_queue.c: In function 'nfqnl_flush':
> net/netfilter/nfnetlink_queue.c:188: error: implicit declaration of
> function 'idr_get_next'
> net/netfilter/nfnetlink_queue.c:188: warning: assignment makes pointer
> from integer without a cast
> net/netfilter/nfnetlink_queue.c: In function 'nfqnl_build_packet_message':
> net/netfilter/nfnetlink_queue.c:253: error: implicit declaration of
> function 'idr_pre_get'
> net/netfilter/nfnetlink_queue.c:254: error: implicit declaration of
> function 'idr_get_new'

I cooked this patch aginst linux-next. And I have noticed net-next
wasn't synced with linux-next yet.

>
> I'm interested in how this affects performance for the vast majority
> of users, which process messages in order. A simple hash table looks
> like a better choice here since we know the maximum number of entries
> in advance and also could have the user specify the desired hash size.
>

If there aren't much packets queued, the packet ids will be around 0,
and idr isn't much slower.

>
> You probably shouldn't be making the entry visible before the message
> is successfully built and sent.

I wanted to keep the changeset small. But it seems wrong.

-- 
Regards,
Changli Gao(xiaosuo@xxxxxxxxx)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux