All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 5/6] mac80211: rx.c/tx.c remove more users of tx/rx_data->fc
Date: Tue, 08 Jul 2008 14:45:40 -0700	[thread overview]
Message-ID: <1215553540.476.49.camel@brick> (raw)
In-Reply-To: <1215552534.3670.20.camel@johannes.berg>

On Tue, 2008-07-08 at 23:28 +0200, Johannes Berg wrote:
> >  
> > -	switch (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
> > -	case IEEE80211_FCTL_TODS:
> 
> > +	if (ieee80211_has_a4(hdr->frame_control)) {
> > +		if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_WDS &&
> > +			     sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT))
> > +			return -1;
> > +	} else if (ieee80211_has_tods(hdr->frame_control)) {
> 
> I don't particularly like converting a switch statement to chained ifs
> in this path, you even put the most unlikely one first. With the switch,
> the compiler should be able to generate just two compares for each path
> (binary tree), while with this the common STA path already needs three.
> 
> We could instead open-code the binary tree that the compiler should
> create for the switch, I guess, i.e.

Well, I suppose I can also take another crack at getting my updated byteorder
patches in that allows cpu_to_le16, etc to be in a case statement, then the
switch could be preserved  and the byteswaps can be done at compile time.

I'll go take another crack at it I suppose, but it seems to meet with stunning
silence whenever I post it :-(

Harvey



  reply	other threads:[~2008-07-08 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08 20:47 [PATCH 5/6] mac80211: rx.c/tx.c remove more users of tx/rx_data->fc Harvey Harrison
2008-07-08 21:28 ` Johannes Berg
2008-07-08 21:45   ` Harvey Harrison [this message]
2008-07-08 22:06     ` Johannes Berg
2008-07-08 22:25       ` [PATCH 5/6v2] " Harvey Harrison
2008-07-08 23:04         ` Johannes Berg
2008-07-08 23:13           ` Harvey Harrison
2008-07-09  7:47             ` 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=1215553540.476.49.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.