[PATCH v4] mac80211: Remove control.sta from struct ieee80211_tx_info and restructure tx-path

Johannes Berg johannes at sipsolutions.net
Tue Jul 24 10:47:31 EDT 2012


On Mon, 2012-07-23 at 21:33 +0200, Thomas Huehn wrote:

> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -196,6 +196,8 @@ struct ieee80211_tx_data {
>  	struct ieee80211_channel *channel;
>  
>  	unsigned int flags;
> +
> +	struct ieee80211_tx_control control;

Why is this needed/useful?

>  		info->control.vif = vif;
> -		info->control.sta = sta;
> +		control->sta = sta;
>  
>  		__skb_unlink(skb, skbs);
> -		drv_tx(local, skb);
> +		drv_tx(local, control, skb);

You're assigning to it right before, and I don't see you using it any
time before, so why not just have the control struct on the stack of
this function?

That would save all this passing around:

> @@ -1253,6 +1254,7 @@ static bool ieee80211_tx_frags(struct ieee80211_local *local,
>   * Returns false if the frame couldn't be transmitted but was queued instead.
>   */
>  static bool __ieee80211_tx(struct ieee80211_local *local,
> +			   struct ieee80211_tx_control *control,
>  			   struct sk_buff_head *skbs, int led_len,
>  			   struct sta_info *sta, bool txpending)
>  {
> @@ -1301,7 +1303,7 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
>  		break;
>  	}
>  
> -	result = ieee80211_tx_frags(local, vif, pubsta, skbs,
> +	result = ieee80211_tx_frags(local, vif, pubsta, control, skbs,
>  				    txpending);
>  
>  	ieee80211_tpt_led_trig_tx(local, fc, led_len);
> @@ -1409,7 +1411,7 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
>  			sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
>  
>  	if (!invoke_tx_handlers(&tx))
> -		result = __ieee80211_tx(local, &tx.skbs, led_len,
> +		result = __ieee80211_tx(local, &tx.control, &tx.skbs, led_len,
>  					tx.sta, txpending);
>   out:
>  	rcu_read_unlock();
> @@ -2154,6 +2156,7 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
>  	struct ieee80211_sub_if_data *sdata;
>  	struct sta_info *sta;
>  	struct ieee80211_hdr *hdr;
> +	struct ieee80211_tx_control control;
>  	bool result;
>  
>  	sdata = vif_to_sdata(info->control.vif);
> @@ -2169,7 +2172,7 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
>  		hdr = (struct ieee80211_hdr *)skb->data;
>  		sta = sta_info_get(sdata, hdr->addr1);
>  
> -		result = __ieee80211_tx(local, &skbs, skb->len, sta, true);
> +		result = __ieee80211_tx(local, &control, &skbs, skb->len, sta, true);
>  	}
>  
>  	return result;


johannes




More information about the b43-dev mailing list