Commit e1378e52 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

mt76: rely on AQL for burst size limits on tx queueing



Now that AQL works well on all mt76 drivers, completely replace the arbitrary
burst sizing and number of bursts logic for tx scheduling.
For the short period of time in which AQL does not work well yet, limit each
stations to 16 in-flight packets that have no estimated tx time.
This should avoid filling the queue if a station connects and queues up a
large number of packets before rate control information is available, especially
with hardware rate control

Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 513d6acb
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -31,15 +31,14 @@ int mt76_queues_read(struct seq_file *s, void *data)
	int i;

	for (i = 0; i < ARRAY_SIZE(dev->q_tx); i++) {
		struct mt76_sw_queue *q = &dev->q_tx[i];
		struct mt76_queue *q = dev->q_tx[i].q;

		if (!q->q)
		if (!q)
			continue;

		seq_printf(s,
			   "%d:	queued=%d head=%d tail=%d swq_queued=%d\n",
			   i, q->q->queued, q->q->head, q->q->tail,
			   q->swq_queued);
			   "%d:	queued=%d head=%d tail=%d\n",
			   i, q->queued, q->head, q->tail);
	}

	return 0;
+6 −5
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@
#define MT_RX_BUF_SIZE      2048
#define MT_SKB_HEAD_LEN     128

#define MT_MAX_NON_AQL_PKT  16
#define MT_TXQ_FREE_THR     32

struct mt76_dev;
struct mt76_phy;
struct mt76_wcid;
@@ -100,10 +103,9 @@ struct mt76_queue_entry {
		struct urb *urb;
		int buf_sz;
	};
	enum mt76_txq_id qid;
	u16 wcid;
	bool skip_buf0:1;
	bool skip_buf1:1;
	bool schedule:1;
	bool done:1;
};

@@ -139,8 +141,6 @@ struct mt76_queue {

struct mt76_sw_queue {
	struct mt76_queue *q;

	int swq_queued;
};

struct mt76_mcu_ops {
@@ -205,6 +205,7 @@ DECLARE_EWMA(signal, 10, 8);
struct mt76_wcid {
	struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS];

	atomic_t non_aql_packets;
	unsigned long flags;

	struct ewma_signal rssi;
@@ -943,7 +944,7 @@ struct sk_buff *mt76_tx_status_skb_get(struct mt76_dev *dev,
				       struct sk_buff_head *list);
void mt76_tx_status_skb_done(struct mt76_dev *dev, struct sk_buff *skb,
			     struct sk_buff_head *list);
void mt76_tx_complete_skb(struct mt76_dev *dev, struct sk_buff *skb);
void mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid, struct sk_buff *skb);
void mt76_tx_status_check(struct mt76_dev *dev, struct mt76_wcid *wcid,
			  bool flush);
int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+1 −1
Original line number Diff line number Diff line
@@ -1282,7 +1282,7 @@ void mt7603_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue_entry *e)
	}

	dev->tx_hang_check = 0;
	mt76_tx_complete_skb(mdev, skb);
	mt76_tx_complete_skb(mdev, e->wcid, skb);
}

static bool
+8 −1
Original line number Diff line number Diff line
@@ -1400,6 +1400,9 @@ mt7615_mac_tx_free_token(struct mt7615_dev *dev, u16 token)
{
	struct mt76_dev *mdev = &dev->mt76;
	struct mt76_txwi_cache *txwi;
	__le32 *txwi_data;
	u32 val;
	u8 wcid;

	trace_mac_tx_free(dev, token);

@@ -1410,9 +1413,13 @@ mt7615_mac_tx_free_token(struct mt7615_dev *dev, u16 token)
	if (!txwi)
		return;

	txwi_data = (__le32 *)mt76_get_txwi_ptr(mdev, txwi);
	val = le32_to_cpu(txwi_data[1]);
	wcid = FIELD_GET(MT_TXD1_WLAN_IDX, val);

	mt7615_txp_skb_unmap(mdev, txwi);
	if (txwi->skb) {
		mt76_tx_complete_skb(mdev, txwi->skb);
		mt76_tx_complete_skb(mdev, wcid, txwi->skb);
		txwi->skb = NULL;
	}

+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ void mt7615_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue_entry *e)
	}

	if (e->skb)
		mt76_tx_complete_skb(mdev, e->skb);
		mt76_tx_complete_skb(mdev, e->wcid, e->skb);
}

static void
Loading