[2/2] iwlwifi: Extended Key ID support
diff mbox series

Message ID 20190506190149.3624-2-alexander@wetzel-home.de
State Superseded
Delegated to: Luca Coelho
Headers show
Series
  • [1/2] mac80211: AMPDU handling for Extended Key ID
Related show

Commit Message

Alexander Wetzel May 6, 2019, 7:01 p.m. UTC
iwlwifi cards are all able to support Extended Key ID as long as
mac80211 stops A-MPDU aggregation when replacing the unicast key.

Enable Extended Key ID support and tell mac80211 that it has to tear
down any running Tx aggregation sessions during rekey when using
Extended Key ID.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
---
 drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c | 2 ++
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Alexander Wetzel June 26, 2019, 9:10 p.m. UTC | #1
> iwlwifi cards are all able to support Extended Key ID as long as
> mac80211 stops A-MPDU aggregation when replacing the unicast key.
> 
> Enable Extended Key ID support and tell mac80211 that it has to tear
> down any running Tx aggregation sessions during rekey when using
> Extended Key ID.

With the merge of the A-MPDU handling patch 
https://patchwork.kernel.org/patch/10931861/ we probably should simplify 
the API for Extended Key ID and not merge the patch as it is:

1) We can drop EXT_KEY_ID_NATIVE from mac80211 and let the drivers set
    NL80211_EXT_FEATURE_EXT_KEY_ID instead of mac80211.
    Without the COMPAT support the naming is off and the flag is simply
    pointless. Assuming we want to pick up the COMPAT Extended Key ID we
    still can just define a new flag, e.g.
    SINGLE_STA_UNICAST_KEY_OFFLOAD_ONLY to tell mac80211 it can only
    have one unicast key active in the HW per STA.

2) Mac80211 would then enable Extended Key ID for all drivers using SW
    crypto and just also set NO_AMPDU_KEYBORDER_SUPPORT when the driver
    supports A-MPDU

3) we then could undo (revert?) cfe7007a9b4c ("mac80211_hwsim: Extended
    Key ID support") and let the more generic code in mac80211 handle it

If you agree I'll prepare and test a small patch series for that.
And we better only merge a iteration of this patch here once we got the 
API updated.

Alexander
Johannes Berg June 28, 2019, 10:49 a.m. UTC | #2
Hi,

On Wed, 2019-06-26 at 23:10 +0200, Alexander Wetzel wrote:
> > iwlwifi cards are all able to support Extended Key ID as long as
> > mac80211 stops A-MPDU aggregation when replacing the unicast key.
> > 
> > Enable Extended Key ID support and tell mac80211 that it has to tear
> > down any running Tx aggregation sessions during rekey when using
> > Extended Key ID.
> 
> With the merge of the A-MPDU handling patch 
> https://patchwork.kernel.org/patch/10931861/ we probably should simplify 
> the API for Extended Key ID and not merge the patch as it is:
> 
> 1) We can drop EXT_KEY_ID_NATIVE from mac80211 and let the drivers set
>     NL80211_EXT_FEATURE_EXT_KEY_ID instead of mac80211.
>     Without the COMPAT support the naming is off and the flag is simply
>     pointless. Assuming we want to pick up the COMPAT Extended Key ID we
>     still can just define a new flag, e.g.
>     SINGLE_STA_UNICAST_KEY_OFFLOAD_ONLY to tell mac80211 it can only
>     have one unicast key active in the HW per STA.

Yes, true, with the compat more or less off the table for now, we don't
really need this extra complexity.

> 2) Mac80211 would then enable Extended Key ID for all drivers using SW
>     crypto and just also set NO_AMPDU_KEYBORDER_SUPPORT when the driver
>     supports A-MPDU

Right (or not really set the flag, but get rid of it?), though maybe
some (rare) driver would actually support ampdu keyborder? Ath9k for
example could do that since it builds the aggregates in software, so I
guess we'd need some flag indicating the opposite then.

> 3) we then could undo (revert?) cfe7007a9b4c ("mac80211_hwsim: Extended
>     Key ID support") and let the more generic code in mac80211 handle it
> 
> If you agree I'll prepare and test a small patch series for that.
> And we better only merge a iteration of this patch here once we got the 
> API updated.

Sounds good to me!

johannes

Patch
diff mbox series

diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
index 54b759cec8b3..160c3fd04399 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
@@ -111,6 +111,8 @@  int iwlagn_mac_setup_register(struct iwl_priv *priv,
 	ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
 	ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
 	ieee80211_hw_set(hw, WANT_MONITOR_VIF);
+	ieee80211_hw_set(hw, EXT_KEY_ID_NATIVE);
+	ieee80211_hw_set(hw, NO_AMPDU_KEYBORDER_SUPPORT);
 
 	if (priv->trans->max_skb_frags)
 		hw->netdev_features = NETIF_F_HIGHDMA | NETIF_F_SG;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 5c52469288be..6475adbe60e9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -470,6 +470,8 @@  int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 	ieee80211_hw_set(hw, STA_MMPDU_TXQ);
 	ieee80211_hw_set(hw, TX_AMSDU);
 	ieee80211_hw_set(hw, TX_FRAG_LIST);
+	ieee80211_hw_set(hw, EXT_KEY_ID_NATIVE);
+	ieee80211_hw_set(hw, NO_AMPDU_KEYBORDER_SUPPORT);
 
 	if (iwl_mvm_has_tlc_offload(mvm)) {
 		ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);