Browse Source

Merge "qcacmn: Tx desc counter changes"

Linux Build Service Account 6 years ago
parent
commit
f05472e6ce
3 changed files with 35 additions and 3 deletions
  1. 10 0
      dp/wifi3.0/dp_main.c
  2. 25 1
      dp/wifi3.0/dp_tx_desc.c
  3. 0 2
      dp/wifi3.0/dp_tx_desc.h

+ 10 - 0
dp/wifi3.0/dp_main.c

@@ -5241,7 +5241,17 @@ dp_print_pdev_rx_mon_stats(struct dp_pdev *pdev)
 static inline void
 dp_print_soc_tx_stats(struct dp_soc *soc)
 {
+	uint8_t desc_pool_id;
+	soc->stats.tx.desc_in_use = 0;
+
 	DP_PRINT_STATS("SOC Tx Stats:\n");
+
+	for (desc_pool_id = 0;
+	     desc_pool_id < wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
+	     desc_pool_id++)
+		soc->stats.tx.desc_in_use +=
+			soc->tx_desc[desc_pool_id].num_allocated;
+
 	DP_PRINT_STATS("Tx Descriptors In Use = %d",
 			soc->stats.tx.desc_in_use);
 	DP_PRINT_STATS("Invalid peer:");

+ 25 - 1
dp/wifi3.0/dp_tx_desc.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -38,6 +38,29 @@ do {                                                                 \
 #define DP_TX_DESC_PAGE_DIVIDER(soc, num_desc_per_page, pool_id) {}
 #endif /* DESC_PARTITION */
 
+/**
+ * dp_tx_desc_pool_counter_initialize() - Initialize counters
+ * @tx_desc_pool Handle to DP tx_desc_pool structure
+ * @num_elem Number of descriptor elements per pool
+ *
+ * Return: None
+ */
+#ifdef QCA_LL_TX_FLOW_CONTROL_V2
+static void
+dp_tx_desc_pool_counter_initialize(struct dp_tx_desc_pool_s *tx_desc_pool,
+				  uint16_t num_elem)
+{
+}
+#else
+static void
+dp_tx_desc_pool_counter_initialize(struct dp_tx_desc_pool_s *tx_desc_pool,
+				  uint16_t num_elem)
+{
+	tx_desc_pool->num_free = num_elem;
+	tx_desc_pool->num_allocated = 0;
+}
+#endif
+
 /**
  * dp_tx_desc_pool_alloc() - Allocate Tx Descriptor pool(s)
  * @soc Handle to DP SoC structure
@@ -115,6 +138,7 @@ QDF_STATUS dp_tx_desc_pool_alloc(struct dp_soc *soc, uint8_t pool_id,
 		count++;
 	}
 
+	dp_tx_desc_pool_counter_initialize(tx_desc_pool, num_elem);
 	TX_DESC_LOCK_CREATE(&tx_desc_pool->lock);
 	return QDF_STATUS_SUCCESS;
 

+ 0 - 2
dp/wifi3.0/dp_tx_desc.h

@@ -274,7 +274,6 @@ static inline struct dp_tx_desc_s *dp_tx_desc_alloc(struct dp_soc *soc,
 	soc->tx_desc[desc_pool_id].num_allocated++;
 	soc->tx_desc[desc_pool_id].num_free--;
 
-	DP_STATS_INC(soc, tx.desc_in_use, 1);
 	tx_desc->flags = DP_TX_DESC_FLAG_ALLOCATED;
 
 	TX_DESC_LOCK_UNLOCK(&soc->tx_desc[desc_pool_id].lock);
@@ -346,7 +345,6 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc,
 	tx_desc->flags = 0;
 	tx_desc->next = soc->tx_desc[desc_pool_id].freelist;
 	soc->tx_desc[desc_pool_id].freelist = tx_desc;
-	DP_STATS_DEC(soc, tx.desc_in_use, 1);
 	soc->tx_desc[desc_pool_id].num_allocated--;
 	soc->tx_desc[desc_pool_id].num_free++;