All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: use inet_ehash_bucket(...) for consistency
@ 2019-01-12 14:07 Marcus Huewe
  2019-01-14 16:47 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Huewe @ 2019-01-12 14:07 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuznet, yoshfuji, suse-tux

Make the access to the struct inet_hashinfo's ehash member consistent.
In net/ipv4/inet_hashtables.c, the ehash member is accessed by calling
inet_ehash_bucket(...) except for the access in __inet_lookup_established.
In order to make the access consistent, use inet_ehash_bucket(...)
in __inet_lookup_established.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
---
 net/ipv4/inet_hashtables.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index 942265d65eb3..2b54eb6e5951 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -361,8 +361,7 @@ struct sock *__inet_lookup_established(struct net *net,
 	 * have wildcards anyways.
 	 */
 	unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
-	unsigned int slot = hash & hashinfo->ehash_mask;
-	struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
+	struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
 
 begin:
 	sk_nulls_for_each_rcu(sk, node, &head->chain) {
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: use inet_ehash_bucket(...) for consistency
  2019-01-12 14:07 [PATCH net] net: use inet_ehash_bucket(...) for consistency Marcus Huewe
@ 2019-01-14 16:47 ` Eric Dumazet
  2019-01-14 18:31   ` Marcus Hüwe
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2019-01-14 16:47 UTC (permalink / raw)
  To: Marcus Huewe, netdev; +Cc: davem, kuznet, yoshfuji



On 01/12/2019 06:07 AM, Marcus Huewe wrote:
> Make the access to the struct inet_hashinfo's ehash member consistent.
> In net/ipv4/inet_hashtables.c, the ehash member is accessed by calling
> inet_ehash_bucket(...) except for the access in __inet_lookup_established.
> In order to make the access consistent, use inet_ehash_bucket(...)
> in __inet_lookup_established.
> 
> Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
> ---
>  net/ipv4/inet_hashtables.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
> index 942265d65eb3..2b54eb6e5951 100644
> --- a/net/ipv4/inet_hashtables.c
> +++ b/net/ipv4/inet_hashtables.c
> @@ -361,8 +361,7 @@ struct sock *__inet_lookup_established(struct net *net,
>  	 * have wildcards anyways.
>  	 */
>  	unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
> -	unsigned int slot = hash & hashinfo->ehash_mask;
> -	struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
> +	struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
>  
>  begin:
>  	sk_nulls_for_each_rcu(sk, node, &head->chain) {
> 

Have you actually compiled the kernel once this patch is applied ?

Please test your changes before sending a patch.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: use inet_ehash_bucket(...) for consistency
  2019-01-14 16:47 ` Eric Dumazet
@ 2019-01-14 18:31   ` Marcus Hüwe
  0 siblings, 0 replies; 3+ messages in thread
From: Marcus Hüwe @ 2019-01-14 18:31 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, davem, kuznet, yoshfuji

On 2019-01-14 08:47:47 -0800, Eric Dumazet wrote:
> On 01/12/2019 06:07 AM, Marcus Huewe wrote:
> > Make the access to the struct inet_hashinfo's ehash member consistent.
> > In net/ipv4/inet_hashtables.c, the ehash member is accessed by calling
> > inet_ehash_bucket(...) except for the access in __inet_lookup_established.
> > In order to make the access consistent, use inet_ehash_bucket(...)
> > in __inet_lookup_established.
> > 
> > Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
> > ---
> >  net/ipv4/inet_hashtables.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
> > index 942265d65eb3..2b54eb6e5951 100644
> > --- a/net/ipv4/inet_hashtables.c
> > +++ b/net/ipv4/inet_hashtables.c
> > @@ -361,8 +361,7 @@ struct sock *__inet_lookup_established(struct net *net,
> >  	 * have wildcards anyways.
> >  	 */
> >  	unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport);
> > -	unsigned int slot = hash & hashinfo->ehash_mask;
> > -	struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
> > +	struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
> >  
> >  begin:
> >  	sk_nulls_for_each_rcu(sk, node, &head->chain) {
> > 
> 
> Have you actually compiled the kernel once this patch is applied ?
> 
*blush*
Please ignore - sorry for the noise.


Marcus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-14 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-12 14:07 [PATCH net] net: use inet_ehash_bucket(...) for consistency Marcus Huewe
2019-01-14 16:47 ` Eric Dumazet
2019-01-14 18:31   ` Marcus Hüwe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.