linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH 1/2] mac80211: add TX fastpath
Date: Mon, 30 Mar 2015 08:03:38 -0700	[thread overview]
Message-ID: <1427727818.14276.7.camel@perches.com> (raw)
In-Reply-To: <1427726167-17802-1-git-send-email-johannes@sipsolutions.net>

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();




  parent reply	other threads:[~2015-03-30 15:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 14:36 [PATCH 1/2] mac80211: add TX fastpath Johannes Berg
2015-03-30 14:36 ` [PATCH 2/2] mac80211_hwsim: enable fast-xmit Johannes Berg
2015-03-30 14:49 ` [PATCH 1/2] mac80211: add TX fastpath Johannes Berg
2015-03-30 15:03 ` Joe Perches [this message]
2015-03-30 15:07   ` Johannes Berg
2015-03-30 16:42     ` Joe Perches

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=1427727818.14276.7.camel@perches.com \
    --to=joe@perches.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --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).