Return-path: Received: from mail-qg0-f44.google.com ([209.85.192.44]:35670 "EHLO mail-qg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbcCVBOY (ORCPT ); Mon, 21 Mar 2016 21:14:24 -0400 Received: by mail-qg0-f44.google.com with SMTP id y89so167743935qge.2 for ; Mon, 21 Mar 2016 18:14:24 -0700 (PDT) From: Marty Faltesek To: akarwar@marvell.com Cc: linux-wireless@vger.kernel.org, dgentry@google.com, apenwarr@google.com Subject: [PATCH] mwifiex: transmit packet stats incorrect. Date: Mon, 21 Mar 2016 21:13:55 -0400 Message-Id: <1458609235-14686-1-git-send-email-mfaltesek@google.com> (sfid-20160322_021520_486571_014C1A46) Sender: linux-wireless-owner@vger.kernel.org List-ID: tx_packets counter is incremented for aggregated packets, when it had already been incremented for the aggregated packet's constituent parts. Removing the extra count. --- drivers/net/wireless/marvell/mwifiex/txrx.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/txrx.c b/drivers/net/wireless/marvell/mwifiex/txrx.c index bf6182b..abdd0cf 100644 --- a/drivers/net/wireless/marvell/mwifiex/txrx.c +++ b/drivers/net/wireless/marvell/mwifiex/txrx.c @@ -297,6 +297,13 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, goto done; mwifiex_set_trans_start(priv->netdev); + + if (tx_info->flags & MWIFIEX_BUF_FLAG_BRIDGED_PKT) + atomic_dec_return(&adapter->pending_bridged_pkts); + + if (tx_info->flags & MWIFIEX_BUF_FLAG_AGGR_PKT) + goto done; + if (!status) { priv->stats.tx_packets++; priv->stats.tx_bytes += tx_info->pkt_len; @@ -306,12 +313,6 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, priv->stats.tx_errors++; } - if (tx_info->flags & MWIFIEX_BUF_FLAG_BRIDGED_PKT) - atomic_dec_return(&adapter->pending_bridged_pkts); - - if (tx_info->flags & MWIFIEX_BUF_FLAG_AGGR_PKT) - goto done; - if (aggr) /* For skb_aggr, do not wake up tx queue */ goto done; -- 2.8.0.rc3.226.g39d4020