Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7827e51 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by Kalle Valo
Browse files

ath10k: reduce rx_lock contention for htt rx indication



Received frame indications are queued into a skb list and latest
processed by txrx tasklet. This skb queue is protected by htt rx lock.
Since the entire rx processing till delivering frame to mac80211 and
replenish tasks are processed under rx_lock protection, there might be
some delay in queuing newly received rx frame into that list on
multicore systems. Optimize this by using skb list lock while accessing
rx completion queue instead of htt rx lock.

Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 22baa980
Loading
Loading
Loading
Loading
+8 −10
Original line number Original line Diff line number Diff line
@@ -2011,9 +2011,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
		break;
		break;
	}
	}
	case HTT_T2H_MSG_TYPE_RX_IND:
	case HTT_T2H_MSG_TYPE_RX_IND:
		spin_lock_bh(&htt->rx_ring.lock);
		skb_queue_tail(&htt->rx_compl_q, skb);
		__skb_queue_tail(&htt->rx_compl_q, skb);
		spin_unlock_bh(&htt->rx_ring.lock);
		tasklet_schedule(&htt->txrx_compl_task);
		tasklet_schedule(&htt->txrx_compl_task);
		return;
		return;
	case HTT_T2H_MSG_TYPE_PEER_MAP: {
	case HTT_T2H_MSG_TYPE_PEER_MAP: {
@@ -2111,9 +2109,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
		break;
		break;
	}
	}
	case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND: {
	case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND: {
		spin_lock_bh(&htt->rx_ring.lock);
		skb_queue_tail(&htt->rx_in_ord_compl_q, skb);
		__skb_queue_tail(&htt->rx_in_ord_compl_q, skb);
		spin_unlock_bh(&htt->rx_ring.lock);
		tasklet_schedule(&htt->txrx_compl_task);
		tasklet_schedule(&htt->txrx_compl_task);
		return;
		return;
	}
	}
@@ -2170,16 +2166,18 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr)
		dev_kfree_skb_any(skb);
		dev_kfree_skb_any(skb);
	}
	}


	spin_lock_bh(&htt->rx_ring.lock);
	while ((skb = skb_dequeue(&htt->rx_compl_q))) {
	while ((skb = __skb_dequeue(&htt->rx_compl_q))) {
		resp = (struct htt_resp *)skb->data;
		resp = (struct htt_resp *)skb->data;
		spin_lock_bh(&htt->rx_ring.lock);
		ath10k_htt_rx_handler(htt, &resp->rx_ind);
		ath10k_htt_rx_handler(htt, &resp->rx_ind);
		spin_unlock_bh(&htt->rx_ring.lock);
		dev_kfree_skb_any(skb);
		dev_kfree_skb_any(skb);
	}
	}


	while ((skb = __skb_dequeue(&htt->rx_in_ord_compl_q))) {
	while ((skb = skb_dequeue(&htt->rx_in_ord_compl_q))) {
		spin_lock_bh(&htt->rx_ring.lock);
		ath10k_htt_rx_in_ord_ind(ar, skb);
		ath10k_htt_rx_in_ord_ind(ar, skb);
		spin_unlock_bh(&htt->rx_ring.lock);
		dev_kfree_skb_any(skb);
		dev_kfree_skb_any(skb);
	}
	}
	spin_unlock_bh(&htt->rx_ring.lock);
}
}