linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Benjamin Beichler <benjamin.beichler@uni-rostock.de>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 2/5] mac80211_hwsim: add hashtable with mac address keys for faster lookup
Date: Mon, 15 Jan 2018 12:46:58 +0100	[thread overview]
Message-ID: <1516016818.410.10.camel@sipsolutions.net> (raw)
In-Reply-To: <1d7bda28-6a77-4c4e-a3fc-3857b3c05aa1@MAIL2.uni-rostock.de>

On Wed, 2018-01-10 at 17:42 +0100, Benjamin Beichler wrote:
> This patch adds a rhastable for mac address lookup of hwsim radios. This
> especially improve the speed on reception of a netlink message with a new
> frame. Although redundant, we keep holding a normal list for all radios,
> since the rhashtable_walk interface adds a lot of overhead for iterating
> over all radios and the doc of rhashtable recommend a redundant structure
> for stable walks in such situations.
> 
> Since rhashtable is rcu protected we do not need a lock for delivering
> frames and thus improving this scenario.

Applied, but

> +static u32 hwsim_table_hash(const void *addr, u32 len, u32 seed)
> +{
> +	/* Use last four bytes of hw addr as hash index */
> +	return jhash_1word(*(u32 *)(addr + 2), seed);
> +}

I removed this, because that isn't actually safe - there's only 2-byte
alignment guaranteed... rhashtable will just do jhash() on the whole
thing, which should be fast enough.

johannes

  reply	other threads:[~2018-01-15 11:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180110164255.2763-1-benjamin.beichler@uni-rostock.de>
2018-01-10 16:42 ` [PATCH v3 1/5] mac80211_hwsim: add workqueue to wait for deferred radio deletion on mod unload Benjamin Beichler
2018-01-15 11:46   ` Johannes Berg
2018-01-10 16:42 ` [PATCH v3 2/5] mac80211_hwsim: add hashtable with mac address keys for faster lookup Benjamin Beichler
2018-01-15 11:46   ` Johannes Berg [this message]
2018-01-10 16:42 ` [PATCH v3 3/5] mac80211_hwsim: add generation count for netlink dump operation Benjamin Beichler
2018-01-15 12:08   ` Johannes Berg
2018-01-15 14:28     ` Benjamin Beichler
2018-01-22 13:24       ` Johannes Berg
2018-01-22 14:58         ` Benjamin Beichler
2018-01-10 16:42 ` [PATCH v3 4/5] mac80211_hwsim: add permanent mac address option for new radios Benjamin Beichler
2018-01-15 12:09   ` Johannes Berg
2018-01-15 14:39     ` Benjamin Beichler
2018-01-22 13:22       ` Johannes Berg
2018-01-15 12:14   ` Johannes Berg
2018-01-15 14:48     ` Benjamin Beichler
2018-01-22 13:23       ` Johannes Berg
2018-01-22 14:49         ` Benjamin Beichler
2018-01-22 14:51           ` Johannes Berg
2018-01-10 16:42 ` [PATCH v3 5/5] mac80211_hwsim: add hwsim_tx_rate_flags to netlink attributes Benjamin Beichler
2018-01-15 12:19   ` Johannes Berg

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=1516016818.410.10.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=benjamin.beichler@uni-rostock.de \
    --cc=linux-wireless@vger.kernel.org \
    /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).