Ver Fonte

qcacmn: For Rx multicast/bcast stats, make mcast as superset

make it inline with TX, make multicast stats to
include bcast packets also

CRs-Fixed: 2298834
Change-Id: Id30af0a6ddd784b268b9707ea2df1bcd255dd2cf
Amir Patel há 6 anos atrás
pai
commit
3217ade780
3 ficheiros alterados com 23 adições e 16 exclusões
  1. 4 8
      dp/wifi3.0/dp_internal.h
  2. 2 2
      dp/wifi3.0/dp_rx.c
  3. 17 6
      dp/wifi3.0/dp_rx_err.c

+ 4 - 8
dp/wifi3.0/dp_internal.h

@@ -471,12 +471,10 @@ static inline void dp_update_vdev_stats(struct cdp_vdev_stats *tgtobj,
 
 	srcobj->stats.rx.unicast.num =
 		srcobj->stats.rx.to_stack.num -
-				(srcobj->stats.rx.multicast.num +
-				 srcobj->stats.rx.bcast.num);
+				srcobj->stats.rx.multicast.num;
 	srcobj->stats.rx.unicast.bytes =
 		srcobj->stats.rx.to_stack.bytes -
-				(srcobj->stats.rx.multicast.bytes +
-				 srcobj->stats.rx.bcast.bytes);
+				srcobj->stats.rx.multicast.bytes;
 
 	tgtobj->rx.unicast.num += srcobj->stats.rx.unicast.num;
 	tgtobj->rx.unicast.bytes += srcobj->stats.rx.unicast.bytes;
@@ -572,12 +570,10 @@ static inline void dp_update_vdev_stats(struct cdp_vdev_stats *tgtobj,
 									\
 		_srcobj->stats.rx.unicast.num = \
 			_srcobj->stats.rx.to_stack.num - \
-					(_srcobj->stats.rx.multicast.num +  \
-					_srcobj->stats.rx.bcast.num); \
+					_srcobj->stats.rx.multicast.num; \
 		_srcobj->stats.rx.unicast.bytes = \
 			_srcobj->stats.rx.to_stack.bytes - \
-					(_srcobj->stats.rx.multicast.bytes + \
-					_srcobj->stats.rx.bcast.bytes); \
+					_srcobj->stats.rx.multicast.bytes; \
 		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.unicast); \
 		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.multicast); \
 		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.bcast); \

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

@@ -1105,10 +1105,10 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc,
 	if (qdf_unlikely(hal_rx_msdu_end_da_is_mcbc_get(rx_tlv_hdr) &&
 			 (vdev->rx_decap_type == htt_cmn_pkt_type_ethernet))) {
 		eh = (struct ether_header *)qdf_nbuf_data(nbuf);
+		DP_STATS_INC_PKT(peer, rx.multicast, 1, msdu_len);
 		if (IEEE80211_IS_BROADCAST(eh->ether_dhost)) {
 			DP_STATS_INC_PKT(peer, rx.bcast, 1, msdu_len);
-		} else {
-			DP_STATS_INC_PKT(peer, rx.multicast, 1, msdu_len);
+
 		}
 	}
 

+ 17 - 6
dp/wifi3.0/dp_rx_err.c

@@ -569,6 +569,7 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc,
 	uint16_t peer_id = 0xFFFF;
 	struct dp_peer *peer = NULL;
 	uint8_t tid;
+	struct ether_header *eh;
 
 	qdf_nbuf_set_rx_chfrag_start(nbuf,
 			hal_rx_msdu_end_first_msdu_get(rx_tlv_hdr));
@@ -722,12 +723,21 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc,
 				vdev->osif_rx);
 			qdf_nbuf_set_next(nbuf, NULL);
 			vdev->osif_rx(vdev->osif_vdev, nbuf);
-			DP_STATS_INCC_PKT(vdev->pdev, rx.multicast, 1,
-				qdf_nbuf_len(nbuf),
-				hal_rx_msdu_end_da_is_mcbc_get(
-					rx_tlv_hdr));
-			DP_STATS_INC_PKT(vdev->pdev, rx.to_stack, 1,
-							qdf_nbuf_len(nbuf));
+			DP_STATS_INC_PKT(peer, rx.to_stack, 1,
+					 qdf_nbuf_len(nbuf));
+			if (qdf_unlikely(hal_rx_msdu_end_da_is_mcbc_get(
+						rx_tlv_hdr) &&
+					 (vdev->rx_decap_type ==
+					  htt_cmn_pkt_type_ethernet))) {
+				eh = (struct ether_header *)qdf_nbuf_data(nbuf);
+
+				DP_STATS_INC_PKT(peer, rx.multicast, 1,
+						 qdf_nbuf_len(nbuf));
+				if (IEEE80211_IS_BROADCAST(eh->ether_dhost)) {
+					DP_STATS_INC_PKT(peer, rx.bcast, 1,
+							 qdf_nbuf_len(nbuf));
+				}
+			}
 		} else {
 			QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 				FL("INVALID vdev %pK OR osif_rx"), vdev);
@@ -838,6 +848,7 @@ dp_rx_err_deliver(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr)
 		eh = (struct ether_header *)qdf_nbuf_data(nbuf);
 		isBroadcast = (IEEE80211_IS_BROADCAST
 				(eh->ether_dhost)) ? 1 : 0 ;
+		DP_STATS_INC_PKT(peer, rx.multicast, 1, qdf_nbuf_len(nbuf));
 		if (isBroadcast) {
 			DP_STATS_INC_PKT(peer, rx.bcast, 1,
 					qdf_nbuf_len(nbuf));