diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-08 20:16:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 06:44:02 -0400 |
commit | f373b53b5fe67aa4a6f28f921a529cc90f88e79b (patch) | |
tree | b2cae9152aed2e30b7a39c114678b9355ab5c14f /net/ipv4/tcp_ipv4.c | |
parent | c3faca053d0a9c877597935b434150b422dbc6fb (diff) |
tcp: replace ehash_size by ehash_mask
Storing the mask (size - 1) instead of the size allows fast path to be
a bit faster.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 7cda24b53f61..99718703d040 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2000,7 +2000,7 @@ static void *established_get_first(struct seq_file *seq) | |||
2000 | struct net *net = seq_file_net(seq); | 2000 | struct net *net = seq_file_net(seq); |
2001 | void *rc = NULL; | 2001 | void *rc = NULL; |
2002 | 2002 | ||
2003 | for (st->bucket = 0; st->bucket < tcp_hashinfo.ehash_size; ++st->bucket) { | 2003 | for (st->bucket = 0; st->bucket <= tcp_hashinfo.ehash_mask; ++st->bucket) { |
2004 | struct sock *sk; | 2004 | struct sock *sk; |
2005 | struct hlist_nulls_node *node; | 2005 | struct hlist_nulls_node *node; |
2006 | struct inet_timewait_sock *tw; | 2006 | struct inet_timewait_sock *tw; |
@@ -2061,10 +2061,10 @@ get_tw: | |||
2061 | st->state = TCP_SEQ_STATE_ESTABLISHED; | 2061 | st->state = TCP_SEQ_STATE_ESTABLISHED; |
2062 | 2062 | ||
2063 | /* Look for next non empty bucket */ | 2063 | /* Look for next non empty bucket */ |
2064 | while (++st->bucket < tcp_hashinfo.ehash_size && | 2064 | while (++st->bucket <= tcp_hashinfo.ehash_mask && |
2065 | empty_bucket(st)) | 2065 | empty_bucket(st)) |
2066 | ; | 2066 | ; |
2067 | if (st->bucket >= tcp_hashinfo.ehash_size) | 2067 | if (st->bucket > tcp_hashinfo.ehash_mask) |
2068 | return NULL; | 2068 | return NULL; |
2069 | 2069 | ||
2070 | spin_lock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket)); | 2070 | spin_lock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket)); |