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

qcacmn: support msdu rx retry statistics

Add the interface to support the rx retry statistics.

Change-Id: I02bbf2e69eefbd7ef61ab2540c1aacabb4ce3aef
CRs-Fixed: 2505486
Paul Zhang 5 жил өмнө
parent
commit
1275896960

+ 0 - 1
dp/inc/cdp_txrx_host_stats.h

@@ -24,7 +24,6 @@
 #ifndef _CDP_TXRX_HOST_STATS_H_
 #define _CDP_TXRX_HOST_STATS_H_
 #include "cdp_txrx_handle.h"
-#include "cdp_txrx_extd_struct.h"
 /**
  * cdp_host_stats_get: cdp call to get host stats
  * @soc: SOC handle

+ 4 - 0
dp/wifi3.0/dp_rx.c

@@ -1366,6 +1366,7 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc,
 	DP_STATS_INC_PKT(peer, rx.rcvd_reo[ring_id], 1, msdu_len);
 	DP_STATS_INCC(peer, rx.non_amsdu_cnt, 1, is_not_amsdu);
 	DP_STATS_INCC(peer, rx.amsdu_cnt, 1, !is_not_amsdu);
+	DP_STATS_INCC(peer, rx.rx_retries, 1, qdf_nbuf_is_rx_retry_flag(nbuf));
 
 	tid_stats->msdu_cnt++;
 	if (qdf_unlikely(qdf_nbuf_is_da_mcbc(nbuf) &&
@@ -1798,6 +1799,9 @@ more_data:
 		/* Get MSDU DESC info */
 		hal_rx_msdu_desc_info_get(ring_desc, &msdu_desc_info);
 
+		if (mpdu_desc_info.mpdu_flags & HAL_MPDU_F_RETRY_BIT)
+			qdf_nbuf_set_rx_retry_flag(rx_desc->nbuf, 1);
+
 		if (qdf_unlikely(mpdu_desc_info.mpdu_flags &
 				HAL_MPDU_F_RAW_AMPDU)) {
 			/* previous msdu has end bit set, so current one is

+ 23 - 0
qdf/inc/qdf_nbuf.h

@@ -1271,6 +1271,29 @@ static inline int qdf_nbuf_is_sa_valid(qdf_nbuf_t buf)
 	return __qdf_nbuf_is_sa_valid(buf);
 }
 
+/**
+ * qdf_nbuf_set_rx_retry_flag() - set rx retry flag bit
+ * @buf: Network buffer
+ * @val: 0/1
+ *
+ * Return: void
+ */
+static inline void qdf_nbuf_set_rx_retry_flag(qdf_nbuf_t buf, uint8_t val)
+{
+	__qdf_nbuf_set_rx_retry_flag(buf, val);
+}
+
+/**
+ * qdf_nbuf_is_rx_retry_flag() - get rx retry flag bit
+ * @buf: Network buffer
+ *
+ * Return: integer value - 0/1
+ */
+static inline int qdf_nbuf_is_rx_retry_flag(qdf_nbuf_t buf)
+{
+	return __qdf_nbuf_is_rx_retry_flag(buf);
+}
+
 /**
  * qdf_nbuf_set_raw_frame() - set  raw_frame bit
  * @buf: Network buffer

+ 13 - 1
qdf/linux/src/i_qdf_nbuf.h

@@ -150,6 +150,7 @@ typedef union {
  * @rx.is_raw_frame: RAW frame
  * @rx.fcs_err: FCS error
  * @rx.tid_val: tid value
+ * @rx.flag_retry: flag to indicate MSDU is retried
  * @rx.reserved: reserved
  *
  * @tx.dev.priv_cb_w.fctx: ctx to handle special pkts defined by ftype
@@ -265,7 +266,8 @@ struct qdf_nbuf_cb {
 			uint8_t is_raw_frame:1,
 				fcs_err:1,
 				tid_val:4,
-				reserved:2;
+				flag_retry:1,
+				reserved:1;
 		} rx;
 
 		/* Note: MAX: 40 bytes */
@@ -404,6 +406,10 @@ QDF_COMPILE_TIME_ASSERT(qdf_nbuf_cb_size,
 	(((struct qdf_nbuf_cb *) \
 	((skb)->cb))->u.rx.flag_sa_valid)
 
+#define QDF_NBUF_CB_RX_RETRY_FLAG(skb) \
+	(((struct qdf_nbuf_cb *) \
+	((skb)->cb))->u.rx.flag_retry)
+
 #define QDF_NBUF_CB_RX_RAW_FRAME(skb) \
 	(((struct qdf_nbuf_cb *) \
 	((skb)->cb))->u.rx.is_raw_frame)
@@ -643,6 +649,12 @@ typedef void (*qdf_nbuf_free_t)(__qdf_nbuf_t);
 #define __qdf_nbuf_is_sa_valid(skb) \
 	(QDF_NBUF_CB_RX_SA_VALID((skb)))
 
+#define __qdf_nbuf_set_rx_retry_flag(skb, val) \
+	((QDF_NBUF_CB_RX_RETRY_FLAG((skb))) = val)
+
+#define __qdf_nbuf_is_rx_retry_flag(skb) \
+	(QDF_NBUF_CB_RX_RETRY_FLAG((skb)))
+
 #define __qdf_nbuf_set_raw_frame(skb, val) \
 	((QDF_NBUF_CB_RX_RAW_FRAME((skb))) = val)