Sfoglia il codice sorgente

qcacld-3.0: Maintain frame count per txq-group

1) Add function: ol_tx_update_grp_frm_count() to maintain count of frames
per group.
2) Call ol_tx_update_grp_frm_count() from ol_tx_enqueue(),
ol_tx_dequeue() and ol_tx_queue_free().

Change-Id: If1b07ea5bbdcbc6ad6d0c91e6b2060c4264b9472
CRs-fixed: 2246206
Ajit Pal Singh 7 anni fa
parent
commit
43ad30d0ec
3 ha cambiato i file con 45 aggiunte e 1 eliminazioni
  1. 24 1
      core/dp/txrx/ol_tx_queue.c
  2. 20 0
      core/dp/txrx/ol_tx_queue.h
  3. 1 0
      core/dp/txrx/ol_txrx_types.h

+ 24 - 1
core/dp/txrx/ol_tx_queue.c

@@ -256,6 +256,7 @@ ol_tx_enqueue(
 	bytes = qdf_nbuf_len(tx_desc->netbuf);
 	bytes = qdf_nbuf_len(tx_desc->netbuf);
 	txq->frms++;
 	txq->frms++;
 	txq->bytes += bytes;
 	txq->bytes += bytes;
+	ol_tx_update_grp_frm_count(txq, 1);
 	ol_tx_queue_log_enqueue(pdev, tx_msdu_info, 1, bytes);
 	ol_tx_queue_log_enqueue(pdev, tx_msdu_info, 1, bytes);
 
 
 	if (txq->flag != ol_tx_queue_paused) {
 	if (txq->flag != ol_tx_queue_paused) {
@@ -313,6 +314,8 @@ ol_tx_dequeue(
 	}
 	}
 	txq->frms -= num_frames;
 	txq->frms -= num_frames;
 	txq->bytes -= bytes_sum;
 	txq->bytes -= bytes_sum;
+	ol_tx_update_grp_frm_count(txq, -credit_sum);
+
 	/* a paused queue remains paused, regardless of whether it has frames */
 	/* a paused queue remains paused, regardless of whether it has frames */
 	if (txq->frms == 0 && txq->flag == ol_tx_queue_active)
 	if (txq->frms == 0 && txq->flag == ol_tx_queue_active)
 		txq->flag = ol_tx_queue_empty;
 		txq->flag = ol_tx_queue_empty;
@@ -358,7 +361,7 @@ ol_tx_queue_free(
 	txq->flag = ol_tx_queue_empty;
 	txq->flag = ol_tx_queue_empty;
 	/* txq->head gets reset during the TAILQ_CONCAT call */
 	/* txq->head gets reset during the TAILQ_CONCAT call */
 	TAILQ_CONCAT(&tx_tmp_list, &txq->head, tx_desc_list_elem);
 	TAILQ_CONCAT(&tx_tmp_list, &txq->head, tx_desc_list_elem);
-
+	ol_tx_update_grp_frm_count(txq, -frms);
 	qdf_spin_unlock_bh(&pdev->tx_queue_spinlock);
 	qdf_spin_unlock_bh(&pdev->tx_queue_spinlock);
 	/* free tx frames without holding tx_queue_spinlock */
 	/* free tx frames without holding tx_queue_spinlock */
 	qdf_atomic_add(frms, &pdev->tx_queue.rsrc_cnt);
 	qdf_atomic_add(frms, &pdev->tx_queue.rsrc_cnt);
@@ -1878,4 +1881,24 @@ u_int32_t ol_tx_get_max_tx_groups_supported(struct ol_txrx_pdev_t *pdev)
 }
 }
 #endif /* FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL */
 #endif /* FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL */
 
 
+#if defined(FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL) && \
+	defined(FEATURE_HL_DBS_GROUP_CREDIT_SHARING)
+void ol_tx_update_grp_frm_count(struct ol_tx_frms_queue_t *txq, int num_frms)
+{
+	int i;
+
+	if (!num_frms || !txq) {
+		ol_txrx_dbg("Invalid params\n");
+		return;
+	}
+
+	for (i = 0; i < OL_TX_MAX_GROUPS_PER_QUEUE; i++) {
+		if (txq->group_ptrs[i]) {
+			txq->group_ptrs[i]->frm_count += num_frms;
+			qdf_assert(txq->group_ptrs[i]->frm_count >= 0);
+		}
+	}
+}
+#endif
+
 /*--- End of LL tx throttle queue code ---------------------------------------*/
 /*--- End of LL tx throttle queue code ---------------------------------------*/

+ 20 - 0
core/dp/txrx/ol_tx_queue.h

@@ -581,4 +581,24 @@ ol_tx_set_peer_group_ptr(
 }
 }
 #endif
 #endif
 
 
+#if defined(FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL) && \
+	defined(FEATURE_HL_DBS_GROUP_CREDIT_SHARING)
+/**
+ * @brief: Update group frame count
+ * @details: This function is used to maintain the count of frames
+ * enqueued in a particular group.
+ *
+ * @param: txq - The txq to which the frame is getting enqueued.
+ * @param: num_frms - Number of frames to be added/removed from the group.
+ */
+void ol_tx_update_grp_frm_count(struct ol_tx_frms_queue_t *txq, int num_frms);
+#else
+static inline void ol_tx_update_grp_frm_count(struct ol_tx_frms_queue_t *txq,
+					      int num_frms)
+{}
+#endif /*
+	* FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL &&
+	*  FEATURE_HL_DBS_GROUP_CREDIT_SHARING
+	*/
+
 #endif /* _OL_TX_QUEUE__H_ */
 #endif /* _OL_TX_QUEUE__H_ */

+ 1 - 0
core/dp/txrx/ol_txrx_types.h

@@ -417,6 +417,7 @@ enum throttle_phase {
 struct ol_tx_queue_group_t {
 struct ol_tx_queue_group_t {
 	qdf_atomic_t credit;
 	qdf_atomic_t credit;
 	u_int32_t membership;
 	u_int32_t membership;
+	int frm_count;
 };
 };
 #define OL_TX_MAX_TXQ_GROUPS 2
 #define OL_TX_MAX_TXQ_GROUPS 2