From f8a401631f83b5bb71e2d11d2ee5a32e67fb7d28 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Mon, 28 Dec 2020 00:09:44 -0800 Subject: [PATCH] qcacld-3.0: Fix invalid BW vote for FISA aggregation case Currently for FISA aggregated RX frame, one skb will contain 2~16 RX msdu, if only count 1 RX msdu into stats, BW vote is not right that even if RX T-put > 1 Gbps, wlan only vote 4(high), this can not satisfy the vote requirement for peak T-put > 2 Gbps which should be 5(very high) which then degrade the T-put. Fix RX packets stats correctly for aggregated RX frame. Change-Id: Idd0cee1b68555dedad49025c03a13a929ec2af1c CRs-Fixed: 2838667 --- core/hdd/src/wlan_hdd_softap_tx_rx.c | 4 +++- core/hdd/src/wlan_hdd_tx_rx.c | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 28c3be00fe42..9a2a024de7a2 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2021 The Linux Foundation. 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 @@ -1117,6 +1117,8 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf) cpu_index = wlan_hdd_get_cpu(); ++adapter->hdd_stats.tx_rx_stats.rx_packets[cpu_index]; ++adapter->stats.rx_packets; + /* count aggregated RX frame into stats */ + adapter->stats.rx_packets += qdf_nbuf_get_gso_segs(skb); adapter->stats.rx_bytes += skb->len; /* Send DHCP Indication to FW */ diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 11e0f1a6cda1..7ed4c67e4c45 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2021 The Linux Foundation. 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 @@ -2313,7 +2313,8 @@ QDF_STATUS hdd_rx_deliver_to_stack(struct hdd_adapter *adapter, adapter->hdd_stats.tx_rx_stats.rx_non_aggregated++; /* Account for GRO/LRO ineligible packets, mostly UDP */ - hdd_ctx->no_rx_offload_pkt_cnt++; + if (qdf_nbuf_get_gso_segs(skb) == 0) + hdd_ctx->no_rx_offload_pkt_cnt++; if (qdf_likely((hdd_ctx->enable_dp_rx_threads || hdd_ctx->enable_rxthread) && @@ -2371,7 +2372,8 @@ QDF_STATUS hdd_rx_deliver_to_stack(struct hdd_adapter *adapter, adapter->hdd_stats.tx_rx_stats.rx_non_aggregated++; /* Account for GRO/LRO ineligible packets, mostly UDP */ - hdd_ctx->no_rx_offload_pkt_cnt++; + if (qdf_nbuf_get_gso_segs(skb) == 0) + hdd_ctx->no_rx_offload_pkt_cnt++; if (qdf_likely((hdd_ctx->enable_dp_rx_threads || hdd_ctx->enable_rxthread) && @@ -2599,6 +2601,8 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context, skb->protocol = eth_type_trans(skb, skb->dev); ++adapter->hdd_stats.tx_rx_stats.rx_packets[cpu_index]; ++adapter->stats.rx_packets; + /* count aggregated RX frame into stats */ + adapter->stats.rx_packets += qdf_nbuf_get_gso_segs(skb); adapter->stats.rx_bytes += skb->len; /* Incr GW Rx count for NUD tracking based on GW mac addr */