Search Linux Wireless

Re: [RFC/RFT v3] mac80211: Add NEED_ALIGNED4_SKBS hw flag

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

 



On Tue, 2016-01-05 at 14:06 +0100, Janusz Dziedzic wrote:

> +++ b/net/mac80211/status.c
> @@ -678,9 +678,22 @@ void ieee80211_tx_monitor(struct ieee80211_local
> *local, struct sk_buff *skb,
>  	struct sk_buff *skb2;
>  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
>  	struct ieee80211_sub_if_data *sdata;
> +	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb-
> >data;

Could be (void *) cast

>  	struct net_device *prev_dev = NULL;
> +	unsigned int padsize, hdrlen;
>  	int rtap_len;
>  
> +	/* Remove padding if was added */
> +	if (ieee80211_hw_check(&local->hw, NEEDS_ALIGNED4_SKBS)) {
> +		hdrlen = ieee80211_hdrlen(hdr->frame_control);
> +		padsize = hdrlen & 3;
> +
> +		if (padsize && skb->len > hdrlen + padsize) {
> +			memmove(skb->data + padsize, skb->data,
> hdrlen);
> +			skb_pull(skb, padsize);
> +		}
> +	}

But perhaps this should just be done by the driver?

>  /* tx handlers */
>  static ieee80211_tx_result debug_noinline
> +ieee80211_tx_h_hdrlen_add(struct ieee80211_tx_data *tx)
> +{
> +	struct ieee80211_hw *hw = &tx->local->hw;
> +	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb-
> >data;
> +
> +	tx->hdrlen = ieee80211_hdrlen(hdr->frame_control);
> +
> +	if (ieee80211_hw_check(hw, NEEDS_ALIGNED4_SKBS))
> +		tx->hdrlen += tx->hdrlen & 3;
> +
> +	return TX_CONTINUE;
> +}

Can't we do this in the same place that actually adds the padding? Even
if not, I don't think it should be a separate TX handler, most of the
tx setup is done elsewhere.

> +	/* Check if aligned skb required */
> +	if (ieee80211_hw_check(&local->hw, NEEDS_ALIGNED4_SKBS))
> +		build.hdr_len += build.hdr_len & 3;

Pretty sure you need to increase the reserved space in the fast-xmit
struct?

> -	hdrlen = ieee80211_hdrlen(hdr->frame_control);
> +	hdrlen = tx->hdrlen;

maybe you can also do all these changes separately?

>  	pos += IEEE80211_CCMP_HDR_LEN;
> +
>  	ccmp_special_blocks(skb, pn, b_0, aad);

spurious change

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