From: Johannes Berg <johannes@sipsolutions.net>
To: Yogesh Ashok Powar <yogeshp@marvell.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
Lennert Buytenhek <buytenh@wantstofly.org>
Subject: Re: [PATCH 1/2] mac80211: Adding HW flag IEEE80211_HW_CRYPTO_ENABLED
Date: Thu, 21 Apr 2011 14:33:56 +0200 [thread overview]
Message-ID: <1303389236.3597.8.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <20110421121513.GC27527@hertz.marvell.com>
On Thu, 2011-04-21 at 17:45 +0530, Yogesh Ashok Powar wrote:
> @@ -101,6 +101,9 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
>
> if (!ret) {
> key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
> + if (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)
> + key->local->crypto_tx_tailroom_needed_cnt++;
> +
> return 0;
> }
>
> @@ -117,6 +120,11 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
> case WLAN_CIPHER_SUITE_CCMP:
> case WLAN_CIPHER_SUITE_AES_CMAC:
> /* all of these we can do in software */
> +
> + /* SW encryption need tailroom reservation */
> + BUG_ON(!key->local);
BUG_ON? Seriously? It was already dereferenced about 10 times here... In
any case, this isn't right.
> @@ -156,6 +164,11 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
> key->conf.keyidx, sta ? sta->addr : bcast_addr, ret);
>
> key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
> +
> + if ((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)
> + && key->local->crypto_tx_tailroom_needed_cnt)
> + key->local->crypto_tx_tailroom_needed_cnt--;
And that if (cnt) can't be right either.
> + if (key_sw_programmed && local->crypto_tx_tailroom_needed_cnt)
> + local->crypto_tx_tailroom_needed_cnt--;
So you're putting if (needed_cnt) everywhere because you have
refcounting bugs? Better fix those bugs ....
> + local->crypto_tx_tailroom_needed_cnt = 0;
Not necessary, it's already 0.
I don't think you understood what I said how it should work. You must
increase the counter when the key is created, and then you can reduce it
again when the key is uploaded and no mmic is needed.
johannes
next prev parent reply other threads:[~2011-04-21 12:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-15 4:53 [PATCH 1/2] mac80211: Adding HW flag IEEE80211_HW_CRYPTO_ENABLED Yogesh Ashok Powar
2011-04-15 6:55 ` Johannes Berg
2011-04-15 8:40 ` Yogesh Ashok Powar
2011-04-15 8:52 ` Johannes Berg
2011-04-15 10:51 ` Yogesh Ashok Powar
2011-04-15 11:01 ` Johannes Berg
2011-04-21 12:15 ` Yogesh Ashok Powar
2011-04-21 12:33 ` Johannes Berg [this message]
2011-04-21 12:38 ` Johannes Berg
2011-04-21 12:46 ` Yogesh Ashok Powar
2011-04-21 12:59 ` Johannes Berg
2011-04-27 11:03 ` Yogesh Ashok Powar
2011-04-27 11:27 ` Johannes Berg
2011-04-27 11:40 ` Yogesh Ashok Powar
2011-04-27 11:53 ` 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=1303389236.3597.8.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=buytenh@wantstofly.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=yogeshp@marvell.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).