Search Linux Wireless

Re: [PATCH 5/6] mac80211: rx.c/tx.c remove more users of tx/rx_data->fc

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

 



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


--
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