Эх сурвалжийг харах

qcacmn: Enable monitor destination ring interrupt for waikiki

Enable monitor Tx/Rx ring interrupt for waikiki

CRs-Fixed: 3010851
Change-Id: I33537f7d4dbab700af7ccdb2ca511531fd3ade76
Naga 3 жил өмнө
parent
commit
fa9b23b61f

+ 24 - 2
dp/wifi3.0/dp_main.c

@@ -1397,6 +1397,10 @@ static int dp_srng_calculate_msi_group(struct dp_soc *soc,
 		/* dp_mon_process */
 		grp_mask = &soc->wlan_cfg_ctx->int_rx_mon_ring_mask[0];
 	break;
+	case TX_MONITOR_DST:
+		/* dp_tx_mon_process */
+		grp_mask = &soc->wlan_cfg_ctx->int_tx_mon_ring_mask[0];
+	break;
 	case RXDMA_DST:
 		/* dp_rxdma_err_process */
 		grp_mask = &soc->wlan_cfg_ctx->int_rxdma2host_ring_mask[0];
@@ -1756,7 +1760,8 @@ dp_srng_configure_interrupt_thresholds(struct dp_soc *soc,
 	 * TODO: See if this is required for any other ring
 	 */
 	if ((ring_type == RXDMA_BUF) || (ring_type == RXDMA_MONITOR_BUF) ||
-	    (ring_type == RXDMA_MONITOR_STATUS)) {
+	    (ring_type == RXDMA_MONITOR_STATUS ||
+	    (ring_type == TX_MONITOR_BUF))) {
 		/* TODO: Setting low threshold to 1/8th of ring size
 		 * see if this needs to be configurable
 		 */
@@ -2291,6 +2296,18 @@ static int dp_process_lmac_rings(struct dp_intr *int_ctx, int total_budget)
 			remaining_quota = budget;
 		}
 
+		if (int_ctx->tx_mon_ring_mask & (1 << mac_for_pdev)) {
+			work_done = dp_tx_mon_process(soc, int_ctx,
+						      mac_for_pdev,
+						      remaining_quota);
+			if (work_done)
+				intr_stats->num_tx_mon_ring_masks++;
+			budget -= work_done;
+			if (budget <= 0)
+				goto budget_done;
+			remaining_quota = budget;
+		}
+
 		if (int_ctx->rxdma2host_ring_mask &
 				(1 << mac_for_pdev)) {
 			work_done = dp_rxdma_err_process(int_ctx, soc,
@@ -2854,6 +2871,8 @@ static void dp_soc_interrupt_map_calculate_msi(struct dp_soc *soc,
 					soc->wlan_cfg_ctx, intr_ctx_num);
 	int rx_mon_mask = wlan_cfg_get_rx_mon_ring_mask(
 					soc->wlan_cfg_ctx, intr_ctx_num);
+	int tx_mon_mask = wlan_cfg_get_tx_mon_ring_mask(
+					soc->wlan_cfg_ctx, intr_ctx_num);
 	int rx_err_ring_mask = wlan_cfg_get_rx_err_ring_mask(
 					soc->wlan_cfg_ctx, intr_ctx_num);
 	int rx_wbm_rel_ring_mask = wlan_cfg_get_rx_wbm_rel_ring_mask(
@@ -2882,7 +2901,7 @@ static void dp_soc_interrupt_map_calculate_msi(struct dp_soc *soc,
 
 	soc->intr_mode = DP_INTR_MSI;
 
-	if (tx_mask | rx_mask | rx_mon_mask | rx_err_ring_mask |
+	if (tx_mask | rx_mask | rx_mon_mask | tx_mon_mask | rx_err_ring_mask |
 	    rx_wbm_rel_ring_mask | reo_status_ring_mask | rxdma2host_ring_mask |
 	    host2rxdma_ring_mask | host2rxdma_mon_ring_mask |
 	    rx_near_full_grp_1_mask | rx_near_full_grp_2_mask |
@@ -3019,6 +3038,8 @@ static QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc)
 			wlan_cfg_get_rx_ring_mask(soc->wlan_cfg_ctx, i);
 		int rx_mon_mask =
 			dp_soc_get_mon_mask_for_interrupt_mode(soc, i);
+		int tx_mon_ring_mask =
+			wlan_cfg_get_tx_mon_ring_mask(soc->wlan_cfg_ctx, i);
 		int rx_err_ring_mask =
 			wlan_cfg_get_rx_err_ring_mask(soc->wlan_cfg_ctx, i);
 		int rx_wbm_rel_ring_mask =
@@ -3046,6 +3067,7 @@ static QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc)
 		soc->intr_ctx[i].tx_ring_mask = tx_mask;
 		soc->intr_ctx[i].rx_ring_mask = rx_mask;
 		soc->intr_ctx[i].rx_mon_ring_mask = rx_mon_mask;
+		soc->intr_ctx[i].tx_mon_ring_mask = tx_mon_ring_mask;
 		soc->intr_ctx[i].rx_err_ring_mask = rx_err_ring_mask;
 		soc->intr_ctx[i].rxdma2host_ring_mask = rxdma2host_ring_mask;
 		soc->intr_ctx[i].host2rxdma_ring_mask = host2rxdma_ring_mask;

+ 9 - 1
dp/wifi3.0/dp_types.h

@@ -824,8 +824,14 @@ struct dp_rx_tid {
  * @num_host2rxdma_ring_masks: interrupts with host2rxdma_ring_mask set
  * @num_rx_ring_near_full_masks: Near-full interrupts for REO DST ring
  * @num_tx_comp_ring_near_full_masks: Near-full interrupts for TX completion
+ * @num_rx_wbm_rel_ring_near_full_masks: total number of times the wbm rel ring
+ *                                       near full interrupt was received
+ * @num_reo_status_ring_near_full_masks: total number of times the reo status
+ *                                       near full interrupt was received
+ * @num_near_full_masks: total number of times the near full interrupt
+ *                       was received
  * @num_masks: total number of times the interrupt was received
- * @num_masks: total number of times the near full interrupt was received
+ * @num_tx_mon_ring_masks: interrupts with num_tx_mon_ring_masks set
  *
  * Counter for individual masks are incremented only if there are any packets
  * on that ring.
@@ -845,6 +851,7 @@ struct dp_intr_stats {
 	uint32_t num_reo_status_ring_near_full_masks;
 	uint32_t num_near_full_masks;
 	uint32_t num_masks;
+	uint32_t num_tx_mon_ring_masks;
 };
 
 /* per interrupt context  */
@@ -854,6 +861,7 @@ struct dp_intr {
 	uint8_t rx_ring_mask;   /* Rx REO rings (0-3) associated
 				with this interrupt context */
 	uint8_t rx_mon_ring_mask;  /* Rx monitor ring mask (0-2) */
+	uint8_t tx_mon_ring_mask;  /* Tx monitor ring mask (0-2) */
 	uint8_t rx_err_ring_mask; /* REO Exception Ring */
 	uint8_t rx_wbm_rel_ring_mask; /* WBM2SW Rx Release Ring */
 	uint8_t reo_status_ring_mask; /* REO command response ring */

+ 0 - 7
dp/wifi3.0/monitor/2.0/dp_mon_2.0.c

@@ -378,13 +378,6 @@ dp_rx_mon_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx,
 	return 0;
 }
 
-static uint32_t
-dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
-		  uint32_t mac_id, uint32_t quota)
-{
-	return 0;
-}
-
 static
 QDF_STATUS dp_mon_soc_detach_2_0(struct dp_soc *soc)
 {

+ 14 - 0
dp/wifi3.0/monitor/dp_mon.h

@@ -1764,6 +1764,13 @@ uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
 
 	return monitor_ops->mon_rx_process(soc, int_ctx, mac_id, quota);
 }
+
+static inline uint32_t
+dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
+		  uint32_t mac_id, uint32_t quota)
+{
+	return 0;
+}
 #else
 static inline
 uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
@@ -1771,6 +1778,13 @@ uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
 {
 	return 0;
 }
+
+static inline uint32_t
+dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
+		  uint32_t mac_id, uint32_t quota)
+{
+	return 0;
+}
 #endif
 
 /*

+ 4 - 0
wlan_cfg/cfg_dp.h

@@ -344,6 +344,10 @@
 #define WLAN_CFG_TX_MONITOR_DST_RING_SIZE_MIN 48
 #define WLAN_CFG_TX_MONITOR_DST_RING_SIZE_MAX 4096
 
+#define WLAN_CFG_TX_MONITOR_BUF_SIZE 2048
+#define WLAN_CFG_TX_MONITOR_BUF_SIZE_MIN 48
+#define WLAN_CFG_TX_MONITOR_BUF_SIZE_MAX 8192
+
 #define WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE 1024
 #define WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE_MIN 16
 #define WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE_MAX 8192

+ 30 - 0
wlan_cfg/wlan_cfg.c

@@ -53,6 +53,9 @@
 #define WLAN_CFG_RX_MON_RING_MASK_2 0x4
 #define WLAN_CFG_RX_MON_RING_MASK_3 0x0
 
+#define WLAN_CFG_TX_MON_RING_MASK_0 BIT(0)
+#define WLAN_CFG_TX_MON_RING_MASK_1 BIT(1)
+
 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
@@ -90,6 +93,7 @@ struct dp_int_mask_assignment {
 	uint8_t tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
+	uint8_t tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
@@ -1300,6 +1304,10 @@ static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIO
 		  WLAN_CFG_RX_MON_RING_MASK_1,
 		  WLAN_CFG_RX_MON_RING_MASK_2,
 		  0, 0, 0, 0, 0},
+		/* tx mon ring masks */
+		{ WLAN_CFG_TX_MON_RING_MASK_0,
+		  WLAN_CFG_TX_MON_RING_MASK_1,
+		  0, 0, 0, 0, 0, 0},
 		/* host2rxdma ring masks */
 		{ 0, 0, 0,
 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0,
@@ -1393,6 +1401,13 @@ struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
 	.low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
 };
 
+/* TX_MONITOR_BUF ring configuration */
+struct wlan_srng_cfg wlan_srng_tx_monitor_buf_cfg = {
+	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_TX,
+	.batch_count_threshold = 0,
+	.low_threshold = WLAN_CFG_TX_MONITOR_BUF_SIZE_MAX >> 3,
+};
+
 /* DEFAULT_CONFIG ring configuration */
 struct wlan_srng_cfg wlan_srng_default_cfg = {
 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
@@ -1425,6 +1440,7 @@ void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
 #ifdef WLAN_FEATURE_CIF_CFR
 	g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
 #endif
+	g_wlan_srng_cfg[TX_MONITOR_BUF] = wlan_srng_tx_monitor_buf_cfg;
 	*wlan_cfg = g_wlan_srng_cfg;
 }
 
@@ -1447,6 +1463,7 @@ void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
 		wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask_msi[i];
 		wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
 							rx_mon_ring_mask_msi[i];
+		wlan_cfg_ctx->int_tx_mon_ring_mask[i] = 0;
 		wlan_cfg_ctx->int_rx_err_ring_mask[i] =
 							rx_err_ring_mask_msi[i];
 		wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
@@ -1501,6 +1518,8 @@ void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
 			dp_mask_assignment[interrupt_index].tx_ring_mask[i];
 		wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
 			dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
+		wlan_cfg_ctx->int_tx_mon_ring_mask[i] =
+			dp_mask_assignment[interrupt_index].tx_mon_ring_mask[i];
 		wlan_cfg_ctx->int_rx_err_ring_mask[i] =
 			dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
 		wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
@@ -1915,6 +1934,12 @@ void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
 	cfg->int_rx_mon_ring_mask[context] = mask;
 }
 
+void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
+				   int context, int mask)
+{
+	cfg->int_tx_mon_ring_mask[context] = mask;
+}
+
 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
 					  int context)
 {
@@ -2094,6 +2119,11 @@ int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
 	return cfg->int_rx_mon_ring_mask[context];
 }
 
+int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
+{
+	return cfg->int_tx_mon_ring_mask[context];
+}
+
 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
 {
 	return cfg->int_ce_ring_mask[context];

+ 26 - 0
wlan_cfg/wlan_cfg.h

@@ -137,6 +137,8 @@ struct wlan_srng_cfg {
  * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
  * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
  *			  NAPI/Intr context
+ * @int_tx_mon_ring_mask: Bitmap of Tx monitor ring interrupts mapped to each
+ *			  NAPI/Intr context
  * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
  *			  NAPI/Intr context
  * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
@@ -261,6 +263,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	uint8_t int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
+	uint8_t int_tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
 	uint8_t int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
@@ -607,6 +610,29 @@ int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
 		int context);
 
+/**
+ * wlan_cfg_set_tx_mon_ring_mask() - Set Tx monitor ring interrupt mask
+ *				   mapped to an interrupt context
+ * @wlan_cfg_ctx - Configuration Handle
+ * @context - Numerical ID identifying the Interrupt/NAPI context
+ * @mask: Interrupt mask
+ *
+ * Return: None
+ */
+void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
+				   int context, int mask);
+
+/**
+ * wlan_cfg_get_tx_mon_ring_mask() - Return Tx monitor ring interrupt mask
+ *				   mapped to an interrupt context
+ * @wlan_cfg_ctx - Configuration Handle
+ * @context - Numerical ID identifying the Interrupt/NAPI context
+ *
+ * Return: int_tx_mon_ring_mask[context]
+ */
+int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
+				  int context);
+
 /**
  * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
  *				   for the given interrupt context