Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: mac80211: split mesh fast tx cache into local/proxied/forwarded
Date: Sat, 13 Apr 2024 15:30:44 +0200	[thread overview]
Message-ID: <76c40516-3959-4564-a51d-3d387d3eaf4c@nbd.name> (raw)
In-Reply-To: <893ca115e668c6778344bcbd30168fe37bd5c80d.camel@sipsolutions.net>

On 12.04.24 14:55, Johannes Berg wrote:
> On Fri, 2024-04-12 at 14:06 +0200, Felix Fietkau wrote:
>> 
>> +struct ieee80211_mesh_fast_tx_key {
>> +	u8 addr[ETH_ALEN] __aligned(2);
>> +	enum ieee80211_mesh_fast_tx_type type;
>> +};
> 
> Does it make sense to hash a bunch of zeroes there if the compiler
> allocates more than a single byte for "type"? It's uglier, but maybe
> makes more sense to not do that? There's also padding in there in that
> case.

Good point. I will change the type to u16 to make the size explicit and 
make the struct size a multiple of 4 for faster hashing.

>> @@ -646,12 +653,18 @@ void mesh_fast_tx_flush_addr(struct ieee80211_sub_if_data *sdata,
>>  			     const u8 *addr)
>>  {
>>  	struct mesh_tx_cache *cache = &sdata->u.mesh.tx_cache;
>> +	struct ieee80211_mesh_fast_tx_key key = {};
>>  	struct ieee80211_mesh_fast_tx *entry;
>> +	int i;
>>  
>> +	ether_addr_copy(key.addr, addr);
>>  	spin_lock_bh(&cache->walk_lock);
>> -	entry = rhashtable_lookup_fast(&cache->rht, addr, fast_tx_rht_params);
>> -	if (entry)
>> -		mesh_fast_tx_entry_free(cache, entry);
>> +	for (i = MESH_FAST_TX_TYPE_LOCAL; i < MESH_FAST_TX_TYPE_FORWARDED; i++) {
> 
> Seems that should be "i <= ...FORWARDED".
> 
> Maybe better then to add a NUM_MESH_FAST_TX_TYPES or so to the enum and
> then use "i < NUM_MESH_FAST_TX_TYPES", so new additions won't have to
> update this, if they ever happen.

Will do, thanks.

- Felix


      reply	other threads:[~2024-04-13 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 12:06 [PATCH] wifi: mac80211: split mesh fast tx cache into local/proxied/forwarded Felix Fietkau
2024-04-12 12:55 ` Johannes Berg
2024-04-13 13:30   ` Felix Fietkau [this message]

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=76c40516-3959-4564-a51d-3d387d3eaf4c@nbd.name \
    --to=nbd@nbd.name \
    --cc=johannes@sipsolutions.net \
    --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 read-only IMAP folder(s) and NNTP newsgroup(s).