]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ath10k: process htt rx indication as batch mode
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Fri, 12 Feb 2016 06:10:59 +0000 (11:40 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 3 Mar 2016 17:20:01 +0000 (19:20 +0200)
On multicore systems, it is possible that txrx tasket can run
in parallel with pci tasklet (i.e smp affinity of ath10k irq is
assigned to multiple CPUs). Feeding and consuming from the same
rx completion list leads to txrx tasklet runs for longer period.
Prevent this by processing a snapshot of rx queue by moving list
into temporary list. Consecutive received frames will be processed
in next batch.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/htt_rx.c

index a31de7b82da28f2ef2e9001aea7d21c4680fae2e..ae9b686a4e912298723d32a022af479d5854c5f4 100644 (file)
@@ -2151,22 +2151,34 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr)
        struct ath10k_htt *htt = (struct ath10k_htt *)ptr;
        struct ath10k *ar = htt->ar;
        struct sk_buff_head tx_q;
+       struct sk_buff_head rx_q;
+       struct sk_buff_head rx_ind_q;
        struct htt_resp *resp;
        struct sk_buff *skb;
        unsigned long flags;
 
        __skb_queue_head_init(&tx_q);
+       __skb_queue_head_init(&rx_q);
+       __skb_queue_head_init(&rx_ind_q);
 
        spin_lock_irqsave(&htt->tx_compl_q.lock, flags);
        skb_queue_splice_init(&htt->tx_compl_q, &tx_q);
        spin_unlock_irqrestore(&htt->tx_compl_q.lock, flags);
 
+       spin_lock_irqsave(&htt->rx_compl_q.lock, flags);
+       skb_queue_splice_init(&htt->rx_compl_q, &rx_q);
+       spin_unlock_irqrestore(&htt->rx_compl_q.lock, flags);
+
+       spin_lock_irqsave(&htt->rx_in_ord_compl_q.lock, flags);
+       skb_queue_splice_init(&htt->rx_in_ord_compl_q, &rx_ind_q);
+       spin_unlock_irqrestore(&htt->rx_in_ord_compl_q.lock, flags);
+
        while ((skb = __skb_dequeue(&tx_q))) {
                ath10k_htt_rx_frm_tx_compl(htt->ar, skb);
                dev_kfree_skb_any(skb);
        }
 
-       while ((skb = skb_dequeue(&htt->rx_compl_q))) {
+       while ((skb = __skb_dequeue(&rx_q))) {
                resp = (struct htt_resp *)skb->data;
                spin_lock_bh(&htt->rx_ring.lock);
                ath10k_htt_rx_handler(htt, &resp->rx_ind);
@@ -2174,7 +2186,7 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr)
                dev_kfree_skb_any(skb);
        }
 
-       while ((skb = skb_dequeue(&htt->rx_in_ord_compl_q))) {
+       while ((skb = __skb_dequeue(&rx_ind_q))) {
                spin_lock_bh(&htt->rx_ring.lock);
                ath10k_htt_rx_in_ord_ind(ar, skb);
                spin_unlock_bh(&htt->rx_ring.lock);