From: David Miller <davem@davemloft.net>
To: lucien.xin@gmail.com
Cc: netdev@vger.kernel.org, mleitner@redhat.com, vyasevic@redhat.com,
daniel@iogearbox.net
Subject: Re: [PATCH net] sctp: support global vtag assochash and per endpoint s(d)port assochash table
Date: Mon, 31 Aug 2015 15:16:00 -0700 (PDT) [thread overview]
Message-ID: <20150831.151600.1336251424367446992.davem@davemloft.net> (raw)
In-Reply-To: <6d09d44f7972c5a5e458fc0eef98aa057896403d.1441043068.git.lucien.xin@gmail.com>
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.
next prev parent reply other threads:[~2015-08-31 22:16 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 [this message]
2015-09-01 20:03 ` lucien xin
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=20150831.151600.1336251424367446992.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=daniel@iogearbox.net \
--cc=lucien.xin@gmail.com \
--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).