Search Linux Wireless

Re: [PATCH 1/2] mac80211: add TX fastpath

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

 



On Mon, 2015-03-30 at 16:36 +0200, Johannes Berg wrote:
> In order to speed up mac80211's TX path, add the "fast-xmit" cache
> that will cache the data frame 802.11 header and other data to be
> able to build the frame more quickly. This cache is rebuilt when
> external triggers imply changes, but a lot of the checks done per
> packet today are simplified away to the check for the cache.

Possible optimization:

> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
[]
> +void ieee80211_check_fast_xmit(struct sta_info *sta, gfp_t gfp)
> +{
> +	struct ieee80211_fast_tx build = {}, *fast_tx, *old;

This "{}" memset should probably be moved farther down
because there are many return paths that are possible
before the memset is necessary.

> +	struct ieee80211_local *local = sta->local;
> +	struct ieee80211_sub_if_data *sdata = sta->sdata;
> +	struct ieee80211_hdr *hdr = (void *)build.hdr;
> +	struct ieee80211_chanctx_conf *chanctx_conf;
> +	__le16 fc;
> +
> +	if (!(local->hw.flags & IEEE80211_HW_SUPPORT_FAST_XMIT))
> +		return;
> +
> +	ieee80211_clear_fast_xmit(sta);
> +
> +	if (local->hw.flags & IEEE80211_HW_SUPPORTS_PS &&
> +	    !(local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS) &&
> +	    sdata->vif.type == NL80211_IFTYPE_STATION)
> +		return;
> +
> +	if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
> +		return;
> +
> +	if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
> +	    test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
> +	    test_sta_flag(sta, WLAN_STA_PS_DELIVER))
> +		return;
> +
> +	/* fast-xmit doesn't handle fragmentation at all */
> +	if (local->hw.wiphy->frag_threshold != (u32)-1)
> +		return;

To here...

> +	rcu_read_lock();
> +	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> +	if (!chanctx_conf) {
> +		rcu_read_unlock();
> +		return;
> +	}

or here.

> +	build.band = chanctx_conf->def.chan->band;
> +	rcu_read_unlock();



--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux