From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-it0-f66.google.com ([209.85.214.66]:34599 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbcIBCsw (ORCPT ); Thu, 1 Sep 2016 22:48:52 -0400 Received: by mail-it0-f66.google.com with SMTP id e124so745667ith.1 for ; Thu, 01 Sep 2016 19:48:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160901160312.31540-1-toke@toke.dk> References: <20160830131548.6014-1-toke@toke.dk> <20160901160312.31540-1-toke@toke.dk> From: Jason Andryuk Date: Thu, 1 Sep 2016 22:48:50 -0400 Message-ID: (sfid-20160902_044856_869409_0FE30C48) Subject: Re: [PATCH v5] mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue. To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: make-wifi-fast@lists.bufferbloat.net, "linux-wireless@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Thu, Sep 1, 2016 at 12:03 PM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: > @@ -1481,33 +1506,57 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee8= 0211_hw *hw, > { > struct ieee80211_local *local =3D hw_to_local(hw); > struct txq_info *txqi =3D container_of(txq, struct txq_info, txq)= ; > - struct ieee80211_hdr *hdr; > struct sk_buff *skb =3D NULL; > struct fq *fq =3D &local->fq; > struct fq_tin *tin =3D &txqi->tin; > + struct ieee80211_tx_info *info; > > spin_lock_bh(&fq->lock); > > if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags)) > goto out; > > +begin: > skb =3D fq_tin_dequeue(fq, tin, fq_tin_dequeue_func); > if (!skb) > goto out; > > ieee80211_set_skb_vif(skb, txqi); > > - hdr =3D (struct ieee80211_hdr *)skb->data; > - if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) { > + info =3D IEEE80211_SKB_CB(skb); > + if (txq->sta && info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT= ) { > struct sta_info *sta =3D container_of(txq->sta, struct st= a_info, > sta); > - struct ieee80211_tx_info *info =3D IEEE80211_SKB_CB(skb); > + struct ieee80211_fast_tx *fast_tx; > > - hdr->seq_ctrl =3D ieee80211_tx_next_seq(sta, txq->tid); > - if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) > - info->flags |=3D IEEE80211_TX_CTL_AMPDU; > - else > - info->flags &=3D ~IEEE80211_TX_CTL_AMPDU; > + fast_tx =3D rcu_dereference(sta->fast_tx); > + if (WARN_ON(!fast_tx)) { > + /* lost the fast_tx pointer while the packet was = queued */ > + ieee80211_free_txskb(hw, skb); > + goto begin; > + } > + ieee80211_xmit_fast_finish(sta->sdata, sta, fast_tx, skb,= false); > + } else { > + struct ieee80211_tx_data tx =3D { }; > + > + __skb_queue_head_init(&tx.skbs); > + tx.local =3D local; > + if (txq->sta) { > + struct sta_info *sta =3D container_of(txq->sta, > + struct sta_in= fo, > + sta); sta is unneeded give the assignment below? Regards, Jason > + tx.sta =3D container_of(txq->sta, struct sta_info= , sta); > + tx.sdata =3D sta->sdata; > + } else { > + tx.sdata =3D vif_to_sdata(info->control.vif); > + } > + > + __skb_queue_tail(&tx.skbs, skb); > + > + if (invoke_tx_handlers_late(&tx)) > + goto begin; > + > + __skb_unlink(skb, &tx.skbs); > }