Explorar el Código

qcacmn: Filter setting and pktlog processing support

Add filter setting and pktlog processing support for
rx based pktlog.

Change-Id: I64b76759f348ef75b45b4166495aa733995de474
CRs-Fixed: 3109099
Adwait Nayak hace 3 años
padre
commit
71cb851a00

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

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 above
@@ -1249,7 +1249,7 @@ void dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev)
 	struct dp_mon_filter_be filter = {0};
 	enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_FULL_MODE;
 	enum dp_mon_filter_srng_type srng_type =
-		DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
+		DP_MON_FILTER_SRNG_TYPE_RXMON_DEST;
 	struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
 	struct dp_mon_pdev_be *mon_pdev_be =
 			dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
@@ -1282,7 +1282,7 @@ void dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev)
 	struct dp_mon_filter_be filter = {0};
 	enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_FULL_MODE;
 	enum dp_mon_filter_srng_type srng_type =
-		DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
+		DP_MON_FILTER_SRNG_TYPE_RXMON_DEST;
 	struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
 	struct dp_mon_pdev_be *mon_pdev_be =
 			dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
@@ -1300,7 +1300,7 @@ void dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev)
 	struct dp_mon_filter_be filter = {0};
 	enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_LITE_MODE;
 	enum dp_mon_filter_srng_type srng_type =
-		DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
+		DP_MON_FILTER_SRNG_TYPE_RXMON_DEST;
 	struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
 	struct dp_mon_pdev_be *mon_pdev_be =
 			dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
@@ -1324,7 +1324,7 @@ void dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev)
 	struct dp_mon_filter_be filter = {0};
 	enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_LITE_MODE;
 	enum dp_mon_filter_srng_type srng_type =
-		DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
+		DP_MON_FILTER_SRNG_TYPE_RXMON_DEST;
 	struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
 	struct dp_mon_pdev_be *mon_pdev_be =
 			dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
@@ -1377,7 +1377,7 @@ void dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev)
 	struct dp_soc *soc;
 	enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_CBF_MODE;
 	enum dp_mon_filter_srng_type srng_type =
-		DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
+		DP_MON_FILTER_SRNG_TYPE_RXMON_DEST;
 	struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
 	struct dp_mon_pdev_be *mon_pdev_be =
 			dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
@@ -1439,7 +1439,7 @@ void dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev)
 
 	dp_mon_filter_set_reset_rx_pkt_log_cbf_dest_2_0(pdev_be, &filter);
 
-	srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
+	srng_type = DP_MON_FILTER_SRNG_TYPE_RXMON_DEST;
 	mon_pdev_be->filter_be[mode][srng_type] = filter;
 }
 

+ 7 - 1
dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 above
@@ -37,6 +37,7 @@ dp_rx_mon_srng_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx,
 	void *rx_mon_dst_ring_desc;
 	hal_soc_handle_t hal_soc;
 	void *mon_dst_srng;
+	struct hal_rx_ppdu_info *ppdu_info;
 	struct dp_mon_pdev *mon_pdev;
 	struct dp_mon_soc *mon_soc = soc->monitor_soc;
 	struct dp_mon_soc_be *mon_soc_be = dp_get_be_mon_soc_from_dp_mon_soc(mon_soc);
@@ -52,6 +53,7 @@ dp_rx_mon_srng_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx,
 
 	mon_pdev = pdev->monitor_pdev;
 	mon_dst_srng = soc->rxdma_mon_dst_ring[mac_id].hal_srng;
