From: lucien xin <lucien.xin@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: network dev <netdev@vger.kernel.org>,
Marcelo Ricardo Leitner <mleitner@redhat.com>,
Vlad Yasevich <vyasevic@redhat.com>,
daniel@iogearbox.net
Subject: Re: [PATCH net] sctp: support global vtag assochash and per endpoint s(d)port assochash table
Date: Wed, 2 Sep 2015 04:03:22 +0800 [thread overview]
Message-ID: <CADvbK_foLzSwH14u0rQo26y2Vi4aGW0rQDBHNJMD-S3fR1bJCg@mail.gmail.com> (raw)
In-Reply-To: <20150831.151600.1336251424367446992.davem@davemloft.net>
On Tue, Sep 1, 2015 at 6:16 AM, David Miller <davem@davemloft.net> wrote:
> From: Xin Long <lucien.xin@gmail.com>
> Date: Tue, 1 Sep 2015 01:44:28 +0800
>
>> @@ -524,18 +524,16 @@ static inline int sctp_assoc_hashfn(struct net *net, __u16 lport, __u16 rport)
>> {
>> int h = (lport << 16) + rport + net_hash_mix(net);
>> h ^= h>>8;
>> - return h & (sctp_assoc_hashsize - 1);
>> + return h & (256 - 1);
>
> It is not acceptable to use a magic constant for the hash table size.
> You need to define this using a macro and use it consistently.
>
> Furthermore, you should be looking into dynamically sized
> hash tables because not everyone will need this many entries.
okay, I will correct it, thanks
next prev parent reply other threads:[~2015-09-01 20:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 17:44 [PATCH net] sctp: support global vtag assochash and per endpoint s(d)port assochash table Xin Long
2015-08-31 17:48 ` lucien xin
2015-08-31 18:11 ` lucien xin
2015-08-31 22:16 ` David Miller
2015-09-01 20:03 ` lucien xin [this message]
2015-08-31 23:51 ` Vlad Yasevich
2015-09-01 20:11 ` lucien xin
2015-09-01 14:53 ` David Laight
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=CADvbK_foLzSwH14u0rQo26y2Vi4aGW0rQDBHNJMD-S3fR1bJCg@mail.gmail.com \
--to=lucien.xin@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=mleitner@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevic@redhat.com \
/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).