Search Linux Wireless

Re: [PATCH 2/2] mac80211: Fixing Races for skipping tailroom reservation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > > @@ -498,8 +541,12 @@ void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata)
> > >  
> > >  	mutex_lock(&sdata->local->key_mtx);
> > >  
> > > -	list_for_each_entry(key, &sdata->key_list, list)
> > > +	sdata->local->crypto_tx_tailroom_needed_cnt = 0;
> > > +
> > 
> > That doesn't seem right either -- only if you have a single sdata that
> > will work, I think?
> Right. For multiple sdata count will be over written to 0.
> 
> I think, following should fix this
> 
> Thanks
> Yogesh
> 
> diff --git a/net/mac80211/key.c b/net/mac80211/key.c
> index edf9f40..0bf450d 100644
> --- a/net/mac80211/key.c
> +++ b/net/mac80211/key.c
> @@ -541,8 +541,6 @@ void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata)
>  
>  	mutex_lock(&sdata->local->key_mtx);
>  
> -	sdata->local->crypto_tx_tailroom_needed_cnt = 0;
> -
>  	list_for_each_entry(key, &sdata->key_list, list) {
>  		increment_tailroom_need_count(sdata->local);
>  		ieee80211_key_enable_hw_accel(key);
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index 05e3fb8..bef3bdd 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -1271,6 +1271,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
>  		mutex_unlock(&local->sta_mtx);
>  	}
>  
> +	/* Reset tailroom skip count */
> +	local->crypto_tx_tailroom_needed_cnt = 0;
> +
>  	/* add back keys */
>  	list_for_each_entry(sdata, &local->interfaces, list)
>  		if (ieee80211_sdata_running(sdata))
> 
> 
Above logic will not work if one the sdatas fails to enable keys may be
because of sdata not running.

Will work on some other logic.

Thanks
Yogesh
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux