From 2d75a88f1e664225ebc0e4058332b97265f4d66d Mon Sep 17 00:00:00 2001 From: Harsh Kumar Bijlani Date: Thu, 16 Mar 2023 13:20:26 +0530 Subject: [PATCH] qcacmn: Fix MLO link stats issues Add link_id check while aggregatin stats into vdev at time of peer unmap, otherwise vdev stats are aggregated twice and hence give incorrect output. Also comment out link_id fetch in BE Rx path as it is currently not enabled. Change-Id: I91ceab4c6380bbd6e0cb2717adb2413e9e8e4221 CRs-Fixed: 3435688 --- dp/wifi3.0/be/dp_be_rx.c | 2 ++ dp/wifi3.0/dp_stats.c | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dp/wifi3.0/be/dp_be_rx.c b/dp/wifi3.0/be/dp_be_rx.c index 584a9233a0..ec1b8dbd32 100644 --- a/dp/wifi3.0/be/dp_be_rx.c +++ b/dp/wifi3.0/be/dp_be_rx.c @@ -565,6 +565,7 @@ done: rx_bufs_used++; +#ifdef DP_MLO_LINK_STATS_SUPPORT /* MLD Link Peer Statistics support */ if (txrx_peer->is_mld_peer && rx_pdev->link_peer_stats) { link_id = ((dp_rx_get_msdu_hw_link_id(nbuf)) + 1); @@ -573,6 +574,7 @@ done: } else { link_id = 0; } +#endif /* when hlos tid override is enabled, save tid in * skb->priority diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index f2923519d1..28bdec3c8e 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -8565,10 +8565,11 @@ void dp_update_vdev_stats_on_peer_unmap(struct dp_vdev *vdev, if (IS_MLO_DP_LINK_PEER(peer)) { link_id = dp_get_peer_hw_link_id(soc, pdev); - per_pkt_stats = &txrx_peer-> - stats[link_id].per_pkt_stats; - DP_UPDATE_PER_PKT_STATS(vdev_stats, - per_pkt_stats); + if (link_id > 0) { + per_pkt_stats = + &txrx_peer->stats[link_id].per_pkt_stats; + DP_UPDATE_PER_PKT_STATS(vdev_stats, per_pkt_stats); + } } link_stats: