linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Eliad Peller <eliad@wizery.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 01/11] mac80211: add TX fastpath
Date: Tue, 21 Apr 2015 09:06:59 +0200	[thread overview]
Message-ID: <1429600019.2045.2.camel@sipsolutions.net> (raw)
In-Reply-To: <CAB3XZEeTCSK2qpyBqBXJLyJm_SES4RncUr0AoZLtqqvCz9BprQ@mail.gmail.com> (sfid-20150421_085437_370250_F0858165)

On Tue, 2015-04-21 at 09:54 +0300, Eliad Peller wrote:

> > Hey, somebody is reviewing my patches :-)
> >
> i didn't delve into them too much, but generally they look good :)

:)

> > To fix that, I think I can hold the lock longer, so that the lifetime of
> > the key and the fast_tx pointer are more closely correlated. If I
> > acquire the spinlock before checking for the key, then the CPU that
> > invalidates the key pointer cannot race in this way with another caller,
> > since the key pointer would (for this purpose) be protected by the lock.
> > Then either the CPU that deleted the key will have to wait (while the
> > key is still pretty much valid) and then will overwrite the fast_tx w/o
> > the key, or the other CPU will have to wait and will find the key
> > pointer changed/NULL already.
> >
> > Right? what do you think?
> 
> sounds correct.
> i guess taking rcu_lock is a valid option as well (for about the same
> reasons). so either one of them should be good.

I don't think that would be correct - that just prevents the key from
being freed while we hold it, whereas here we actually need to prevent
the key from being accessed.

Anyway - I've done a bit more testing on this and will likely merge it
(the fixed version of course) in the next couple of days.

johannes


  reply	other threads:[~2015-04-21  7:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 15:15 [PATCH 01/11] mac80211: add TX fastpath Johannes Berg
2015-04-17 15:15 ` [PATCH 02/11] mac80211_hwsim: enable IEEE80211_HW_SUPPORT_FAST_XMIT Johannes Berg
2015-04-17 15:15 ` [PATCH 03/11] mac80211: extend fast-xmit to driver fragmentation Johannes Berg
2015-04-17 15:15 ` [PATCH 04/11] mac80211: extend fast-xmit for more ciphers Johannes Berg
2015-04-17 15:15 ` [PATCH 05/11] mac80211: extend fast-xmit to cover IBSS Johannes Berg
2015-04-17 15:15 ` [PATCH 06/11] wlcore: enable IEEE80211_HW_SUPPORT_FAST_XMIT Johannes Berg
2015-04-17 15:15 ` [PATCH 07/11] ath10k: " Johannes Berg
2015-04-22  9:00   ` Kalle Valo
2015-04-17 15:15 ` [PATCH 08/11] mac80211: allow checksum offload only in fast-xmit Johannes Berg
2015-04-17 15:15 ` [PATCH 09/11] mac80211: enable changing netdev features with ethtool Johannes Berg
2015-04-17 15:15 ` [PATCH 10/11] mac80211: allow drivers to support S/G Johannes Berg
2015-04-17 15:15 ` [PATCH 11/11] mac80211: allow segmentation offloads Johannes Berg
2015-04-20  8:25 ` [PATCH 01/11] mac80211: add TX fastpath Eliad Peller
2015-04-20  8:47   ` Johannes Berg
2015-04-21  6:54     ` Eliad Peller
2015-04-21  7:06       ` Johannes Berg [this message]
2015-04-22 11:00 ` 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=1429600019.2045.2.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=eliad@wizery.com \
    --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).