linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>,
	linux-wireless@vger.kernel.org
Cc: Thomas Graf <tgraf@suug.ch>, tom@herbertland.com
Subject: Re: Buggy rhashtable walking
Date: Thu, 4 Aug 2016 15:45:46 +0800	[thread overview]
Message-ID: <20160804074546.GA996@gondor.apana.org.au> (raw)
In-Reply-To: <20160804071846.GA773@gondor.apana.org.au>

On Thu, Aug 04, 2016 at 03:18:46PM +0800, Herbert Xu wrote:
> 
> So the question is can wireless handle seeing an entry multiple
> times? In particular, __ieee80211_rx_handle_packet would appear
> to process the same packet multiple times if this were to happen.

It's worse than I thought.  In fact it's not walking the table
at all, rather it's doing a hash lookup by hand!

This cannot possibly work given that rhashtable makes use of
multiple hash tables.

In fact this also demonstrates why putting multiple identical
objects into the same table is crap.  Because there is no sane
way of returning all objects corresponding to a single key, given
that they may be spread over multiple tables.

So I'm going to fix this by consolidating identical objects into
a single rhashtable entry which also lets us get rid of the
insecure_elasticity setting.

So the next time someone comes along and wants to add multiple
objects with the same key to one table, please just say no.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-08-04  7:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04  7:18 Buggy rhashtable walking Herbert Xu
2016-08-04  7:45 ` Herbert Xu [this message]
2016-08-05  6:16   ` Johannes Berg
2016-08-05 10:48     ` Herbert Xu
2016-08-05 10:50       ` Johannes Berg
2016-08-05 11:46         ` Ben Greear
2016-08-08 15:26           ` Herbert Xu
2016-09-18 13:50         ` [PATCH 0/2] rhashtable: rhashtable with duplicate objects Herbert Xu
2016-09-18 13:53           ` [PATCH 1/2] rhashtable: Add rhlist interface Herbert Xu
2016-09-18 13:54           ` [PATCH 2/2] mac80211: Use rhltable instead of rhashtable Herbert Xu
2016-09-19  8:20           ` [PATCH 0/2] rhashtable: rhashtable with duplicate objects Johannes Berg
2016-09-19  8:25             ` Johannes Berg
2016-09-19  8:35               ` Herbert Xu
2016-09-19  8:58                 ` Johannes Berg
2016-09-19  8:40           ` [v2 PATCH " Herbert Xu
2016-09-19  8:42             ` [v2 PATCH 1/2] rhashtable: Add rhlist interface Herbert Xu
2016-09-19  8:42             ` [v2 PATCH 2/2] mac80211: Use rhltable instead of rhashtable Herbert Xu
2016-09-19  9:15             ` [v2 PATCH 0/2] rhashtable: rhashtable with duplicate objects Johannes Berg
2016-09-19  9:17               ` Herbert Xu
2016-09-19  9:27                 ` Johannes Berg
2016-09-19  9:31                   ` Johannes Berg
2016-09-19  9:34                   ` Herbert Xu
2016-09-19  9:38                     ` Johannes Berg
2016-09-19  9:50                     ` Johannes Berg
2016-09-19  9:54                       ` Johannes Berg
2016-09-19 10:02                         ` Johannes Berg
2016-09-19 10:04                           ` Johannes Berg
2016-09-19 10:10                             ` Johannes Berg
2016-09-19 10:48                               ` Herbert Xu
2016-09-19 10:58                                 ` Johannes Berg
2016-09-19 10:58             ` [v3 " Herbert Xu
2016-09-19 11:00               ` [v3 PATCH 1/2] rhashtable: Add rhlist interface Herbert Xu
2016-09-19 21:16                 ` Thomas Graf
2016-09-20  1:52                   ` Herbert Xu
2016-09-19 11:00               ` [v3 PATCH 2/2] mac80211: Use rhltable instead of rhashtable Herbert Xu
2016-09-19 11:03               ` [v3 PATCH 0/2] rhashtable: rhashtable with duplicate objects Johannes Berg
2016-09-19 11:32                 ` Johannes Berg
2016-09-20  8:44                   ` David Miller

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=20160804074546.GA996@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    --cc=tom@herbertland.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).