+	ppdu_info = &mon_pdev->ppdu_info;
 
 	if (!mon_dst_srng || !hal_srng_initialized(mon_dst_srng)) {
 		dp_mon_err("%pK: : HAL Monitor Destination Ring Init Failed -- %pK",
@@ -93,6 +95,10 @@ dp_rx_mon_srng_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx,
 			mon_desc->unmapped = 1;
 		}
 
+		dp_rx_process_pktlog(soc, pdev, ppdu_info,
+				     mon_desc->buf_addr,
+				     hal_mon_rx_desc.end_offset);
+
 		dp_rx_mon_process_status_tlv(soc, pdev,
 					     &hal_mon_rx_desc,
 					     mon_desc->paddr);

+ 15 - 1
dp/wifi3.0/monitor/2.0/dp_rx_mon_2.0.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 above
@@ -124,6 +124,20 @@ void
 dp_rx_mon_populate_ppdu_info_2_0(struct hal_rx_ppdu_info *hal_ppdu_info,
 				 struct cdp_rx_indication_ppdu *ppdu);
 
+/*
+ * dp_rx_process_pktlog() - process pktlog
+ * @soc: dp soc handle
+ * @pdev: dp pdev handle
+ * @ppdu_info: HAL PPDU info
+ * @status_frag: frag pointer which needs to be added to nbuf
+ * @end_offset: Offset in frag to be added to nbuf_frags
+ *
+ * Return: void
+ */
+void dp_rx_process_pktlog(struct dp_soc *soc, struct dp_pdev *pdev,
+			  struct hal_rx_ppdu_info *ppdu_info,
+			  void *status_frag, uint32_t end_offset);
+
 #if !defined(DISABLE_MON_CONFIG)
 /*
  * dp_rx_mon_process_2_0 () - Process Rx monitor interrupt

+ 12 - 12
dp/wifi3.0/monitor/2.0/dp_rx_mon_status_2.0.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 above
@@ -34,28 +34,29 @@ void dp_rx_mon_process_status_tlv(struct dp_soc *soc,
 	/* API to process status tlv */
 }
 
-static inline void
-dp_rx_process_pktlog(struct dp_soc *soc,
+void
+dp_rx_process_pktlog(struct dp_soc *soc, struct dp_pdev *pdev,
 		     struct hal_rx_ppdu_info *ppdu_info,
-		     void *status_frag, struct dp_pdev *pdev)
+		     void *status_frag, uint32_t end_offset)
 {
-	struct dp_mon_pdev *mon_pdev;
+	struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
 	qdf_nbuf_t nbuf = NULL;
 	enum WDI_EVENT pktlog_mode = WDI_NO_VAL;
 
+	if (!mon_pdev->dp_peer_based_pktlog &&
+	    (mon_pdev->rx_pktlog_mode == DP_RX_PKTLOG_DISABLED)) {
+		return;
+	}
+
 	nbuf = qdf_nbuf_alloc(soc->osdev, RX_MON_MIN_HEAD_ROOM,
 			      RX_BUFFER_RESERVATION, 0, FALSE);
 	if (!nbuf)
 		return;
 
-	qdf_nbuf_add_rx_frag(status_frag, nbuf,
-			     (ppdu_info->data -
-			      (unsigned char *)status_frag),
-			     ppdu_info->hdr_len,
+	qdf_nbuf_add_rx_frag(status_frag, nbuf, 0,
+			     end_offset,
 			     RX_MON_MIN_HEAD_ROOM, FALSE);
 
-	mon_pdev = pdev->monitor_pdev;
-
 	if (mon_pdev->dp_peer_based_pktlog) {
 		dp_rx_process_peer_based_pktlog(soc, ppdu_info,
 						nbuf, pdev->pdev_id);
@@ -70,6 +71,5 @@ dp_rx_process_pktlog(struct dp_soc *soc,
 					     nbuf, HTT_INVALID_PEER,
 					     WDI_NO_VAL, pdev->pdev_id);
 	}
-	qdf_nbuf_free(nbuf);
 }
 

+ 1 - 1
dp/wifi3.0/monitor/dp_mon.c

@@ -5178,7 +5178,7 @@ void dp_mon_feature_ops_deregister(struct dp_soc *soc)
 	mon_ops->mon_filter_reset_rx_pkt_log_lite = NULL;
 	mon_ops->mon_filter_setup_rx_pkt_log_cbf = NULL;
 	mon_ops->mon_filter_reset_rx_pkt_log_cbf = NULL;
-#ifdef QCA_WIFI_QCN9224
+#ifdef BE_PKTLOG_SUPPORT
 	mon_ops->mon_filter_setup_pktlog_hybrid = NULL;
 	mon_ops->mon_filter_reset_pktlog_hybrid = NULL;
 #endif