netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "<linux-wireless@vger.kernel.org>"
	<linux-wireless@vger.kernel.org>,
	"<netdev@vger.kernel.org>" <netdev@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>, Jouni Malinen <j@w1.fi>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [RFC PATCH 2/2] mac80211: aes_ccm: cache AEAD request structures per CPU
Date: Tue, 18 Oct 2016 16:24:07 +0200	[thread overview]
Message-ID: <1476800647.6425.38.camel@sipsolutions.net> (raw)
In-Reply-To: <CAKv+Gu8aE4AfewHeMDf2RQfJtSsrp6Fb1A_ygFsqEwpyP6hDjQ@mail.gmail.com> (sfid-20161018_161829_091999_FC9D3B10)

On Tue, 2016-10-18 at 15:18 +0100, Ard Biesheuvel wrote:
> 
> > Hmm. Is it really worth having a per-CPU variable for each possible
> > key? You could have a large number of those (typically three when
> > you're a client on an AP, and 1 + 1 for each client when you're the
> > AP).

2 + 1 for each client, actually, since you have 2 GTKs present in the
"steady state"; not a big difference though.

> > Would it be so bad to have to set the TFM every time (if that's
> > even possible), and just have a single per-CPU cache?

> That would be preferred, yes. The only snag here is that
> crypto_alloc_aead() is not guaranteed to return the same algo every
> time, which means the request size is not guaranteed to be the same
> either. This is a rare corner case, of course, but it needs to be
> dealt with regardless

Ah, good point. Well I guess you could allocate a bigger one it if it's
too small, but then we'd have to recalculate the size all the time
(which we already did anyway, but saving something else would be good).
Then we'd be close to just having a per-CPU memory block cache though.

johannes

  reply	other threads:[~2016-10-18 14:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 14:08 [RFC PATCH 0/2] mac80211: aes_ccm: cache AEAD request allocations per CPU Ard Biesheuvel
2016-10-18 14:08 ` [RFC PATCH 1/2] mac80211: aes_ccm: prepare key struct for storing context data Ard Biesheuvel
2016-10-18 14:08 ` [RFC PATCH 2/2] mac80211: aes_ccm: cache AEAD request structures per CPU Ard Biesheuvel
     [not found]   ` <1476799713-16188-3-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-18 14:16     ` Johannes Berg
     [not found]       ` <1476800194.6425.35.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2016-10-18 14:18         ` Ard Biesheuvel
2016-10-18 14:24           ` Johannes Berg [this message]
     [not found]             ` <1476800647.6425.38.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2016-10-18 14:30               ` Ard Biesheuvel

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=1476800647.6425.38.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ard.biesheuvel@linaro.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=netdev@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).