Browse Source

qcacmn: Add stats to indicate drop in EAPOL frames

Add the stats to indicate the packet drop for EAPOL packets.
This will be useful for the debug of EAPOL packet drop.

CRs-Fixed: 3329895
Change-Id: I5e0abb4e574116a55de124c0012c17154c7c63da
Sreeramya Soratkal 2 years ago
parent
commit
97b9620964
3 changed files with 75 additions and 0 deletions
  1. 20 0
      dp/inc/cdp_txrx_stats_struct.h
  2. 13 0
      dp/wifi3.0/dp_stats.c
  3. 42 0
      dp/wifi3.0/dp_tx.c

+ 20 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -2946,6 +2946,26 @@ struct cdp_pdev_stats {
 		uint32_t data_users[OFDMA_NUM_USERS];
 	} ul_ofdma;
 
+	/**
+	 * struct eap_drop_stats: EAPOL packet drop stats information
+	 * @tx_desc_error: Total number EAPOL packets dropped due to TX
+	 *		   descriptor error
+	 * @tx_hal_ring_access_err: Total EAPOL packets dropped due to
+	 *			     HAL ring access failure
+	 * @tx_dma_map_err: EAPOL packets dropped due to error in DMA map
+	 * @tx_hw_enqueue: EAPOL packets dropped by the host due to failure
+	 *		   in HW enqueue
+	 * @tx_sw_enqueue: EAPOL packets dropped by the host due to failure
+	 *		   in SW enqueue
+	 */
+	struct {
+		uint8_t tx_desc_err;
+		uint8_t tx_hal_ring_access_err;
+		uint8_t tx_dma_map_err;
+		uint8_t tx_hw_enqueue;
+		uint8_t tx_sw_enqueue;
+	} eap_drop_stats;
+
 	struct cdp_tso_stats tso_stats;
 	struct cdp_cfr_rcc_stats rcc;
 

+ 13 - 0
dp/wifi3.0/dp_stats.c

@@ -7507,6 +7507,19 @@ dp_print_pdev_tx_stats(struct dp_pdev *pdev)
 		       pdev->stats.tx_i.mcast_en.dropped_send_fail);
 	DP_PRINT_STATS("	Unicast sent = %u",
 		       pdev->stats.tx_i.mcast_en.ucast);
+
+	DP_PRINT_STATS("EAPOL Packets dropped:");
+	DP_PRINT_STATS("        Dropped: TX desc errors = %u",
+		       pdev->stats.eap_drop_stats.tx_desc_err);
+	DP_PRINT_STATS("        Dropped: Tx HAL ring access errors = %u",
+		       pdev->stats.eap_drop_stats.tx_hal_ring_access_err);
+	DP_PRINT_STATS("        Dropped: TX DMA map errors = %u",
+		       pdev->stats.eap_drop_stats.tx_dma_map_err);
+	DP_PRINT_STATS("        Dropped: Tx HW enqueue errors = %u",
+		       pdev->stats.eap_drop_stats.tx_hw_enqueue);
+	DP_PRINT_STATS("        Dropped: TX SW enqueue errors= %u",
+		       pdev->stats.eap_drop_stats.tx_sw_enqueue);
+
 	DP_PRINT_STATS("IGMP Mcast Enhancement:");
 	DP_PRINT_STATS("	IGMP packets received = %u",
 		       pdev->stats.tx_i.igmp_mcast_en.igmp_rcvd);

+ 42 - 0
dp/wifi3.0/dp_tx.c

@@ -2222,6 +2222,45 @@ dp_tx_update_mcast_param(uint16_t peer_id,
 {
 }
 #endif
+
+#ifdef DP_TX_SW_DROP_STATS_INC
+static void tx_sw_drop_stats_inc(struct dp_pdev *pdev,
+				 qdf_nbuf_t nbuf,
+				 enum cdp_tx_sw_drop drop_code)
+{
+	/* EAPOL Drop stats */
+	if (qdf_nbuf_is_ipv4_eapol_pkt(nbuf)) {
+		switch (drop_code) {
+		case TX_DESC_ERR:
+			DP_STATS_INC(pdev, eap_drop_stats.tx_desc_err, 1);
+			break;
+		case TX_HAL_RING_ACCESS_ERR:
+			DP_STATS_INC(pdev,
+				     eap_drop_stats.tx_hal_ring_access_err, 1);
+			break;
+		case TX_DMA_MAP_ERR:
+			DP_STATS_INC(pdev, eap_drop_stats.tx_dma_map_err, 1);
+			break;
+		case TX_HW_ENQUEUE:
+			DP_STATS_INC(pdev, eap_drop_stats.tx_hw_enqueue, 1);
+			break;
+		case TX_SW_ENQUEUE:
+			DP_STATS_INC(pdev, eap_drop_stats.tx_sw_enqueue, 1);
+			break;
+		default:
+			dp_info_rl("Invalid eapol_drop code: %d", drop_code);
+			break;
+		}
+	}
+}
+#else
+static void tx_sw_drop_stats_inc(struct dp_pdev *pdev,
+				 qdf_nbuf_t nbuf,
+				 enum cdp_tx_sw_drop drop_code)
+{
+}
+#endif
+
 /**
  * dp_tx_send_msdu_single() - Setup descriptor and enqueue single MSDU to TCL
  * @vdev: DP vdev handle
@@ -2311,13 +2350,16 @@ dp_tx_send_msdu_single(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 		goto release_desc;
 	}
 
+	tx_sw_drop_stats_inc(pdev, nbuf, drop_code);
 	return NULL;
 
 release_desc:
 	dp_tx_desc_release(tx_desc, tx_q->desc_pool_id);
+	tx_sw_drop_stats_inc(pdev, nbuf, drop_code);
 
 fail_return:
 	dp_tx_get_tid(vdev, nbuf, msdu_info);
+	tx_sw_drop_stats_inc(pdev, nbuf, drop_code);
 	tid_stats = &pdev->stats.tid_stats.
 		    tid_tx_stats[tx_q->ring_id][tid];
 	tid_stats->swdrop_cnt[drop_code]++;