From: Changli Gao <xiaosuo@gmail.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] nfnetlink_queue: Use hash to speed up finding entries in nfqueue
Date: Fri, 20 Nov 2009 21:46:01 +0800 [thread overview]
Message-ID: <412e6f7f0911200546n5d44082dt69fec1514b51c12b@mail.gmail.com> (raw)
In-Reply-To: <4B0695DB.3010401@trash.net>
On Fri, Nov 20, 2009 at 9:12 PM, Patrick McHardy <kaber@trash.net> wrote:
> Changli Gao wrote:
>> Use hash to speed up finding entries in nfqueue.
>>
>> If user implements QoS in userland, packet verdict won't be received in order. At this moment, a hash table is faster than a double linked list when finding the corresponding entries in nfqueue.
>>
>> This patch also fixes a potential bug, which will allows more than one entries with the same id are in the same nfqueue in the extreme.
>
> Instead of a double ID in a purely hypothetical case, we'd now
> get an endless loop. This part doesn't make much sense to me,
> please remove it from the patch.
>
It isn't a endless loop, as we limite the queue size.
>> diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
>> index 7a9dec9..38c7af1 100644
>> --- a/net/netfilter/nfnetlink_queue.c
>> +++ b/net/netfilter/nfnetlink_queue.c
>> @@ -37,6 +37,9 @@
>> #endif
>>
>> #define NFQNL_QMAX_DEFAULT 1024
>> +#define NFQNL_QHT_BITS 8
>> +#define NFQNL_QHT_SIZE (1 << NFQNL_QHT_BITS)
>> +#define NFQNL_QHT_MASK (NFQNL_QHT_SIZE - 1)
>
> Have you considered making the size configurable by passing a new
> attribute in the NFQNL_CFG_CMD_BIND cmd message?
>
OK. It's better users can config the size.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-11-20 13:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 4:56 [PATCH] nfnetlink_queue: Use hash to speed up finding entries in nfqueue Changli Gao
2009-11-20 13:12 ` Patrick McHardy
2009-11-20 13:46 ` Changli Gao [this message]
2009-11-20 13:56 ` Patrick McHardy
2009-11-20 14:00 ` Changli Gao
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=412e6f7f0911200546n5d44082dt69fec1514b51c12b@mail.gmail.com \
--to=xiaosuo@gmail.com \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).